~ubuntu-branches/ubuntu/trusty/libav/trusty

« back to all changes in this revision

Viewing changes to libavcodec/ac3dec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler, Jonas Smedegaard, Reinhard Tartler
  • Date: 2013-03-02 14:34:27 UTC
  • mfrom: (1.5.6)
  • mto: (1.3.35 sid)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20130302143427-wdmprnbkkccte051
Tags: 6:9.3-1
[ Jonas Smedegaard ]
* Stop using CDBS.

[ Reinhard Tartler ]
* Imported Upstream version 9.2 (never uploaded, though)
* Imported Upstream version 9.3:
  - Fixes CVE-2013-0894
* drop 02-fix-build-on-non-armv5te.patch, merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1336
1336
    if (!err) {
1337
1337
        avctx->sample_rate = s->sample_rate;
1338
1338
        avctx->bit_rate    = s->bit_rate;
 
1339
    }
1339
1340
 
1340
 
        /* channel config */
 
1341
    /* channel config */
 
1342
    if (!err || (s->channels && s->out_channels != s->channels)) {
1341
1343
        s->out_channels = s->channels;
1342
1344
        s->output_mode  = s->channel_mode;
1343
1345
        if (s->lfe_on)
1356
1358
                s->fbw_channels == s->out_channels)) {
1357
1359
            set_downmix_coeffs(s);
1358
1360
        }
1359
 
    } else if (!s->out_channels) {
1360
 
        s->out_channels = avctx->channels;
1361
 
        if (s->out_channels < s->channels)
1362
 
            s->output_mode  = s->out_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO;
 
1361
    } else if (!s->channels) {
 
1362
        av_log(avctx, AV_LOG_ERROR, "unable to determine channel mode\n");
 
1363
        return AVERROR_INVALIDDATA;
1363
1364
    }
 
1365
    avctx->channels = s->out_channels;
 
1366
 
1364
1367
    /* set audio service type based on bitstream mode for AC-3 */
1365
1368
    avctx->audio_service_type = s->bitstream_mode;
1366
1369
    if (s->bitstream_mode == 0x7 && s->channels > 1)
1367
1370
        avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
1368
1371
 
1369
1372
    /* get output buffer */
1370
 
    avctx->channels = s->out_channels;
1371
1373
    s->frame.nb_samples = s->num_blocks * 256;
1372
1374
    if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
1373
1375
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");