diff --git a/softhddev.c b/softhddev.c index aaea99c..39d1e59 100644 --- a/softhddev.c +++ b/softhddev.c @@ -1822,8 +1822,9 @@ int PlayVideo(const uint8_t * data, int size) } // H264 NAL AUD Access Unit Delimiter 0x00 0x00 0x00 0x01 0x09 - if ((data[6] & 0xC0) == 0x80 && z > 2 && check[0] == 0x01 + if ((data[6] & 0xC0) == 0x80 && z >= 2 && check[0] == 0x01 && check[1] == 0x09) { + // old PES HDTV recording z == 2 if (VideoCodecID == CODEC_ID_H264) { #if 0 // this should improve ffwd+frew, but produce crash in ffmpeg @@ -1848,12 +1849,15 @@ int PlayVideo(const uint8_t * data, int size) VideoCodecID = CODEC_ID_H264; } // SKIP PES header - VideoEnqueue(pts, check - 3, l + 3); + if ( z > 2 ) { + VideoEnqueue(pts, check - 3, l + 3); + } else { + VideoEnqueue(pts, check - 2, l + 2); + } return size; } // PES start code 0x00 0x00 0x01 if (z > 1 && check[0] == 0x01) { - // FIXME: old PES HDTV recording if (VideoCodecID == CODEC_ID_MPEG2VIDEO) { VideoNextPacket(CODEC_ID_MPEG2VIDEO); } else {