summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-09-14 13:56:10 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-09-14 13:56:10 -0300
commitcc599bb5b53e12c5a08b8c477341015d0699c76d (patch)
tree4a4aeaadd2ef49809306d6c6cec5a406d05919e4
parent25f0787c1c09757799f7f3dcc6a8cf09d69b9298 (diff)
dashdemux: also check for subfragments on has_next_fragment
In dash isombff profile the fragment is split into subframents where bitrate switching is possible. Also take that into consideration when checking if a stream has next fragments.
-rw-r--r--ext/dash/gstdashdemux.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index 48ad520fa..fd9bb3f7e 100644
--- a/ext/dash/gstdashdemux.c
+++ b/ext/dash/gstdashdemux.c
@@ -1025,6 +1025,24 @@ gst_dash_demux_stream_seek (GstAdaptiveDemuxStream * stream, GstClockTime ts)
}
static gboolean
+gst_dash_demux_stream_has_next_subfragment (GstAdaptiveDemuxStream * stream)
+{
+ GstDashDemuxStream *dashstream = (GstDashDemuxStream *) stream;
+ GstSidxBox *sidx = SIDX (dashstream);
+
+ if (dashstream->sidx_parser.status == GST_ISOFF_SIDX_PARSER_FINISHED) {
+ if (stream->demux->segment.rate > 0.0) {
+ if (sidx->entry_index + 1 < sidx->entries_count)
+ return TRUE;
+ } else {
+ if (sidx->entry_index >= 1)
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static gboolean
gst_dash_demux_stream_advance_subfragment (GstAdaptiveDemuxStream * stream)
{
GstDashDemuxStream *dashstream = (GstDashDemuxStream *) stream;
@@ -1062,6 +1080,11 @@ gst_dash_demux_stream_has_next_fragment (GstAdaptiveDemuxStream * stream)
GstDashDemux *dashdemux = GST_DASH_DEMUX_CAST (stream->demux);
GstDashDemuxStream *dashstream = (GstDashDemuxStream *) stream;
+ if (gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client)) {
+ if (gst_dash_demux_stream_has_next_subfragment (stream))
+ return TRUE;
+ }
+
return gst_mpd_client_has_next_segment (dashdemux->client,
dashstream->active_stream, stream->demux->segment.rate > 0.0);
}