summaryrefslogtreecommitdiff
path: root/ext/hls/gsthlsdemux.c
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2016-08-03 04:18:18 +1000
committerJan Schmidt <jan@centricular.com>2016-08-03 23:51:14 +1000
commitebab5b17f423ba77c3228f733509dbfdb419b2b1 (patch)
treec0f5189e0d9d26115aa82f549e6850f934bb5ff4 /ext/hls/gsthlsdemux.c
parent89727ee9a3723801db8fb8966a1ad42072940cd5 (diff)
downloadgstreamer-plugins-bad-ebab5b17f423ba77c3228f733509dbfdb419b2b1.tar.gz
hls: Fix compiler warning for possibly uninit variable
Diffstat (limited to 'ext/hls/gsthlsdemux.c')
-rw-r--r--ext/hls/gsthlsdemux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c
index a2c14187b..aab0dbeac 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)