mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
qtdemux: send GAP events for lagging audio and video streams too
The logic is taken straight from matroskademux, see
77403d0afe
This commit is contained in:
parent
5009cad220
commit
625eb00c06
1 changed files with 14 additions and 7 deletions
|
@ -6359,18 +6359,25 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
|
||||||
/* gap events for subtitle streams */
|
/* gap events for subtitle streams */
|
||||||
for (i = 0; i < QTDEMUX_N_STREAMS (qtdemux); i++) {
|
for (i = 0; i < QTDEMUX_N_STREAMS (qtdemux); i++) {
|
||||||
stream = QTDEMUX_NTH_STREAM (qtdemux, i);
|
stream = QTDEMUX_NTH_STREAM (qtdemux, i);
|
||||||
if (stream->pad && (stream->subtype == FOURCC_subp
|
if (stream->pad) {
|
||||||
|| stream->subtype == FOURCC_text
|
GstClockTime gap_threshold;
|
||||||
|| stream->subtype == FOURCC_sbtl)) {
|
|
||||||
/* send one second gap events until the stream catches up */
|
/* Only send gap events on non-subtitle streams if lagging way behind. */
|
||||||
|
if (stream->subtype == FOURCC_subp
|
||||||
|
|| stream->subtype == FOURCC_text || stream->subtype == FOURCC_sbtl)
|
||||||
|
gap_threshold = 1 * GST_SECOND;
|
||||||
|
else
|
||||||
|
gap_threshold = 3 * GST_SECOND;
|
||||||
|
|
||||||
|
/* send gap events until the stream catches up */
|
||||||
/* gaps can only be sent after segment is activated (segment.stop is no longer -1) */
|
/* gaps can only be sent after segment is activated (segment.stop is no longer -1) */
|
||||||
while (GST_CLOCK_TIME_IS_VALID (stream->segment.stop) &&
|
while (GST_CLOCK_TIME_IS_VALID (stream->segment.stop) &&
|
||||||
GST_CLOCK_TIME_IS_VALID (stream->segment.position) &&
|
GST_CLOCK_TIME_IS_VALID (stream->segment.position) &&
|
||||||
stream->segment.position + GST_SECOND < min_time) {
|
stream->segment.position + gap_threshold < min_time) {
|
||||||
GstEvent *gap =
|
GstEvent *gap =
|
||||||
gst_event_new_gap (stream->segment.position, GST_SECOND);
|
gst_event_new_gap (stream->segment.position, gap_threshold);
|
||||||
gst_pad_push_event (stream->pad, gap);
|
gst_pad_push_event (stream->pad, gap);
|
||||||
stream->segment.position += GST_SECOND;
|
stream->segment.position += gap_threshold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue