From 1b12d7f8a3434b3911c56f5be0ee06aff55d5a97 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 2 Feb 2016 11:30:31 -0300 Subject: [PATCH] mssdemux: only update download position if the seek requests to Some seeks are only updating the stop position, there is no need to change the current downloading position. --- ext/smoothstreaming/gstmssdemux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c index 86ebbbf223..4972f00734 100644 --- a/ext/smoothstreaming/gstmssdemux.c +++ b/ext/smoothstreaming/gstmssdemux.c @@ -586,6 +586,10 @@ gst_mss_demux_stream_select_bitrate (GstAdaptiveDemuxStream * stream, return ret; } +#define SEEK_UPDATES_PLAY_POSITION(r, start_type, stop_type) \ + ((r >= 0 && start_type != GST_SEEK_TYPE_NONE) || \ + (r < 0 && stop_type != GST_SEEK_TYPE_NONE)) + static gboolean gst_mss_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek) { @@ -603,7 +607,8 @@ gst_mss_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek) "seek event, rate: %f start: %" GST_TIME_FORMAT " stop: %" GST_TIME_FORMAT, rate, GST_TIME_ARGS (start), GST_TIME_ARGS (stop)); - gst_mss_manifest_seek (mssdemux->manifest, start); + if (SEEK_UPDATES_PLAY_POSITION (rate, start_type, stop_type)) + gst_mss_manifest_seek (mssdemux->manifest, start); return TRUE; }