diff options
author | elupus <elupus@ecce.se> | 2008-08-27 20:44:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-14 17:11:23 +0200 |
commit | 9fa47cb77371fe93ba7081d33e49e53765c17aa7 (patch) | |
tree | a37ecd08d7f5fb3719c2ba1130c3a3f6c4e75748 | |
parent | 6214266362a7881b5fe3c2e57a4e4c1762a832eb (diff) | |
download | ffmpeg-9fa47cb77371fe93ba7081d33e49e53765c17aa7.tar.gz |
make mpegts_get_pcr resync if it's not on a valid mpegts packet
-rw-r--r-- | libavformat/mpegts.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 9a4e129a36..b9efe8234a 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1724,6 +1724,12 @@ static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index, return AV_NOPTS_VALUE; if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE) return AV_NOPTS_VALUE; + if (buf[0] != 0x47) { + if (mpegts_resync(s->pb) < 0) + return AV_NOPTS_VALUE; + pos = url_ftell(s->pb); + continue; + } if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) && parse_pcr(×tamp, &pcr_l, buf) == 0) { *ppos = pos; |