From ebab5b17f423ba77c3228f733509dbfdb419b2b1 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 3 Aug 2016 04:18:18 +1000 Subject: [PATCH] hls: Fix compiler warning for possibly uninit variable --- ext/hls/gsthlsdemux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index a2c14187be..aab0dbeacf 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -302,7 +302,6 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek) GList *walk, *stream_walk; GstClockTime current_pos, target_pos; gint64 current_sequence; - GstM3U8MediaFile *file; guint64 bitrate; gboolean snap_before, snap_after, snap_nearest, keyunit; gboolean reverse; @@ -353,6 +352,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek) stream_walk = stream_walk->next) { GstHLSDemuxStream *hls_stream = GST_HLS_DEMUX_STREAM_CAST (stream_walk->data); + GstM3U8MediaFile *file = NULL; current_sequence = 0; current_pos = 0; @@ -406,8 +406,10 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek) GST_M3U8_CLIENT_UNLOCK (hlsdemux->client); /* Play from the end of the current selected segment */ - if (reverse && (snap_before || snap_after || snap_nearest)) - current_pos += file->duration; + if (file) { + if (reverse && (snap_before || snap_after || snap_nearest)) + current_pos += file->duration; + } if (keyunit || snap_before || snap_after || snap_nearest) { if (!reverse) -- 2.34.1