summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSeungha Yang <sh.yang@lge.com>2017-03-07 21:56:03 +0900
committerSebastian Dröge <sebastian@centricular.com>2017-03-14 19:15:28 +0200
commita9c34fb9e3b6cfd494decd107b744d39cd1dc791 (patch)
treea3a1587b2617129b0270036692e69c500c18b221 /ext
parent4757ec88604835b5e3b6ce32ba6ddb5e6b6611b4 (diff)
downloadgstreamer-plugins-bad-a9c34fb9e3b6cfd494decd107b744d39cd1dc791.tar.gz
dashdemux: Advance subfragment only if any exist
SIDX based playback is not restricted to SegmentBase, but it possible with SegmentList/SegmentTemplate. In the latter case, each fragment has its own SIDX box and might be subdivided into subfragment. So, demux should not assume that the end of subfragment is the end of stream. Moreover, should try advance subfragment only if there are remaining subfragments. With additional fixes by Sebastian Dröge <sebastian@centricular.com> https://bugzilla.gnome.org/show_bug.cgi?id=776200
Diffstat (limited to 'ext')
-rw-r--r--ext/dash/gstdashdemux.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index d46a0cb27..0e88864f4 100644
--- a/ext/dash/gstdashdemux.c
+++ b/ext/dash/gstdashdemux.c
@@ -1965,9 +1965,9 @@ gst_dash_demux_stream_fragment_finished (GstAdaptiveDemux * demux,
&& gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client)
&& dashstream->sidx_parser.status == GST_ISOFF_SIDX_PARSER_FINISHED) {
/* fragment is advanced on data_received when byte limits are reached */
- if (gst_dash_demux_stream_has_next_fragment (stream))
+ if (gst_dash_demux_stream_has_next_subfragment (stream)) {
return GST_FLOW_OK;
- return GST_FLOW_EOS;
+ }
}
if (G_UNLIKELY (stream->downloading_header || stream->downloading_index))
@@ -2749,14 +2749,19 @@ gst_dash_demux_data_received (GstAdaptiveDemux * demux,
&& (GST_ADAPTIVE_DEMUX (stream->demux)->
segment.flags & GST_SEGMENT_FLAG_TRICKMODE_KEY_UNITS))
&& advance) {
- GstFlowReturn new_ret;
- new_ret =
- gst_adaptive_demux_stream_advance_fragment (demux, stream,
- SIDX_CURRENT_ENTRY (dash_stream)->duration);
-
- /* only overwrite if it was OK before */
- if (ret == GST_FLOW_OK)
- ret = new_ret;
+
+ if (gst_dash_demux_stream_has_next_subfragment (stream)) {
+ GstFlowReturn new_ret;
+ new_ret =
+ gst_adaptive_demux_stream_advance_fragment (demux, stream,
+ SIDX_CURRENT_ENTRY (dash_stream)->duration);
+
+ /* only overwrite if it was OK before */
+ if (ret == GST_FLOW_OK)
+ ret = new_ret;
+ } else {
+ break;
+ }
}
}
}