Revision 1360f07e libavcodec/dca.c

View differences:

libavcodec/dca.c
273 273

  
274 274
    /* Primary audio coding header */
275 275
    int subframes;              ///< number of subframes
276
    int is_channels_set;        ///< check for if the channel number is already set
276 277
    int total_channels;         ///< number of channels including extensions
277 278
    int prim_channels;          ///< number of primary audio channels
278 279
    int subband_activity[DCA_PRIM_CHANNELS_MAX];    ///< subband activity count
......
1774 1775
       unset. Ideally during the first probe for channels the crc should be checked
1775 1776
       and only set avctx->channels when the crc is ok. Right now the decoder could
1776 1777
       set the channels based on a broken first frame.*/
1778
    if (s->is_channels_set == 0) {
1779
        s->is_channels_set = 1;
1777 1780
    avctx->channels = channels;
1781
    }
1782
    if (avctx->channels != channels) {
1783
        av_log(avctx, AV_LOG_ERROR, "DCA decoder does not support number of "
1784
               "channels changing in stream. Skipping frame.\n");
1785
        return -1;
1786
    }
1778 1787

  
1779 1788
    if (*data_size < (s->sample_blocks / 8) * 256 * sizeof(int16_t) * channels)
1780 1789
        return -1;

Also available in: Unified diff