summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSeungha Yang <sh.yang@lge.com>2017-01-17 22:27:46 +0900
committerSebastian Dröge <sebastian@centricular.com>2017-01-18 13:14:44 +0200
commitfe9d778fa3346af3316c42083078c0c5d7cc3bf7 (patch)
tree5caaf076a235699e24e9fe3c8ed25d1516d92efc /ext
parentc9fbf3459a719b2c68ba69ddabd373ea9bf804a2 (diff)
downloadgstreamer-plugins-bad-fe9d778fa3346af3316c42083078c0c5d7cc3bf7.tar.gz
dashdemux: Do pending seek when SIDX is found
Parsing SIDX box was allowed even if "indexRange" attribute does not appear for On-Demand profile. However, actual seeking using SIDX index did not happen since download loop keep working on. To use SIDX index in that case, demux should try it in the next download loop. https://bugzilla.gnome.org/show_bug.cgi?id=777394
Diffstat (limited to 'ext')
-rw-r--r--ext/dash/gstdashdemux.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index 2ba32fc54..756983cd2 100644
--- a/ext/dash/gstdashdemux.c
+++ b/ext/dash/gstdashdemux.c
@@ -2211,7 +2211,8 @@ gst_dash_demux_parse_isobmff (GstAdaptiveDemux * demux,
/* FIXME, preserve seek flags */
gst_dash_demux_stream_sidx_seek (dash_stream,
demux->segment.rate >= 0, 0, dash_stream->pending_seek_ts, NULL);
- dash_stream->pending_seek_ts = GST_CLOCK_TIME_NONE;
+ /* push buffer up to sidx box, and do pending stream seek */
+ break;
} else {
SIDX (dash_stream)->entry_index = dash_stream->sidx_index;
}
@@ -2484,6 +2485,25 @@ gst_dash_demux_handle_isobmff_buffer (GstAdaptiveDemux * demux,
gst_adaptive_demux_stream_push_buffer (stream,
buffer)) != GST_FLOW_OK)
return ret;
+
+ /* Parser found sidx box now */
+ if (dash_stream->pending_seek_ts != GST_CLOCK_TIME_NONE &&
+ dash_stream->isobmff_parser.current_fourcc == GST_ISOFF_FOURCC_SIDX &&
+ dash_stream->sidx_parser.status == GST_ISOFF_SIDX_PARSER_FINISHED &&
+ gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client)) {
+ GST_DEBUG_OBJECT (stream->pad,
+ "Found sidx box, return custom-success to do seeking now");
+ dash_stream->pending_seek_ts = GST_CLOCK_TIME_NONE;
+
+ /* Clear isobmff parser */
+ gst_adapter_clear (dash_stream->isobmff_adapter);
+ dash_stream->isobmff_parser.current_fourcc = 0;
+ dash_stream->isobmff_parser.current_start_offset = 0;
+ dash_stream->isobmff_parser.current_offset = -1;
+ dash_stream->isobmff_parser.current_size = 0;
+ return GST_ADAPTIVE_DEMUX_FLOW_END_OF_FRAGMENT;
+ }
+
if (dash_stream->isobmff_parser.current_fourcc != GST_ISOFF_FOURCC_MDAT)
return ret;