Commit b4429c25 authored by Michael Niedermayer's avatar Michael Niedermayer

mpegts_get_pcr: dont loose a packet when resyncing

This matches how read_packet() works
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0f2f65bd
...@@ -2324,6 +2324,7 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index, ...@@ -2324,6 +2324,7 @@ static av_unused int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE) if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
return AV_NOPTS_VALUE; return AV_NOPTS_VALUE;
if (buf[0] != 0x47) { if (buf[0] != 0x47) {
avio_seek(s->pb, -TS_PACKET_SIZE, SEEK_CUR);
if (mpegts_resync(s) < 0) if (mpegts_resync(s) < 0)
return AV_NOPTS_VALUE; return AV_NOPTS_VALUE;
pos = avio_tell(s->pb); pos = avio_tell(s->pb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment