hlsdemux2: Fix debug return statement
authorEdward Hervey <edward@centricular.com>
Fri, 3 Jun 2022 08:25:34 +0000 (10:25 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 28 Jun 2022 17:59:24 +0000 (17:59 +0000)
Due to latest commits res could have been NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2679>

subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c

index 8ffdccc..16f4efb 100644 (file)
@@ -1117,7 +1117,9 @@ gst_hls_media_playlist_sync_to_segment (GstHLSMediaPlaylist * playlist,
       g_ptr_array_remove_index (playlist->segments, 0);
       res = NULL;
     }
+  }
 #ifndef GST_DISABLE_GST_DEBUG
+  if (res) {
     pdtstring =
         res->datetime ? g_date_time_format_iso8601 (res->datetime) : NULL;
     GST_DEBUG ("Returning segment sn:%" G_GINT64_FORMAT " dsn:%" G_GINT64_FORMAT
@@ -1126,10 +1128,10 @@ gst_hls_media_playlist_sync_to_segment (GstHLSMediaPlaylist * playlist,
         GST_STIME_ARGS (res->stream_time), GST_TIME_ARGS (res->duration),
         pdtstring);
     g_free (pdtstring);
-#endif
-  } else if (!GST_HLS_MEDIA_PLAYLIST_IS_LIVE (playlist)) {
+  } else {
     GST_DEBUG ("Could not find a match");
   }
+#endif
 
   return res;
 }