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 751850 - dashdemux: gst_mpd_client_advance_segment should return GST_FLOW_EOS when index is out of range
dashdemux: gst_mpd_client_advance_segment should return GST_FLOW_EOS when ind...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-07-02 15:57 UTC by Florin Apostol
Modified: 2015-08-16 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (1.75 KB, patch)
2015-07-06 13:15 UTC, Florin Apostol
committed Details | Review

Description Florin Apostol 2015-07-02 15:57:51 UTC
The gst_mpd_client_advance_segment function attempts to increase the stream->segment_index. But if the updated index is out of range (>= segments_count) the function will return GST_FLOW_OK. It will return GST_FLOW_EOS only when the index is out of range BEFORE being incremented.

The current behavior leads to situations when gst_mpd_client_advance_segment will return GST_FLOW_OK but gst_mpd_client_get_next_fragment will return false.

I believe gst_mpd_client_advance_segment function should check the updated value of index and return GST_FLOW_EOS if it is out of range.
Comment 1 Thiago Sousa Santos 2015-07-05 16:39:33 UTC
Do you have a patch to fix this?
Comment 2 Florin Apostol 2015-07-06 09:13:18 UTC
I can create one if my approach is correct. I wasn't sure what the behavior should be. 
Do you agree that the function should return EOS if the new (updated) index would be outside of range?
Comment 3 Sebastian Dröge (slomo) 2015-07-06 09:24:22 UTC
Seems reasonable, I thought it does that in some situations at least already.
Comment 4 Florin Apostol 2015-07-06 13:15:01 UTC
Created attachment 306921 [details] [review]
proposed fix
Comment 5 Sebastian Dröge (slomo) 2015-07-07 10:31:03 UTC
Review of attachment 306921 [details] [review]:

commit dfe37ffc59fdf5f4075696976d98ec8d6db73138
Author: Florin Apostol <florin.apostol@oregan.net>
Date:   Mon Jul 6 14:14:12 2015 +0100

    dashdemux: fixed gst_mpd_client_advance_segment to return GST_FLOW_EOS
    
    Fixed gst_mpd_client_advance_segment to return GST_FLOW_EOS if the
    new index is out of range.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751850

::: ext/dash/gstmpdparser.c
@@ +3978,3 @@
       if (stream->segment_index < 0)
         stream->segment_index = 0;
+      else {

I added some {} for the if-case here.