diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-12-12 22:20:54 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-12-12 22:20:54 +0100 |
commit | d6c8bce138e4694116a41b7f156b69dc508e0132 (patch) | |
tree | 08b6312762877049bfc8bf80c9000d58293f3367 /plugins/ffmpeg | |
parent | 7b12c7a3698174c0ddf9f334a0af1fa380b42ab1 (diff) |
ffmpeg: update waveformat on every update
Diffstat (limited to 'plugins/ffmpeg')
-rw-r--r-- | plugins/ffmpeg/ffmpeg.c | 5 |
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) { |