summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2007-10-01 23:43:57 +0200
committerReinhard Nißl <rnissl@gmx.de>2007-10-01 23:43:57 +0200
commitf4e560ef116a71a8d407b615be19e1f0ddf438c5 (patch)
treeb49b3a13999a2de4fcb4fd673fcb9090318699b2
parent8f0d2fdb0a1921cc0eee8aa03f4620501ba33a53 (diff)
downloadxine-lib-f4e560ef116a71a8d407b615be19e1f0ddf438c5.tar.gz
xine-lib-f4e560ef116a71a8d407b615be19e1f0ddf438c5.tar.bz2
Fix incorrect H.264 detection on successive MPEG1/2 B frames.
Successive MPEG1/2 B frames (each with a slice #9) could incorrectly lead to the assumption of a H.264 stream, as sequence or group start codes were not seen for these frames. So the detection logic interpreted the slice #9 start codes as H.264 access unit delimiters and therefore incorrectly switched to H.264 buffer type instead of MPEG1/2. Extending the detection logic to consider MPEG1/2 picture start codes as well (which do not appear in H.264 streams), prevents false positives.
-rw-r--r--src/demuxers/demux_mpeg_pes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c
index fbfde4e60..9ef38f97d 100644
--- a/src/demuxers/demux_mpeg_pes.c
+++ b/src/demuxers/demux_mpeg_pes.c
@@ -1110,7 +1110,7 @@ static int32_t parse_video_stream(demux_mpeg_pes_t *this, uint8_t *p, buf_elemen
uint8_t *pp = p + 2, *pp_limit = p + payload_size - 1;
while (0 < pp && pp < pp_limit) {
if (pp[0] == 0x01 && pp[-1] == 0x00 && pp[-2] == 0x00) {
- if (pp[1] >= 0x80) { /* MPEG 1/2 start code */
+ if (pp[1] >= 0x80 || !pp[1]) { /* MPEG 1/2 start code */
this->mpeg12_h264_detected = 2;
break;
} else {