summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha.yang@navercorp.com>2018-05-10 23:08:10 +0900
committerEdward Hervey <bilboed@bilboed.com>2018-05-12 09:27:46 +0200
commita8cb7662d7c5c084b81f25c96c267d63e11e865a (patch)
tree52a8e99e11828c6fc9d394c2d5f65ed216cecb92
parent67ae35813bff9362065bbfec770f3fdbb89165a3 (diff)
downloadgstreamer-plugins-bad-a8cb7662d7c5c084b81f25c96c267d63e11e865a.tar.gz
adaptivedemux: Support period change in live playlist
Regardless of LIVE or VOD, "a manifest has next period but currently EOSed" state is meaning that it's time to advance period. Previous behavior of adpativedemux, however, was able to period advancing only for VOD case, since the adaptivedemux tried to update and wait new manifest without respecting existence of the next period. https://bugzilla.gnome.org/show_bug.cgi?id=781183
-rw-r--r--gst-libs/gst/adaptivedemux/gstadaptivedemux.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
index 540cd52ff..a0c075b66 100644
--- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
+++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
@@ -3783,8 +3783,11 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
if (!demux_class->requires_periodical_playlist_update (demux)) {
ret = gst_adaptive_demux_update_manifest (demux);
break;
- } else if (gst_adaptive_demux_stream_wait_manifest_update (demux,
- stream)) {
+ /* Wait only if we can ensure current manifest has been expired.
+ * The meaning "we have next period" *WITH* EOS is that, current
+ * period has been ended but we can continue to the next period */
+ } else if (!gst_adaptive_demux_has_next_period (demux) &&
+ gst_adaptive_demux_stream_wait_manifest_update (demux, stream)) {
goto end;
}
gst_task_stop (stream->download_task);
@@ -3793,13 +3796,14 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
}
} else {
gst_task_stop (stream->download_task);
- if (gst_adaptive_demux_combine_flows (demux) == GST_FLOW_EOS) {
- if (gst_adaptive_demux_has_next_period (demux)) {
- GST_DEBUG_OBJECT (stream->pad,
- "Next period available, not sending EOS");
- gst_adaptive_demux_advance_period (demux);
- ret = GST_FLOW_OK;
- }
+ }
+
+ if (gst_adaptive_demux_combine_flows (demux) == GST_FLOW_EOS) {
+ if (gst_adaptive_demux_has_next_period (demux)) {
+ GST_DEBUG_OBJECT (stream->pad,
+ "Next period available, not sending EOS");
+ gst_adaptive_demux_advance_period (demux);
+ ret = GST_FLOW_OK;
}
}
break;