Revision 4860abb1 libavformat/mpeg.c

View differences:

libavformat/mpeg.c
474 474
        codec_id = CODEC_ID_DTS;
475 475
    } else if (startcode >= 0xa0 && startcode <= 0xaf) {
476 476
        type = CODEC_TYPE_AUDIO;
477
        codec_id = CODEC_ID_PCM_S16BE;
477
        /* 16 bit form will be handled as CODEC_ID_PCM_S16BE */
478
        codec_id = CODEC_ID_PCM_DVD;
478 479
    } else if (startcode >= 0xb0 && startcode <= 0xbf) {
479 480
        type = CODEC_TYPE_AUDIO;
480 481
        codec_id = CODEC_ID_MLP;
......
519 520
        freq = (b1 >> 4) & 3;
520 521
        st->codec->sample_rate = lpcm_freq_tab[freq];
521 522
        st->codec->channels = 1 + (b1 & 7);
522
        st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * 2;
523
        st->codec->bits_per_sample = 16 + ((b1 >> 6) & 3) * 4;
524
        st->codec->bit_rate = st->codec->channels *
525
                              st->codec->sample_rate *
526
                              st->codec->bits_per_sample;
527
        if (st->codec->bits_per_sample == 16)
528
            st->codec->codec_id = CODEC_ID_PCM_S16BE;
529
        else if (st->codec->bits_per_sample == 28)
530
            return AVERROR(EINVAL);
523 531
    }
524 532
    av_new_packet(pkt, len);
525 533
    get_buffer(s->pb, pkt->data, pkt->size);

Also available in: Unified diff