From 32ebee559439a69611c0a19834d40acfa055c4c8 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Sat, 4 Jan 2025 09:59:34 +0100 Subject: [PATCH] adaptivedemux2: Fix usage of GstClockTime vs GstClockTimeDiff Part-of: --- .../ext/adaptivedemux2/gstadaptivedemux-stream.c | 4 ++-- .../ext/adaptivedemux2/gstadaptivedemux-track.c | 4 ++-- .../ext/adaptivedemux2/hls/gsthlsdemux-stream.c | 4 ++-- .../ext/adaptivedemux2/hls/gsthlsdemux-util.c | 11 ++++++----- .../ext/adaptivedemux2/hls/gsthlsdemux.c | 4 ++-- .../gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c | 11 ++++++----- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c index fcf2dcfcf1..6f23ca262e 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-stream.c @@ -2082,8 +2082,8 @@ gst_adaptive_demux2_stream_next_download (GstAdaptiveDemux2Stream * stream) GST_DEBUG_OBJECT (stream, "stream_time after restart seek: %" GST_STIME_FORMAT - " position %" GST_STIME_FORMAT, GST_STIME_ARGS (stream_time), - GST_STIME_ARGS (stream->current_position)); + " position %" GST_TIME_FORMAT, GST_STIME_ARGS (stream_time), + GST_TIME_ARGS (stream->current_position)); } /* Trigger (re)computation of the parsebin input segment */ diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-track.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-track.c index 9125c26627..216a90940f 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-track.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux-track.c @@ -325,8 +325,8 @@ gst_adaptive_demux_track_drain_to (GstAdaptiveDemuxTrack * track, GstAdaptiveDemux *demux = track->demux; GST_DEBUG_ID (track->id, - "draining to running time %" GST_STIME_FORMAT, - GST_STIME_ARGS (drain_running_time)); + "draining to running time %" GST_TIME_FORMAT, + GST_TIME_ARGS (drain_running_time)); while (track->next_position == GST_CLOCK_STIME_NONE || track->next_position < drain_running_time) { diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-stream.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-stream.c index 56ccd72796..c2f1eaa274 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-stream.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-stream.c @@ -548,8 +548,8 @@ gst_hlsdemux_stream_handle_internal_time (GstHLSDemuxStream * hls_stream, if (current_segment->discont) { GST_DEBUG_OBJECT (hls_stream, "DISCONT segment, Updating time map to stream_time:%" GST_STIME_FORMAT - " internal_time:%" GST_TIME_FORMAT, GST_STIME_ARGS (internal_time), - GST_TIME_ARGS (current_stream_time)); + " internal_time:%" GST_TIME_FORMAT, + GST_STIME_ARGS (current_stream_time), GST_TIME_ARGS (internal_time)); gst_time_map_set_values (map, current_stream_time, internal_time, current_segment->datetime); return GST_HLS_PARSER_RESULT_DONE; diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c index 7deeb7317c..20b4a06672 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c @@ -831,8 +831,8 @@ gst_hlsdemux_handle_content_webvtt (GstHLSDemux * demux, gchar **original_lines; GstClockTime localtime = GST_CLOCK_TIME_NONE; GstClockTime mpegtime = GST_CLOCK_TIME_NONE; - GstClockTime low_stream_time = GST_CLOCK_STIME_NONE; - GstClockTime high_stream_time = GST_CLOCK_STIME_NONE; + GstClockTimeDiff low_stream_time = GST_CLOCK_STIME_NONE; + GstClockTimeDiff high_stream_time = GST_CLOCK_STIME_NONE; gboolean found_timing = FALSE; gboolean found_text = FALSE; GPtrArray *builder; @@ -971,11 +971,12 @@ out: * reassess which segment we really are in */ GST_WARNING ("Cue %" GST_STIME_FORMAT " -> %" GST_STIME_FORMAT " is outside of segment %" GST_STIME_FORMAT " -> %" - GST_STIME_FORMAT, GST_STIME_ARGS (low_stream_time), + GST_STIME_FORMAT, + GST_STIME_ARGS (low_stream_time), GST_STIME_ARGS (high_stream_time), GST_STIME_ARGS (current_segment->stream_time), - GST_STIME_ARGS (current_segment->stream_time + - current_segment->duration)); + GST_STIME_ARGS ((GstClockTimeDiff) (current_segment->stream_time + + current_segment->duration))); GstM3U8SeekResult seek_result; diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c index 1aaca05915..17cf67d30c 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c @@ -1230,8 +1230,8 @@ gst_hls_demux_reset_for_lost_sync (GstHLSDemux * hlsdemux) gst_hls_media_playlist_recalculate_stream_time (hls_stream->playlist, hls_stream->current_segment); GST_DEBUG_OBJECT (stream, - "Resynced variant playlist to %" GST_STIME_FORMAT, - GST_STIME_ARGS (stream->current_position)); + "Resynced variant playlist to %" GST_TIME_FORMAT, + GST_TIME_ARGS (stream->current_position)); map = gst_hls_demux_find_time_map (hlsdemux, hls_stream->current_segment->discont_sequence); diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c index 94af549779..211f0075ab 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c @@ -1476,7 +1476,8 @@ gst_hls_media_playlist_find_partial_position (GstHLSMediaPlaylist * playlist, GST_DEBUG ("partial segment %d ts:%" GST_STIME_FORMAT " end:%" GST_STIME_FORMAT, part_idx, GST_STIME_ARGS (cand->stream_time), - GST_STIME_ARGS (cand->stream_time + cand->duration)); + GST_STIME_ARGS ((GstClockTimeDiff) (cand->stream_time + + cand->duration))); /* If the target timestamp is before this partial segment, or in the first half, this * is the partial segment to land in */ @@ -1529,8 +1530,8 @@ gst_hls_media_playlist_find_position (GstHLSMediaPlaylist * playlist, GST_DEBUG ("segment %d ts:%" GST_STIME_FORMAT " end:%" GST_STIME_FORMAT " partial only: %d", seg_idx, GST_STIME_ARGS (cand->stream_time), - GST_STIME_ARGS (cand->stream_time + cand->duration), - cand->partial_only); + GST_STIME_ARGS ((GstClockTimeDiff) (cand->stream_time + + cand->duration)), cand->partial_only); /* Ignore any (disallowed by the spec) partial_only segment if * the playlist is no longer live */ @@ -2531,8 +2532,8 @@ gst_hls_media_playlist_has_lost_sync (GstHLSMediaPlaylist * m3u8, first = g_ptr_array_index (m3u8->segments, 0); GST_DEBUG ("position %" GST_TIME_FORMAT " first %" GST_STIME_FORMAT - " duration %" GST_STIME_FORMAT, GST_TIME_ARGS (position), - GST_STIME_ARGS (first->stream_time), GST_STIME_ARGS (first->duration)); + " duration %" GST_TIME_FORMAT, GST_TIME_ARGS (position), + GST_STIME_ARGS (first->stream_time), GST_TIME_ARGS (first->duration)); if (first->stream_time <= 0) return FALSE;