mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
collectpads: Use GST_BUFFER_DTS_OR_PTS
Simplifies code a bit
This commit is contained in:
parent
41e1bea7ef
commit
16458daddb
1 changed files with 2 additions and 7 deletions
|
@ -1474,10 +1474,7 @@ gst_collect_pads_find_best_pad (GstCollectPads * pads,
|
||||||
buffer = gst_collect_pads_peek (pads, data);
|
buffer = gst_collect_pads_peek (pads, data);
|
||||||
/* if we have a buffer check if it is better then the current best one */
|
/* if we have a buffer check if it is better then the current best one */
|
||||||
if (buffer != NULL) {
|
if (buffer != NULL) {
|
||||||
timestamp = GST_BUFFER_DTS (buffer);
|
timestamp = GST_BUFFER_DTS_OR_PTS (buffer);
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (timestamp)) {
|
|
||||||
timestamp = GST_BUFFER_PTS (buffer);
|
|
||||||
}
|
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
if (best == NULL || pads->priv->compare_func (pads, data, timestamp,
|
if (best == NULL || pads->priv->compare_func (pads, data, timestamp,
|
||||||
best, best_time, pads->priv->compare_user_data) < 0) {
|
best, best_time, pads->priv->compare_user_data) < 0) {
|
||||||
|
@ -2202,9 +2199,7 @@ gst_collect_pads_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
||||||
if (G_LIKELY (data->segment.format == GST_FORMAT_TIME)) {
|
if (G_LIKELY (data->segment.format == GST_FORMAT_TIME)) {
|
||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
|
|
||||||
timestamp = GST_BUFFER_DTS (buffer);
|
timestamp = GST_BUFFER_DTS_OR_PTS (buffer);
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (timestamp))
|
|
||||||
timestamp = GST_BUFFER_PTS (buffer);
|
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (timestamp))
|
if (GST_CLOCK_TIME_IS_VALID (timestamp))
|
||||||
data->segment.position = timestamp;
|
data->segment.position = timestamp;
|
||||||
|
|
Loading…
Reference in a new issue