After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623860 - mpegpsdemux: sends segment and gap events with invalid time after seek
mpegpsdemux: sends segment and gap events with invalid time after seek
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal normal
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 686301 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-07-08 17:08 UTC by Nick Haddad
Modified: 2016-05-15 09:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample mpg file that show inconsistent seeking behavior. (644.51 KB, video/mpeg)
2010-07-08 17:08 UTC, Nick Haddad
  Details
mpegdemux: don't do bogus adjustments on seek if we have no first_pts (1.05 KB, patch)
2016-05-13 12:30 UTC, Tim-Philipp Müller
committed Details | Review
mpegdemux: Handle system header when scanning for timestamps. (3.31 KB, patch)
2016-05-15 09:07 UTC, Jan Schmidt
committed Details | Review

Description Nick Haddad 2010-07-08 17:08:07 UTC
Created attachment 165494 [details]
sample mpg file that show inconsistent seeking behavior.

Given the attached file (xylophone.mpg),  creating a gstreamer pipeline using playbin or decodebin has the following issues:

1) Seeking is either unsupported or invalid
2) Sporadically pipeline creation fails

This causes issues for applications that need better frame accuracy for MPEG-1 files. 

You can see this behavior in totem by simply open in the file in totem and using the transport bar to seek around.  Often the file will seek backwards and forwards randomly.

This can be reproduced at the command line using gst-launch-0.10:

gst-launch-0.10 -tm filesrc location=xylophone.mpg ! decodebin name=decoder decoder. ! ffmpegcolorspace ! 'video/x-raw-rgb, bpp=(int)24, depth=(int)24,endianness=(int)BIG_ENDIAN,red_mask=(int)16711680,green_mask=(int)65280,blue_mask=(int)255' ! fakesink decoder. ! fakesink 

Reproduced this issue in both Debian 5 (lenny) and Ubuntu 10.04
Comment 1 Sebastian Dröge (slomo) 2013-08-23 10:47:19 UTC
Pipeline creation works always with 1.0 here, but seeking fails:

(totem:23212): GStreamer-CRITICAL **: gst_event_new_gap: assertion 'GST_CLOCK_TIME_IS_VALID (timestamp)' failed

Program received signal SIGTRAP, Trace/breakpoint trap.

Thread 140736308041472 (LWP 23224)

  • #1 g_log
    at /build/glib2.0-U55j9q/glib2.0-2.37.6/./glib/gmessages.c line 1025
  • #2 g_return_if_fail_warning
  • #3 gst_event_new_gap
    at gstevent.c line 571
  • #4 gst_flups_demux_send_gap_updates
    at gstmpegdemux.c line 922
917	        gst_flups_demux_send_segment (demux, stream, GST_CLOCK_TIME_NONE);
918	
919	        GST_LOG_OBJECT (demux,
920	            "Sending gap update to pad %s time %" GST_TIME_FORMAT,
921	            GST_PAD_NAME (stream->pad), GST_TIME_ARGS (new_start));
922	        event =
923	            gst_event_new_gap (stream->last_ts, new_start - stream->last_ts);
924	        gst_pad_push_event (stream->pad, event);
925	        stream->last_ts = new_start;
926	      }
Comment 2 Tim-Philipp Müller 2016-05-13 09:44:30 UTC
*** Bug 686301 has been marked as a duplicate of this bug. ***
Comment 3 Tim-Philipp Müller 2016-05-13 12:30:44 UTC
Created attachment 327789 [details] [review]
mpegdemux: don't do bogus adjustments on seek if we have no first_pts

Immediate reason is that demux->first_pts is -1 which gets us GST_CLOCK_TIME_NONE as first_pts which we then use in adjustment calculations.

Not sure why first_pts is not set later though if we didn't find it initially.
Comment 4 Jan Schmidt 2016-05-15 09:07:34 UTC
Created attachment 327920 [details] [review]
mpegdemux: Handle system header when scanning for timestamps.

When scanning for SCR / PTS / DTS, handle the case where
the pack header is followed by the optional system header,
so we can correctly collect timestamps in such cases.
Comment 5 Jan Schmidt 2016-05-15 09:08:40 UTC
We should apply both patches - the guard still makes sense in the case of a braindead file that has no PTS in the first / last 4MB for whatever reason.