summaryrefslogtreecommitdiff
path: root/plugins/ffmpeg
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-12-12 22:20:54 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-12-12 22:20:54 +0100
commitd6c8bce138e4694116a41b7f156b69dc508e0132 (patch)
tree08b6312762877049bfc8bf80c9000d58293f3367 /plugins/ffmpeg
parent7b12c7a3698174c0ddf9f334a0af1fa380b42ab1 (diff)
ffmpeg: update waveformat on every update
Diffstat (limited to 'plugins/ffmpeg')
-rw-r--r--plugins/ffmpeg/ffmpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index bbd6c891..9515465d 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -304,6 +304,11 @@ ffmpeg_read (DB_fileinfo_t *_info, char *bytes, int size) {
trace ("ffmpeg_read_int16 %d\n", size);
ffmpeg_info_t *info = (ffmpeg_info_t*)_info;
+ _info->fmt.channels = info->ctx->channels;
+ _info->fmt.samplerate = info->ctx->sample_rate;
+ _info->fmt.bps = av_get_bits_per_sample_format (info->ctx->sample_fmt);
+ _info->fmt.is_float = (info->ctx->sample_fmt == AV_SAMPLE_FMT_FLT || info->ctx->sample_fmt == AV_SAMPLE_FMT_FLTP);
+
int samplesize = _info->fmt.channels * _info->fmt.bps / 8;
if (info->endsample >= 0 && info->currentsample + size / samplesize > info->endsample) {