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 781225 - qtdemux: set seqnum to segment event in push mode
qtdemux: set seqnum to segment event in push mode
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-12 15:47 UTC by Wonchul Lee
Modified: 2018-11-03 15:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
qtdemux: set seqnum to segment event in push mode (1.02 KB, patch)
2017-04-12 15:47 UTC, Wonchul Lee
none Details | Review
qtdemux: set seqnum to segment event in push mode (1.52 KB, patch)
2017-04-13 03:26 UTC, Wonchul Lee
none Details | Review
[first one] qtdemux: set seqnum to segment event in push mode (1.07 KB, patch)
2017-04-13 12:18 UTC, Wonchul Lee
none Details | Review

Description Wonchul Lee 2017-04-12 15:47:00 UTC
I found that when playing media using qtdemux in pull mode (streaming), the seqnum of the relevant events after seek is different from seqnum of the seek event.

Seqnum of segment is only used when seeking in pull mode. In push mode, the seek
event is processed by the upstream source element, so this value is never used.
I fixed to apply seqnum of segment event sent from the upstream in push mode.
Comment 1 Wonchul Lee 2017-04-12 15:47:38 UTC
Created attachment 349740 [details] [review]
qtdemux: set seqnum to segment event in push mode
Comment 2 Thiago Sousa Santos 2017-04-12 18:22:04 UTC
(I'm assuming you had a typo in your first line push -> pull)

I'm not sure I follow what is the bug here. This is what should happen when you send a seek upstream:

1) Demux receives a seek, converts it to a new seek for upstream
2) Demux sets the new seek with the same seqnum of the original seek
3) Source receives the seek and handles it
4) Source creates a new segment event with the same seqnum of the seek it received (which is the same as of the original seek)
5) Demux receives the segment with the same seqnum as the original one.
6) Demux forwards its own segment and also copies over the seqnum

It seems to me that the bug might be in the source not copying the seqnum properly. Can you provide more information on the issue you are experiencing?
Comment 3 Wonchul Lee 2017-04-13 03:24:43 UTC
(In reply to Thiago Sousa Santos from comment #2)
> (I'm assuming you had a typo in your first line push -> pull)

Yes, it was a typo the first line should be push mode, sorry.

> 
> I'm not sure I follow what is the bug here. This is what should happen when
> you send a seek upstream:
> 
> 1) Demux receives a seek, converts it to a new seek for upstream
> 2) Demux sets the new seek with the same seqnum of the original seek
> 3) Source receives the seek and handles it
> 4) Source creates a new segment event with the same seqnum of the seek it
> received (which is the same as of the original seek)
> 5) Demux receives the segment with the same seqnum as the original one.
> 6) Demux forwards its own segment and also copies over the seqnum

Source sent a segment event to Demux with the same seqnum of the seek event received from Demux. 
The problem occurs in here step 6). 

1.Demux does not refer to the seqnum of the segment event sent by Source in gst_qtdemux_handle_sink_event().
2. Demux does not keep seqnum of the seek event that it sent for upstream before.

So Demux generates and sends segment event which has a random seqnum.

> 
> It seems to me that the bug might be in the source not copying the seqnum
> properly. Can you provide more information on the issue you are experiencing?

I had also suspected Source at first, but the seqnum of the event from the source is all set properly.
Comment 4 Wonchul Lee 2017-04-13 03:26:20 UTC
Created attachment 349758 [details] [review]
qtdemux: set seqnum to segment event in push mode

updated the patch to keep seqnum when convert and sent seek event to upstream
Comment 5 Thiago Sousa Santos 2017-04-13 05:57:37 UTC
I brought your first patch back, I think it makes more sense after you provided more details. qtdemux should just update its internal segment-seqnum values whenever it gets a new segment from upstream. That values should be of the last issued seek it sent upstream anyway.

Does it solve your issue or do you also need your second part for the FLUSH_STOP? You shouldn't, right? As the following segment event should also contain the same seqnum.
Comment 6 Wonchul Lee 2017-04-13 12:18:00 UTC
Created attachment 349793 [details] [review]
[first one] qtdemux: set seqnum to segment event in push mode

Yes, you're right, the first one solves the problem. The second one was the same intentions.
Let's go this way, I updated the patch to log bugzilla url on the commit msg.
Comment 7 GStreamer system administrator 2018-11-03 15:18:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/364.