From 4f7e23fbeef45119858255bc5783674d4fda124a Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 11 Nov 2016 08:44:59 +0100 Subject: adaptivedemux: Remove unneeded variables We now have properly non-blocking download time calculation --- gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 12 ++---------- gst-libs/gst/adaptivedemux/gstadaptivedemux.h | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c index 4b52694ad..d6c3fb03f 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c @@ -2231,9 +2231,6 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) } } - stream->download_total_time += - GST_TIME_AS_USECONDS (gst_adaptive_demux_get_monotonic_time (demux)) - - stream->download_chunk_start_time; stream->download_total_bytes += gst_buffer_get_size (buffer); GST_DEBUG_OBJECT (stream->pad, "Received buffer of size %" G_GSIZE_FORMAT, @@ -2252,9 +2249,6 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) g_mutex_unlock (&stream->fragment_download_lock); } - stream->download_chunk_start_time = - GST_TIME_AS_USECONDS (gst_adaptive_demux_get_monotonic_time (demux)); - if (ret != GST_FLOW_OK) { gboolean finished = FALSE; @@ -2766,7 +2760,6 @@ gst_adaptive_demux_stream_download_uri (GstAdaptiveDemux * demux, if (G_LIKELY (stream->last_ret == GST_FLOW_OK)) { stream->download_start_time = GST_TIME_AS_USECONDS (gst_adaptive_demux_get_monotonic_time (demux)); - stream->download_chunk_start_time = stream->download_start_time; /* src element is in state READY. Before we start it, we reset * download_finished @@ -3725,8 +3718,7 @@ gst_adaptive_demux_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux, "fragment-stop-time", GST_TYPE_CLOCK_TIME, gst_util_get_timestamp (), "fragment-size", G_TYPE_UINT64, stream->download_total_bytes, "fragment-download-time", - GST_TYPE_CLOCK_TIME, - stream->download_total_time * GST_USECOND, NULL))); + GST_TYPE_CLOCK_TIME, stream->last_download_time, NULL))); /* Don't update to the end of the segment if in reverse playback */ GST_ADAPTIVE_DEMUX_SEGMENT_LOCK (demux); @@ -3754,7 +3746,7 @@ gst_adaptive_demux_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux, ret = GST_FLOW_EOS; } - stream->download_start_time = stream->download_chunk_start_time = + stream->download_start_time = GST_TIME_AS_USECONDS (gst_adaptive_demux_get_monotonic_time (demux)); if (ret == GST_FLOW_OK) { diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h index 9a1a1b7d1..5b39728e0 100644 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.h +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.h @@ -162,8 +162,6 @@ struct _GstAdaptiveDemuxStream gboolean starting_fragment; gboolean first_fragment_buffer; gint64 download_start_time; - gint64 download_chunk_start_time; - gint64 download_total_time; gint64 download_total_bytes; guint64 current_download_rate; -- cgit v1.2.1