[FFmpeg-cvslog] dca: allow the channel count to change.
Hendrik Leppkes
git at videolan.org
Fri Oct 28 15:33:32 CEST 2011
ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Tue Sep 6 22:22:53 2011 +0200| [7b6ae0e8490be299ba366099d8fa26b6639251c1] | committer: Michael Niedermayer
dca: allow the channel count to change.
(cherry picked from commit 42e78d2296752293cd08c5727f76c3b37c68fb24)
Review-by: Benjamin Larsson
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b6ae0e8490be299ba366099d8fa26b6639251c1
---
libavcodec/dca.c | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index cdd9161..cfef9dd 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -1816,20 +1816,9 @@ static int dca_decode_frame(AVCodecContext * avctx,
return -1;
}
-
- /* There is nothing that prevents a dts frame to change channel configuration
- but FFmpeg doesn't support that so only set the channels if it is previously
- unset. Ideally during the first probe for channels the crc should be checked
- and only set avctx->channels when the crc is ok. Right now the decoder could
- set the channels based on a broken first frame.*/
- if (s->is_channels_set == 0) {
- s->is_channels_set = 1;
- avctx->channels = channels;
- }
if (avctx->channels != channels) {
- av_log(avctx, AV_LOG_ERROR, "DCA decoder does not support number of "
- "channels changing in stream. Skipping frame.\n");
- return -1;
+ av_log(avctx, AV_LOG_INFO, "Number of channels changed in DCA decoder (%d -> %d)\n", avctx->channels, channels);
+ avctx->channels = channels;
}
out_size = 256 / 8 * s->sample_blocks * channels *
More information about the ffmpeg-cvslog
mailing list