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 794505 - souphttpsrc: Eos is not emitted for not satisfiable range seek
souphttpsrc: Eos is not emitted for not satisfiable range seek
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: 2018-03-20 01:01 UTC by Paul Kim
Modified: 2018-11-03 15:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
souphttpsrc: Set automatic_eos default to TRUE (1.03 KB, patch)
2018-03-20 01:11 UTC, Paul Kim
needs-work Details | Review
souphttpsrc: don't fail when seeking past the end of the content (1.27 KB, patch)
2018-04-19 12:25 UTC, Michael Olbrich
none Details | Review

Description Paul Kim 2018-03-20 01:01:16 UTC
When seeking to not satisfiable range (for example, out of the content length), eos is not emitted but error occurs after applying the patch below.
2014-02-13 12:09 Sebastian Dröge      o │ souphttpsrc: Use new automatic_eos API from basesrc
Likewise previous version, error should not emitted but eos is expected if the player try to seek to content length.
Comment 1 Paul Kim 2018-03-20 01:11:33 UTC
Created attachment 369883 [details] [review]
souphttpsrc: Set automatic_eos default to TRUE

When seeking to not satisfiable range (for example, out of the content                          
    length), eos is not emitted but error occurs if automatic_eos is FALSE.            
    Likewise previous version, error should not emitted but eos is expected
    if the player try to seek to content length.
Comment 2 Sebastian Dröge (slomo) 2018-03-20 08:51:49 UTC
Can you provide some kind of testcase for this?
Comment 3 Paul Kim 2018-03-20 09:14:42 UTC
I think this can be used as testcase
1. Play any file 
2. Seek to out of the duration of the file.
Comment 4 Paul Kim 2018-03-20 09:37:08 UTC
More specifically, we expect the following line if seek to bigger than content_size is performed, but if we set automatic_eos FALSE, EOS does not occur immediately.
  if (src->have_size && segment->start >= src->content_size) {
    GST_WARNING_OBJECT (src,
        "Potentially seeking behind end of file, might EOS immediately");
  }
Comment 5 Sebastian Dröge (slomo) 2018-03-21 07:00:41 UTC
Comment on attachment 369883 [details] [review]
souphttpsrc: Set automatic_eos default to TRUE

The automatic EOS setting of basesrc was specifically added for souphttpsrc. Check the GIT commits in souphttpsrc and basesrc that added this.

The problem is that for HTTP we don't know when we're done but we have to wait until the server is done sending us data. If we stop at the duration, we might produce too little data.
Comment 6 Paul Kim 2018-03-22 01:16:38 UTC
What do you think below? If we do not stop at the request of the duration, server may send 416 error response if automatic eos and we may not wait until server is done sending us data.
http://httpwg.org/specs/rfc7233.html
If all of the preconditions are true, the server supports the Range header field for the target resource, and the specified range(s) are invalid or unsatisfiable, the server SHOULD send a 416 (Range Not Satisfiable) response.
Comment 7 Sebastian Dröge (slomo) 2018-03-22 07:44:19 UTC
This is not about seeking per-se but generally that the Content-Range header might be incomplete. Consider a file that is currently still growing server-side, or also when using compression I remember the Content-Range to be smaller than the amount of bytes that actually arrived in the end (and basesrc would then EOS before the end).
Comment 8 Michael Olbrich 2018-04-19 11:10:18 UTC
I'm seeing this issue in combination with queue2. When queue2 switches back to range that contains the end of the file, it will seek with start=content_size, stop=-1.

Btw, there is code already that turns the error into EOS, but only if the content size is not known
Comment 9 Michael Olbrich 2018-04-19 12:25:57 UTC
Created attachment 371127 [details] [review]
souphttpsrc: don't fail when seeking past the end of the content

Range errors are already turned into EOS when the size is not known.
Do the same thing if the request as outside the known content size.
Comment 10 GStreamer system administrator 2018-11-03 15:27:24 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/452.