mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
mpegdemux: remove redundant dvd audio code
This is almost a revert of: (the file from the report still works) commit 80e58c6153249a40e47a20326b7626cbe0fcabd3 Author: Benoit Fouet <benoit.fouet@free.fr> Date: Wed Feb 11 11:09:36 2009 +0000 Allow demuxing of audio substreams stored as 0x06 type. Fixes issue 725: MPEG2 PS with PCM audio. On behalf of Jai. Originally committed as revision 17150 to svn://svn.ffmpeg.org/ffmpeg/trunk Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3e1cf49676
commit
afa6afcc9f
@ -346,7 +346,7 @@ static int mpegps_read_pes_header(AVFormatContext *s,
|
|||||||
else if( c!= 0xf )
|
else if( c!= 0xf )
|
||||||
goto redo;
|
goto redo;
|
||||||
|
|
||||||
if (startcode == PRIVATE_STREAM_1 && !m->psm_es_type[startcode & 0xff]) {
|
if (startcode == PRIVATE_STREAM_1) {
|
||||||
startcode = avio_r8(s->pb);
|
startcode = avio_r8(s->pb);
|
||||||
len--;
|
len--;
|
||||||
if (startcode >= 0x80 && startcode <= 0xcf) {
|
if (startcode >= 0x80 && startcode <= 0xcf) {
|
||||||
@ -391,19 +391,12 @@ static int mpegps_read_packet(AVFormatContext *s,
|
|||||||
enum CodecID codec_id = CODEC_ID_NONE;
|
enum CodecID codec_id = CODEC_ID_NONE;
|
||||||
enum AVMediaType type;
|
enum AVMediaType type;
|
||||||
int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work
|
int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work
|
||||||
uint8_t av_uninit(dvdaudio_substream_type);
|
|
||||||
|
|
||||||
redo:
|
redo:
|
||||||
len = mpegps_read_pes_header(s, &dummy_pos, &startcode, &pts, &dts);
|
len = mpegps_read_pes_header(s, &dummy_pos, &startcode, &pts, &dts);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
return len;
|
return len;
|
||||||
|
|
||||||
if(startcode == 0x1bd) {
|
|
||||||
dvdaudio_substream_type = avio_r8(s->pb);
|
|
||||||
avio_skip(s->pb, 3);
|
|
||||||
len -= 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* now find stream */
|
/* now find stream */
|
||||||
for(i=0;i<s->nb_streams;i++) {
|
for(i=0;i<s->nb_streams;i++) {
|
||||||
st = s->streams[i];
|
st = s->streams[i];
|
||||||
@ -476,19 +469,6 @@ static int mpegps_read_packet(AVFormatContext *s,
|
|||||||
} else if (startcode >= 0xfd55 && startcode <= 0xfd5f) {
|
} else if (startcode >= 0xfd55 && startcode <= 0xfd5f) {
|
||||||
type = AVMEDIA_TYPE_VIDEO;
|
type = AVMEDIA_TYPE_VIDEO;
|
||||||
codec_id = CODEC_ID_VC1;
|
codec_id = CODEC_ID_VC1;
|
||||||
} else if (startcode == 0x1bd) {
|
|
||||||
// check dvd audio substream type
|
|
||||||
type = AVMEDIA_TYPE_AUDIO;
|
|
||||||
switch(dvdaudio_substream_type & 0xe0) {
|
|
||||||
case 0xa0: codec_id = CODEC_ID_PCM_DVD;
|
|
||||||
break;
|
|
||||||
case 0x80: if((dvdaudio_substream_type & 0xf8) == 0x88)
|
|
||||||
codec_id = CODEC_ID_DTS;
|
|
||||||
else codec_id = CODEC_ID_AC3;
|
|
||||||
break;
|
|
||||||
default: av_log(s, AV_LOG_ERROR, "Unknown 0x1bd sub-stream\n");
|
|
||||||
goto skip;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
skip:
|
skip:
|
||||||
/* skip packet */
|
/* skip packet */
|
||||||
@ -508,8 +488,7 @@ static int mpegps_read_packet(AVFormatContext *s,
|
|||||||
found:
|
found:
|
||||||
if(st->discard >= AVDISCARD_ALL)
|
if(st->discard >= AVDISCARD_ALL)
|
||||||
goto skip;
|
goto skip;
|
||||||
if ((startcode >= 0xa0 && startcode <= 0xaf) ||
|
if (startcode >= 0xa0 && startcode <= 0xaf) {
|
||||||
(startcode == 0x1bd && ((dvdaudio_substream_type & 0xe0) == 0xa0))) {
|
|
||||||
int b1, freq;
|
int b1, freq;
|
||||||
|
|
||||||
/* for LPCM, we just skip the header and consider it is raw
|
/* for LPCM, we just skip the header and consider it is raw
|
||||||
|
Loading…
x
Reference in New Issue
Block a user