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 694369 - tsdemux: unable to change play speed via seek event
tsdemux: unable to change play speed via seek event
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Linux
: Normal normal
: 1.1.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-21 16:10 UTC by Lori Anderson
Modified: 2013-07-24 14:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Tutorial code with modifications to use local file and switch b/w 0.10 & 1.0 (4.76 KB, text/x-csrc)
2013-02-21 16:10 UTC, Lori Anderson
  Details
Log file from run showing error related to seek event (1.21 KB, text/plain)
2013-02-21 16:11 UTC, Lori Anderson
  Details
Proposed patch to fix playspeed issue with pushsrc (4.80 KB, patch)
2013-04-15 23:34 UTC, Lori Anderson
none Details | Review
Patch which show changes with allow or prevent playspeed changing (2.64 KB, patch)
2013-07-24 13:32 UTC, Lori Anderson
none Details | Review
tsdemux: Remember requested seek rate and use it (2.26 KB, patch)
2013-07-24 13:51 UTC, Edward Hervey
none Details | Review

Description Lori Anderson 2013-02-21 16:10:24 UTC
Created attachment 237056 [details]
Tutorial code with modifications to use local file and switch b/w 0.10 & 1.0

I have recently upgraded from GStreamer-0.10 to GStreamer-1.0.  I'm working on playspeed support related to mpeg-ts.  I started with the GStreamer playspeed tutorial - "Basic tutorial 13: Playback speed" (http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+13%3A+Playback+speed).  This tutorial works with GStreamer 0.10 using clock.mpg (see attachment) but does not work with GStreamer 1.0.  This tutorial seems to work with GStreamer-1.0 using *.mkv and *.ogv files.

The tutorial fails when attempting to do rate change from 1x to 2x under GStreamer-1.0.  I get the following error:
(basic-tutorial-13:3117): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed

There is this note on the tutorial's web page - "Changing the playback rate might only work with local files".  I modified the tutorial code as suggested to use a local file (which is attached to this bug - clock.mpg).  

I also added a #define GSTREAMER_1 to the tutorial *.c code to support changes between GStreamer-0.10 and GStreamer-1.0.    

I have attached a log with some debugging messages (fail_log.txt). It appears it might be a problem in bad plugin - mpegtsdemux - tsdemux.c.

I used the following command to compile (switching between 0.10 and 1.0 as appropriate and also uncommenting #define GSTREAMER_1 in *.c file):
gcc basic-tutorial-13.c -o basic-tutorial-13 `pkg-config --cflags --libs gstreamer-[0.10 or 1.0]`

I'm running on Ubuntu 12.04 and using last release of GStreamer-0.10 and latest release of GStreamer-1.0.5.

I've attached the basic_tutorial.c code from the tutorial with the modification to use local file rather than URL and also #define GSTREAMER_1 to support switching between 0.10 and 1.0.
Comment 1 Lori Anderson 2013-02-21 16:11:19 UTC
Created attachment 237058 [details]
Log file from run showing error related to seek event
Comment 2 Lori Anderson 2013-02-21 16:20:53 UTC
Can't attach the clock.mpg, too big.  I'll find a link to sample mpeg-ts which demonstrates same issue.
Comment 3 Lori Anderson 2013-02-21 16:41:27 UTC
You can download the Park Run 1280x1080 clip from http://www.w6rz.net/.  Modify
basic-tutorial-13.c to use your local file.
Comment 4 Lori Anderson 2013-04-15 23:33:44 UTC
I have a patch which fixes this issue.  This patch includes a workaround to what looks to be a problem in gst_segment_do_seek() where the format field is not updated.
Comment 5 Lori Anderson 2013-04-15 23:34:42 UTC
Created attachment 241605 [details] [review]
Proposed patch to fix playspeed issue with pushsrc
Comment 6 Edward Hervey 2013-06-12 05:35:04 UTC
This looks very similar to issues fixed in bug #701141
Comment 7 Lori Anderson 2013-06-12 14:07:28 UTC
I'll take a look at the fixes and update this issue accordingly.  Thanks for the post.
Comment 8 Lori Anderson 2013-06-17 14:17:04 UTC
I sync'd up with latest and ran tutorial program.  I am able to change playspeeds in the forward direction (2,4,8 etc.) without any patches (including mine).  Unfortunately changing playspeed direction (reverse playspeeds) still does not work.

I did get the code associated with Bug #701141.  It did not seem to help, in fact it has unable to changed playspeed from 1x to 2x.
Comment 9 Lori Anderson 2013-06-17 14:18:37 UTC
Typo in above comment - "it has unable" should be "it was unable"
Comment 10 Edward Hervey 2013-06-17 15:29:03 UTC
Ok, closing this bug then (you can change the playspeed).

We never supported reverse playback for mpeg-ts as far as I know.
Comment 11 Lori Anderson 2013-07-24 13:30:05 UTC
I am re-opening this bug. With the latest code this no longer works.  The issue appears to be in tsdemux.c.  I have attached a patch which allows playspeed changing to work.  The patch identifies two areas which have changed and has code which allows the playspeed changing to work.  I am not suggesting the patch is the proper solution, it just demonstrates which the code supports playspeed changing and what changes prevent it.
Comment 12 Lori Anderson 2013-07-24 13:32:46 UTC
Created attachment 250040 [details] [review]
Patch which show changes with allow or prevent playspeed changing
Comment 13 Edward Hervey 2013-07-24 13:44:45 UTC
Ah right, yes, we need to remember at least the rate.
Comment 14 Edward Hervey 2013-07-24 13:51:51 UTC
Created attachment 250041 [details] [review]
tsdemux: Remember requested seek rate and use it

The new seek handling re-creates the segment time information once it
has enough information after a seek.

The problem was that we'd completely ignore the requested rate. So store
that and use it in the newly created segment.
Comment 15 Edward Hervey 2013-07-24 13:52:16 UTC
Does that patch fix your issue (for forward rates) ?
Comment 16 Lori Anderson 2013-07-24 14:18:11 UTC
Yes - the patch fixes the playspeed issue for forward rates.  Thank you.
Comment 17 Edward Hervey 2013-07-24 14:34:20 UTC
commit 1f7fa9be1d5fb619c29fd734c97bbed9c0ea5f36
Author: Edward Hervey <edward@collabora.com>
Date:   Wed Jul 24 15:50:14 2013 +0200

    tsdemux: Remember requested seek rate and use it
    
    The new seek handling re-creates the segment time information once it
    has enough information after a seek.
    
    The problem was that we'd completely ignore the requested rate. So store
    that and use it in the newly created segment.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694369