Skip to content
Snippets Groups Projects
Commit ce7cf600 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

mpegdemux: move private stream 1 handling out of mpegps_read_pes_header

parent afa6afcc
Branches
Tags
No related merge requests found
...@@ -349,18 +349,6 @@ static int mpegps_read_pes_header(AVFormatContext *s, ...@@ -349,18 +349,6 @@ static int mpegps_read_pes_header(AVFormatContext *s,
if (startcode == PRIVATE_STREAM_1) { if (startcode == PRIVATE_STREAM_1) {
startcode = avio_r8(s->pb); startcode = avio_r8(s->pb);
len--; len--;
if (startcode >= 0x80 && startcode <= 0xcf) {
/* audio: skip header */
avio_r8(s->pb);
avio_r8(s->pb);
avio_r8(s->pb);
len -= 3;
if (startcode >= 0xb0 && startcode <= 0xbf) {
/* MLP/TrueHD audio has a 4-byte header */
avio_r8(s->pb);
len--;
}
}
} }
if(len<0) if(len<0)
goto error_redo; goto error_redo;
...@@ -397,6 +385,22 @@ static int mpegps_read_packet(AVFormatContext *s, ...@@ -397,6 +385,22 @@ static int mpegps_read_packet(AVFormatContext *s,
if (len < 0) if (len < 0)
return len; return len;
if (startcode >= 0x80 && startcode <= 0xcf) {
if(len < 4)
goto skip;
/* audio: skip header */
avio_r8(s->pb);
avio_r8(s->pb);
avio_r8(s->pb);
len -= 3;
if (startcode >= 0xb0 && startcode <= 0xbf) {
/* MLP/TrueHD audio has a 4-byte header */
avio_r8(s->pb);
len--;
}
}
/* 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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment