aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-10-21 15:12:36 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-11-01 11:29:16 -0400
commit8ac0f6767bf63d3e6b308ee6648ff02598b81e03 (patch)
treeadb18d6f7d3be52028d4c5e9b320956c4fa69eed
parent93e27f86f161ca5ed811be3570289a4f972862dc (diff)
downloadffmpeg-8ac0f6767bf63d3e6b308ee6648ff02598b81e03.tar.gz
dcadec: allow the decoder to change the channel layout mid-stream
-rw-r--r--libavcodec/dcadec.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index eb12eb2db9..026c572689 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -317,7 +317,6 @@ typedef struct {
/* Primary audio coding header */
int subframes; ///< number of subframes
- int is_channels_set; ///< check for if the channel number is already set
int total_channels; ///< number of channels including extensions
int prim_channels; ///< number of primary audio channels
int subband_activity[DCA_PRIM_CHANNELS_MAX]; ///< subband activity count
@@ -1831,22 +1830,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "Non standard configuration %d !\n", s->amode);
return AVERROR_INVALIDDATA;
}
-
-
- /* There is nothing that prevents a dts frame to change channel configuration
- but Libav 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 AVERROR_PATCHWELCOME;
- }
+ avctx->channels = channels;
/* get output buffer */
s->frame.nb_samples = 256 * (s->sample_blocks / 8);