diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-01 13:00:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-01 13:00:08 +0200 |
commit | cb4d05e7f25684fd09b5a81bf5d5ca98ecfec6ca (patch) | |
tree | eab53df81a61f27ee2474366d01cb88233557ba0 /libavformat | |
parent | d7f917c37af24eec2720231db03ab41469550855 (diff) | |
parent | a42e3a6700547e4e49445bda81d3a89ec3e081a9 (diff) | |
download | ffmpeg-cb4d05e7f25684fd09b5a81bf5d5ca98ecfec6ca.tar.gz |
Merge commit 'a42e3a6700547e4e49445bda81d3a89ec3e081a9'
* commit 'a42e3a6700547e4e49445bda81d3a89ec3e081a9':
pcm_dvd: consolidate pieces from pcm.c and mpeg.c
Conflicts:
libavcodec/pcm.c
libavcodec/version.h
libavformat/mpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpeg.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 5d5b09fc07..63b35efceb 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -535,7 +535,6 @@ static int mpegps_read_packet(AVFormatContext *s, if(lpcm_header_len == 6) { codec_id = AV_CODEC_ID_MLP; } else { - /* 16 bit form will be handled as AV_CODEC_ID_PCM_S16BE */ codec_id = AV_CODEC_ID_PCM_DVD; } } else if (startcode >= 0xb0 && startcode <= 0xbf) { @@ -570,8 +569,7 @@ static int mpegps_read_packet(AVFormatContext *s, st->codec->sample_rate = 8000; } st->request_probe = request_probe; - if (codec_id != AV_CODEC_ID_PCM_S16BE) - st->need_parsing = AVSTREAM_PARSE_FULL; + st->need_parsing = AVSTREAM_PARSE_FULL; found: if(st->discard >= AVDISCARD_ALL) goto skip; @@ -581,28 +579,6 @@ static int mpegps_read_packet(AVFormatContext *s, goto skip; avio_skip(s->pb, 6); len -=6; - } else { - int b1, freq; - - /* for LPCM, we just skip the header and consider it is raw - audio data */ - if (len <= 3) - goto skip; - avio_r8(s->pb); /* emphasis (1), muse(1), reserved(1), frame number(5) */ - b1 = avio_r8(s->pb); /* quant (2), freq(2), reserved(1), channels(3) */ - avio_r8(s->pb); /* dynamic range control (0x80 = off) */ - len -= 3; - freq = (b1 >> 4) & 3; - st->codec->sample_rate = lpcm_freq_tab[freq]; - st->codec->channels = 1 + (b1 & 7); - st->codec->bits_per_coded_sample = 16 + ((b1 >> 6) & 3) * 4; - st->codec->bit_rate = st->codec->channels * - st->codec->sample_rate * - st->codec->bits_per_coded_sample; - if (st->codec->bits_per_coded_sample == 16) - st->codec->codec_id = AV_CODEC_ID_PCM_S16BE; - else if (st->codec->bits_per_coded_sample == 28) - return AVERROR(EINVAL); } } ret = av_get_packet(s->pb, pkt, len); |