mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 21:28:45 +00:00
faad: tweak output buffer timestamping
In particular, avoid packetised input leading to initial to non-0 output ts.
This commit is contained in:
parent
4e43e8bc67
commit
636d1caf0d
1 changed files with 21 additions and 9 deletions
|
@ -263,8 +263,8 @@ gst_faad_reset (GstFaad * faad)
|
||||||
faad->packetised = FALSE;
|
faad->packetised = FALSE;
|
||||||
g_free (faad->channel_positions);
|
g_free (faad->channel_positions);
|
||||||
faad->channel_positions = NULL;
|
faad->channel_positions = NULL;
|
||||||
faad->next_ts = 0;
|
faad->next_ts = GST_CLOCK_TIME_NONE;
|
||||||
faad->prev_ts = GST_CLOCK_TIME_NONE;
|
faad->prev_ts = 0;
|
||||||
faad->bytes_in = 0;
|
faad->bytes_in = 0;
|
||||||
faad->sum_dur_out = 0;
|
faad->sum_dur_out = 0;
|
||||||
faad->error_count = 0;
|
faad->error_count = 0;
|
||||||
|
@ -698,8 +698,8 @@ gst_faad_sink_event (GstPad * pad, GstEvent * event)
|
||||||
" - %" GST_TIME_FORMAT, GST_TIME_ARGS (new_start),
|
" - %" GST_TIME_FORMAT, GST_TIME_ARGS (new_start),
|
||||||
GST_TIME_ARGS (new_end));
|
GST_TIME_ARGS (new_end));
|
||||||
|
|
||||||
faad->next_ts = new_start;
|
faad->next_ts = GST_CLOCK_TIME_NONE;
|
||||||
faad->prev_ts = GST_CLOCK_TIME_NONE;
|
faad->prev_ts = new_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = gst_pad_push_event (faad->srcpad, event);
|
res = gst_pad_push_event (faad->srcpad, event);
|
||||||
|
@ -1045,16 +1045,22 @@ gst_faad_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
next = FALSE;
|
next = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ts = gst_adapter_prev_timestamp (faad->adapter, NULL);
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (ts) && (ts != faad->prev_ts))
|
|
||||||
faad->prev_ts = faad->next_ts = ts;
|
|
||||||
|
|
||||||
available = gst_adapter_available (faad->adapter);
|
available = gst_adapter_available (faad->adapter);
|
||||||
input_size = available;
|
input_size = available;
|
||||||
|
|
||||||
if (G_UNLIKELY (!available))
|
if (G_UNLIKELY (!available))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
ts = gst_adapter_prev_timestamp (faad->adapter, NULL);
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (ts) && (ts != faad->prev_ts)) {
|
||||||
|
faad->prev_ts = ts;
|
||||||
|
} else {
|
||||||
|
/* nothing new */
|
||||||
|
ts = GST_CLOCK_TIME_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GST_CLOCK_TIME_IS_VALID (faad->next_ts))
|
||||||
|
faad->next_ts = faad->prev_ts;
|
||||||
|
|
||||||
input_data = (guchar *) gst_adapter_peek (faad->adapter, available);
|
input_data = (guchar *) gst_adapter_peek (faad->adapter, available);
|
||||||
|
|
||||||
if (!faad->packetised) {
|
if (!faad->packetised) {
|
||||||
|
@ -1211,6 +1217,12 @@ gst_faad_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* adjust to incoming new timestamp, if any, after decoder delay */
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (ts)) {
|
||||||
|
faad->next_ts = ts;
|
||||||
|
ts = GST_CLOCK_TIME_NONE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in a new issue