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 797313 - wavparse: Not handling SEGMENT query
wavparse: Not handling SEGMENT query
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Linux
: Normal enhancement
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-10-20 16:51 UTC by Francesco Ceruti
Modified: 2018-10-28 17:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple test, you need to change the pipeline description to point a file (705 bytes, text/x-python)
2018-10-22 21:50 UTC, Francesco Ceruti
  Details
wavparse: Implement SEGMENT query (1.26 KB, patch)
2018-10-23 08:47 UTC, Sebastian Dröge (slomo)
committed Details | Review
scaletempo: Implement SEGMENT query (1.42 KB, patch)
2018-10-23 08:47 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Francesco Ceruti 2018-10-20 16:51:32 UTC
When using "Gst.Query.new_segment" in a pipeline using a "wavparse" the reported playback rate is always 1.0
Comment 1 Francesco Ceruti 2018-10-20 16:59:27 UTC
This also happen when using a uridecodebin with a "wave" file.

If a "scaletempo" element is in the pipeline the "rate" property has the correct value.

P.S.
I've accidentally submitted before writing all the info
Comment 2 Sebastian Dröge (slomo) 2018-10-22 07:26:56 UTC
Can you provide a testcase for this?

What element is replying to the SEGMENT query, and are you playing with a different rate than 1.0?
Comment 3 Francesco Ceruti 2018-10-22 21:50:36 UTC
Created attachment 374006 [details]
Simple test, you need to change the pipeline description to point a file

I've done a few test, using different seek types/flags, and I've tried to query multiple elements of the pipeline (and the pipeline), still I get always 1.0 as rate, after changing it.

The playback rate is applied correctly, but cannot be retrieved correctly with  a "new_segment" query.
Comment 4 Sebastian Dröge (slomo) 2018-10-23 08:47:21 UTC
With scaletempo it is expected that you get 1.0: rate will be 1.0 and applied_rate will be 2.0, but the segment query only gives you the rate.

The first patch only will give you your wanted behaviour, but the second one in addition is more correct.


What are you trying to do exactly with the seeking query?
Comment 5 Sebastian Dröge (slomo) 2018-10-23 08:47:43 UTC
Created attachment 374009 [details] [review]
wavparse: Implement SEGMENT query
Comment 6 Sebastian Dröge (slomo) 2018-10-23 08:47:59 UTC
Created attachment 374010 [details] [review]
scaletempo: Implement SEGMENT query
Comment 7 Sebastian Dröge (slomo) 2018-10-23 08:48:38 UTC
Also note that many elements don't implement the SEEKING query, it's not very reliable.
Comment 8 Francesco Ceruti 2018-10-23 20:28:35 UTC
Thanks :-)

> With scaletempo it is expected that you get 1.0: rate will be 1.0 and
> applied_rate will be 2.0, but the segment query only gives you the rate.

mmh, okay, it's not clear to me where can I get the "applied_rate", plus I cannot find reference of this behavior in the scaletempo documentation and it's seems related to the wavparse element, this doesn't happen whit other decoders (with or without scaletempo in the pipeline).

> What are you trying to do exactly with the seeking query?

I'm changing the playback position (start_position), stop_position, and playback-rate, but using the gst_element_seek() function, that should use a GstEvent not a GstQuery, but I don't know to much about how this works internally.

For various reasons the seeks that change the rate and start/stop position happens in different parts of the application, and I need to retrieve the correct rate to avoid changing it when moving start/stop position.

Still, if it's not very reliable, I'll change how I handle the things on my application to avoid future problems.
Comment 9 Tim-Philipp Müller 2018-10-23 20:34:39 UTC
> Also note that many elements don't implement the SEEKING query,
> it's not very reliable.

Really? I think gst-play and totem use the SEEKING query to determine seekability and duration, so it's not some exotic thing that's not implemented by anything. It should really be implemented where missing.
Comment 10 Sebastian Dröge (slomo) 2018-10-23 21:08:52 UTC
(In reply to Tim-Philipp Müller from comment #9)
> > Also note that many elements don't implement the SEEKING query,
> > it's not very reliable.
> 
> Really?

Typo in that line. Everything in this bug is about the SEGMENT query, not the SEEKING query :)
Comment 11 Sebastian Dröge (slomo) 2018-10-23 21:13:16 UTC
(In reply to Francesco Ceruti from comment #8)
> Thanks :-)
> 
> > With scaletempo it is expected that you get 1.0: rate will be 1.0 and
> > applied_rate will be 2.0, but the segment query only gives you the rate.
> 
> mmh, okay, it's not clear to me where can I get the "applied_rate", plus I
> cannot find reference of this behavior in the scaletempo documentation and
> it's seems related to the wavparse element, this doesn't happen whit other
> decoders (with or without scaletempo in the pipeline).

After the scaletempo patch you'll always get 1.0, it's a bug.

> > What are you trying to do exactly with the seeking query?
> 
> I'm changing the playback position (start_position), stop_position, and
> playback-rate, but using the gst_element_seek() function, that should use a
> GstEvent not a GstQuery, but I don't know to much about how this works
> internally.
> 
> For various reasons the seeks that change the rate and start/stop position
> happens in different parts of the application, and I need to retrieve the
> correct rate to avoid changing it when moving start/stop position.
> 
> Still, if it's not very reliable, I'll change how I handle the things on my
> application to avoid future problems.

I think the most reliable way for this would be to store in your application what the last effective rate was that you configured via a SEEK event. Or if you're interested in what the current effective rate is, you could get the sinkpad of the sink and get the SEGMENT event from it via gst_pad_get_sticky_event() (but if you just seeked this might still be the old one). That contains the applied rate and the rate.
Comment 12 Francesco Ceruti 2018-10-23 21:26:04 UTC
Perfect, thanks again :-)
Comment 13 Sebastian Dröge (slomo) 2018-10-28 17:53:01 UTC
Attachment 374009 [details] pushed as 2415d51 - wavparse: Implement SEGMENT query
Attachment 374010 [details] pushed as a03d294 - scaletempo: Implement SEGMENT query