diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c index 280a420489..0cf7a346bc 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c @@ -192,6 +192,7 @@ gst_hls_demux_stream_init (GstHLSDemuxStream * stream) stream->do_typefind = TRUE; stream->reset_pts = TRUE; stream->presentation_offset = 60 * GST_SECOND; + stream->pdt_tag_sent = FALSE; } typedef struct _GstHLSDemux2 GstHLSDemux2; @@ -1683,8 +1684,9 @@ gst_hls_demux_stream_data_received (GstAdaptiveDemux2Stream * stream, { GstHLSDemuxStream *hls_stream = GST_HLS_DEMUX_STREAM_CAST (stream); GstHLSDemux *hlsdemux = GST_HLS_DEMUX_CAST (stream->demux); + GstM3U8MediaSegment *file = hls_stream->current_segment; - if (hls_stream->current_segment == NULL) + if (file == NULL) return GST_ADAPTIVE_DEMUX_FLOW_LOST_SYNC; if (hls_stream->current_offset == -1) @@ -1727,6 +1729,14 @@ gst_hls_demux_stream_data_received (GstAdaptiveDemux2Stream * stream, return GST_FLOW_OK; } + if (!hls_stream->pdt_tag_sent && file != NULL && file->datetime != NULL) { + gst_adaptive_demux2_stream_set_tags (stream, + gst_tag_list_new (GST_TAG_DATE_TIME, + gst_date_time_new_from_g_date_time (g_date_time_ref + (file->datetime)), NULL)); + hls_stream->pdt_tag_sent = TRUE; + } + return gst_hls_demux_stream_handle_buffer (stream, buffer, FALSE); } @@ -2598,6 +2608,14 @@ gst_hls_demux_reset (GstAdaptiveDemux * ademux) GST_DEBUG_OBJECT (demux, "resetting"); + if (ademux->input_period) { + GList *walk; + for (walk = ademux->input_period->streams; walk != NULL; walk = walk->next) { + GstHLSDemuxStream *hls_stream = GST_HLS_DEMUX_STREAM_CAST (walk->data); + hls_stream->pdt_tag_sent = FALSE; + } + } + if (demux->master) { gst_hls_master_playlist_unref (demux->master); demux->master = NULL; diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.h b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.h index 1d7f7dbbab..d4acf754c3 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.h +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.h @@ -168,6 +168,8 @@ struct _GstHLSDemuxStream * "output" stream times. Not enabled (i.e 0) if variant is ISOBMFF */ GstClockTime presentation_offset; + + gboolean pdt_tag_sent; }; typedef struct {