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
This commit is contained in:
Florin Apostol 2015-07-06 14:14:12 +01:00 committed by Sebastian Dröge
parent 7f44ee0514
commit dfe37ffc59

View file

@ -3975,10 +3975,14 @@ gst_mpd_client_advance_segment (GstMpdClient * client, GstActiveStream * stream,
}
if (stream->segments == NULL) {
if (stream->segment_index < 0)
if (stream->segment_index < 0) {
stream->segment_index = 0;
else
} else {
stream->segment_index++;
if (segments_count > 0 && stream->segment_index >= segments_count) {
ret = GST_FLOW_EOS;
}
}
goto done;
}
@ -4015,6 +4019,10 @@ gst_mpd_client_advance_segment (GstMpdClient * client, GstActiveStream * stream,
if (stream->segment_repeat_index >= segment->repeat) {
stream->segment_repeat_index = 0;
stream->segment_index++;
if (segments_count > 0 && stream->segment_index >= segments_count) {
ret = GST_FLOW_EOS;
goto done;
}
} else {
stream->segment_repeat_index++;
}
@ -4022,6 +4030,7 @@ gst_mpd_client_advance_segment (GstMpdClient * client, GstActiveStream * stream,
if (stream->segment_repeat_index == 0) {
stream->segment_index--;
if (stream->segment_index < 0) {
ret = GST_FLOW_EOS;
goto done;
}