mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 02:02:26 +00:00
tsmux: Slightly reflow collected buffer handler for clarity.
This commit is contained in:
parent
43938bbf54
commit
119c27c9b9
1 changed files with 123 additions and 121 deletions
|
@ -1039,6 +1039,11 @@ mpegtsmux_collected_buffer (GstCollectPads * pads, GstCollectData * data,
|
|||
{
|
||||
GstFlowReturn ret = GST_FLOW_OK;
|
||||
MpegTsPadData *best = (MpegTsPadData *) data;
|
||||
TsMuxProgram *prog;
|
||||
gint64 pts = -1;
|
||||
guint64 dts = -1;
|
||||
gboolean delta = TRUE;
|
||||
StreamData *stream_data;
|
||||
|
||||
GST_DEBUG_OBJECT (mux, "Pads collected");
|
||||
|
||||
|
@ -1052,13 +1057,17 @@ mpegtsmux_collected_buffer (GstCollectPads * pads, GstCollectData * data,
|
|||
mux->first = FALSE;
|
||||
}
|
||||
|
||||
if (best != NULL) {
|
||||
TsMuxProgram *prog = best->prog;
|
||||
gint64 pts = -1;
|
||||
guint64 dts = -1;
|
||||
gboolean delta = TRUE;
|
||||
StreamData *stream_data;
|
||||
if (G_UNLIKELY (best == NULL)) {
|
||||
/* EOS */
|
||||
/* drain some possibly cached data */
|
||||
new_packet_m2ts (mux, NULL, -1);
|
||||
mpegtsmux_push_packets (mux, TRUE);
|
||||
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
||||
prog = best->prog;
|
||||
if (prog == NULL)
|
||||
goto no_program;
|
||||
|
||||
|
@ -1155,8 +1164,8 @@ mpegtsmux_collected_buffer (GstCollectPads * pads, GstCollectData * data,
|
|||
if (prog->pcr_stream == best->stream) {
|
||||
/* prefer DTS if present for PCR as it should be monotone */
|
||||
mux->last_ts =
|
||||
GST_CLOCK_TIME_IS_VALID (best->last_dts) ? best->
|
||||
last_dts : best->last_pts;
|
||||
GST_CLOCK_TIME_IS_VALID (best->last_dts) ? best->last_dts : best->
|
||||
last_pts;
|
||||
}
|
||||
|
||||
mux->is_delta = delta;
|
||||
|
@ -1172,13 +1181,6 @@ mpegtsmux_collected_buffer (GstCollectPads * pads, GstCollectData * data,
|
|||
}
|
||||
/* flush packet cache */
|
||||
mpegtsmux_push_packets (mux, FALSE);
|
||||
} else {
|
||||
/* EOS */
|
||||
/* drain some possibly cached data */
|
||||
new_packet_m2ts (mux, NULL, -1);
|
||||
mpegtsmux_push_packets (mux, TRUE);
|
||||
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
|
|
Loading…
Reference in a new issue