GNOME Bugzilla – Bug 326598
[mpegstream] does not handle timestamp overflow correctly
Last modified: 2006-03-23 18:17:43 UTC
Timestamps in mpeg stream are 32-bit numbers. Therefore, with clock_freq 90kHz this timestamp overflows every ~13 hours. This situation really happens when grabbing DVB streams. Current mpegdemuxer can not handle this situation correctly and it restart counting gstramer timestamps from zero.
Created attachment 57154 [details] [review] Patch to fix timestamp overflow This simple patch makes gstreamer timestamp continue correctly even when mpeg timestamp overflows.
Looks good to me; CC'ing Martin Soto
Created attachment 57656 [details] [review] Patch to fix timestamp overflow I have almost forgot to send a new version of the patch. Checking for monotonous timestamp incremets did not worked. This patch check for small increments in absolute value.
Forgot about this patch. Since I've frozen gst-plugins-ugly today and it's not immediately obvious to me that this patch is trivially correct, I'd prefer to leave it until I release and then apply it immediately, so that we test it for a while before the next gst-plugins-ugly release.
Ping? What about this patch? Michal, is that the latest revision that you guys are using or is there a newer one?
Yes, this is the latest version of the patch, one month ago, we were able to receive a DVB stream for several days without interruption using this patch. But I have not tried to apply this patch to the recent CVS version.
patch seems ok. seeking in mpeg still completely wrong, though. Patch by: Michal Benes <michal dot benes at xeris dot cz> * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_init), (gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes), (gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_reset): * gst/mpegstream/gstmpegdemux.h: * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_parse_packhead): Timestamps in mpeg stream are 32-bit numbers. Therefore, with a clock_freq of 90kHz this timestamp overflows every ~13 hours. This situation really happens when grabbing DVB streams. Current mpegdemuxer can not handle this situation correctly and it restarts counting gstreamer timestamps from zero. Fixes #326598.