mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
qtdemux: Forward upstream time-format segment without mapping
Sample table based segment event (genereted by qtdemux) could break presentation timeline. For example, qtdemux should not modify upstream time format segment (e.g., adaptivedemux use case) https://bugzilla.gnome.org/show_bug.cgi?id=796480
This commit is contained in:
parent
418a6270e5
commit
6b29a4507e
1 changed files with 25 additions and 12 deletions
|
@ -1038,21 +1038,25 @@ static void
|
||||||
gst_qtdemux_push_pending_newsegment (GstQTDemux * qtdemux)
|
gst_qtdemux_push_pending_newsegment (GstQTDemux * qtdemux)
|
||||||
{
|
{
|
||||||
if (G_UNLIKELY (qtdemux->need_segment)) {
|
if (G_UNLIKELY (qtdemux->need_segment)) {
|
||||||
GstClockTime min_ts;
|
|
||||||
GstEvent *newsegment;
|
GstEvent *newsegment;
|
||||||
|
|
||||||
if (!gst_qtdemux_streams_have_samples (qtdemux)) {
|
if (!qtdemux->upstream_format_is_time) {
|
||||||
/* No samples yet, can't decide on segment.start */
|
GstClockTime min_ts;
|
||||||
GST_DEBUG_OBJECT (qtdemux, "No samples yet, postponing segment event");
|
|
||||||
return;
|
if (!gst_qtdemux_streams_have_samples (qtdemux)) {
|
||||||
|
/* No samples yet, can't decide on segment.start */
|
||||||
|
GST_DEBUG_OBJECT (qtdemux, "No samples yet, postponing segment event");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
min_ts = gst_qtdemux_streams_get_first_sample_ts (qtdemux);
|
||||||
|
|
||||||
|
/* have_samples() above should guarantee we have a valid time */
|
||||||
|
g_assert (GST_CLOCK_TIME_IS_VALID (min_ts));
|
||||||
|
|
||||||
|
qtdemux->segment.start = min_ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
min_ts = gst_qtdemux_streams_get_first_sample_ts (qtdemux);
|
|
||||||
|
|
||||||
/* have_samples() above should guarantee we have a valid time */
|
|
||||||
g_assert (GST_CLOCK_TIME_IS_VALID (min_ts));
|
|
||||||
|
|
||||||
qtdemux->segment.start = min_ts;
|
|
||||||
newsegment = gst_event_new_segment (&qtdemux->segment);
|
newsegment = gst_event_new_segment (&qtdemux->segment);
|
||||||
if (qtdemux->segment_seqnum != GST_SEQNUM_INVALID)
|
if (qtdemux->segment_seqnum != GST_SEQNUM_INVALID)
|
||||||
gst_event_set_seqnum (newsegment, qtdemux->segment_seqnum);
|
gst_event_set_seqnum (newsegment, qtdemux->segment_seqnum);
|
||||||
|
@ -6900,7 +6904,16 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
|
||||||
|
|
||||||
demux->got_moov = TRUE;
|
demux->got_moov = TRUE;
|
||||||
demux->need_segment = TRUE;
|
demux->need_segment = TRUE;
|
||||||
gst_qtdemux_map_and_push_segments (demux, &demux->segment);
|
|
||||||
|
/* Forward upstream driven time format segment, and also do not try
|
||||||
|
* to map edit list with the upstream time format segment.
|
||||||
|
* It's upstream element's role (the origin of time format segment)
|
||||||
|
*/
|
||||||
|
if (demux->upstream_format_is_time)
|
||||||
|
gst_qtdemux_check_send_pending_segment (demux);
|
||||||
|
else
|
||||||
|
gst_qtdemux_map_and_push_segments (demux, &demux->segment);
|
||||||
|
|
||||||
if (demux->exposed)
|
if (demux->exposed)
|
||||||
demux->need_segment = FALSE;
|
demux->need_segment = FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue