hlsdemux2: Add debug in find_segment_in_playlist()

In m3u8 segment matching, print the PDT that was matched between playlists.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883>
This commit is contained in:
Jan Schmidt 2022-08-12 02:14:47 +10:00 committed by GStreamer Marge Bot
parent 857541ae07
commit c25814bac0

View file

@ -1460,7 +1460,11 @@ find_segment_in_playlist (GstHLSMediaPlaylist * playlist,
if (cand->datetime if (cand->datetime
&& g_date_time_difference (cand->datetime, segment->datetime) >= 0) { && g_date_time_difference (cand->datetime, segment->datetime) >= 0) {
GST_DEBUG ("Picking by date time"); #ifndef GST_DISABLE_GST_DEBUG
gchar *pdtstring = g_date_time_format_iso8601 (cand->datetime);
GST_DEBUG ("Picking segment with datetime %s", pdtstring);
g_free (pdtstring);
#endif
*matched_pdt = TRUE; *matched_pdt = TRUE;
return cand; return cand;
} }
@ -1655,8 +1659,9 @@ gst_hls_media_playlist_sync_to_playlist (GstHLSMediaPlaylist * playlist,
retry_without_dsn: retry_without_dsn:
/* The new playlist is supposed to be an update of the reference playlist, /* The new playlist is supposed to be an update of the reference playlist,
* therefore we will try from the last segment of the reference playlist and * or a more recently fetched playlist from another rendition. In either case,
* go backwards */ * it's best to start from the last segment of the (older) reference playlist and
* go backwards to find an overlap */
for (idx = reference->segments->len - 1; idx; idx--) { for (idx = reference->segments->len - 1; idx; idx--) {
cand = g_ptr_array_index (reference->segments, idx); cand = g_ptr_array_index (reference->segments, idx);
res = find_segment_in_playlist (playlist, cand, &is_before, &matched_pdt); res = find_segment_in_playlist (playlist, cand, &is_before, &matched_pdt);