GNOME Bugzilla – Bug 751850
dashdemux: gst_mpd_client_advance_segment should return GST_FLOW_EOS when index is out of range
Last modified: 2015-08-16 13:38:30 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.
Do you have a patch to fix this?
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?
Seems reasonable, I thought it does that in some situations at least already.
Created attachment 306921 [details] [review] proposed fix
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.