[FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

Marton Balint cus at passwd.hu
Sun Jun 12 02:19:42 CEST 2016

On Sat, 11 Jun 2016, DeHackEd wrote:

> Presently the mpegts demuxer passes the timestamps from received packets directly to the output AVPackets. 2^33 / 90000
> seconds is about 26.5 hours at which point applications start having a fit, and that's assuming timestamps begin at time 0.
> So here's a first revision of a patch to fix that issue.
> Improvements possible:
> * In its current form intended for continuous sources like over-the-air receivers and multicast sources. When used on
> files there will be problems with seeking.
> * Constants such as 2^33 could be turned into macros for readability

I think there is already an infrastructure for handling PTS wraparound 
when decoding, check AVStream->pts_wrap_behaviour. Or is this something 


More information about the ffmpeg-devel mailing list