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 701353 - rtp timestamps not correct when pausing/seeking
rtp timestamps not correct when pausing/seeking
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-31 13:03 UTC by Alexander Schrab
Modified: 2018-05-06 12:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.22 KB, patch)
2013-05-31 13:40 UTC, Alexander Schrab
none Details | Review
Patch # 2 (1.96 KB, patch)
2013-05-31 13:43 UTC, Alexander Schrab
needs-work Details | Review
Patch 3 (2.16 KB, patch)
2013-06-03 05:50 UTC, Alexander Schrab
needs-work Details | Review

Description Alexander Schrab 2013-05-31 13:03:06 UTC
rtp should have timestamps that are monotonically increasing and should not stop due to pause or reset due to seek. The functionality today is based on running time which works until pausing (running time will halt) or seeking (running time will be 0 again).
Comment 1 Alexander Schrab 2013-05-31 13:40:42 UTC
Created attachment 245728 [details] [review]
Patch

Take the base time of the element when going to playing the first time after being in ready. Instead of using running time directly, we subract the element base time (to get clock time) and subtract this initial base time to get a time that doesn't pause or reset at flushing seek and starts at 0.
Comment 2 Alexander Schrab 2013-05-31 13:43:14 UTC
Created attachment 245731 [details] [review]
Patch # 2

same as before, just removed some ws changes
Comment 3 Olivier Crête 2013-05-31 14:05:39 UTC
Review of attachment 245731 [details] [review]:

::: gst-libs/gst/rtp/gstrtpbasepayload.c
@@ +858,3 @@
+      rtime += gst_element_get_base_time (GST_ELEMENT (payload));
+      /* remove initial base time to get a time line starting from 0 */
+      rtime -= payload->priv->initial_element_base;

What happnens if you preroll a buffer in PAUSED ? (where priv->initial_element_base == GST_CLOCK_TIME_NONE)

Might make sense to use "0" instead of as a "unset" value ?
Comment 4 Alexander Schrab 2013-06-03 05:50:47 UTC
Created attachment 245894 [details] [review]
Patch 3

Force rtime to 0 if we are prerolling
Comment 5 Alexander Schrab 2013-06-03 05:51:29 UTC
(In reply to comment #3)
> Review of attachment 245731 [details] [review]:
> 
> ::: gst-libs/gst/rtp/gstrtpbasepayload.c
> @@ +858,3 @@
> +      rtime += gst_element_get_base_time (GST_ELEMENT (payload));
> +      /* remove initial base time to get a time line starting from 0 */
> +      rtime -= payload->priv->initial_element_base;
> 
> What happnens if you preroll a buffer in PAUSED ? (where
> priv->initial_element_base == GST_CLOCK_TIME_NONE)
> 
> Might make sense to use "0" instead of as a "unset" value ?

You are correct, but we can't just use 0 since that would mean the first package would have rtime same as clock time and the rest starting from 0. I made a special case for this instead.
Comment 6 Wim Taymans 2013-06-04 09:32:47 UTC
You can't do this, the element is already processing rtp packets while it goes from paused to playing and you will end up with some timestamp with and some without the base-time.

You would have to make the element a live element or no-preroll to make it use the pipeline clock to adjust the rtp time. It should probably be done in the session manager so that it can also keep the SR packets consistent with the modified RTP timestamps.
Comment 7 Alexander Schrab 2013-06-05 07:31:24 UTC
I understand. Guess it's back to the drawing board :P
Comment 8 Alexander Schrab 2013-06-13 07:07:26 UTC
(In reply to comment #7)
> I understand. Guess it's back to the drawing board :P


It's not only that the clock isn't available in PAUSE either if I'm right... Lets take this (very much made up) example:

filesrc -> payloader -> queue -> networksink

here we could get all the content through the payloader before going to play, causing pauses having no effect at all on the rtp timestamps as they should. 
It seems to me that the one making the rtp timestamping by necessity needs to be synchronized to the clock, otherwise we won't be able to react synchronized to the incoming pause/play commands.

I am not sure how the session manager would help? Could you be more specific about that?
Comment 9 Sebastian Dröge (slomo) 2013-08-16 09:51:20 UTC
What's the status here?
Comment 10 Sebastian Rasmussen 2013-09-07 09:55:28 UTC
The status is that Alexander has left Axis Communications. I have tried to subscribe to all his still opened bugs, like this one, to keep track of what was happening just before he left. I'm trying to drive these things with my project manager, but so far other things have had higher prio. I still aim to do something about this, so please keep this ticket open.
Comment 11 Tim-Philipp Müller 2016-02-21 22:09:54 UTC
Sebras, is this still a problem with current versions, and is this still on your list?
Comment 12 Vivia Nikolaidou 2018-05-06 12:36:08 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!