[MOVED FROM GST-P-FARSIGHT] Don't try to set the discont flag if the duration of the previous incoming buffer was not valid

20080403004012-3e2dc-6f95520c928c347508bdf6188c873ed724ad2dd7.gz
This commit is contained in:
Olivier Crete 2008-04-03 00:40:12 +00:00 committed by Edward Hervey
parent dc27b8f569
commit 56757b3ae2

View file

@ -827,8 +827,11 @@ gst_live_live_adder_chain (GstPad *pad, GstBuffer *buffer)
GST_TIME_ARGS (padprivate->next_timestamp), GST_TIME_ARGS (padprivate->next_timestamp),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer))); GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
padprivate->next_timestamp = GST_BUFFER_TIMESTAMP (buffer) + if ( GST_BUFFER_DURATION_IS_VALID(buffer))
GST_BUFFER_DURATION (buffer); padprivate->next_timestamp = GST_BUFFER_TIMESTAMP (buffer) +
GST_BUFFER_DURATION (buffer);
else
padprivate->next_timestamp = GST_CLOCK_TIME_NONE;
buffer = gst_buffer_make_metadata_writable (buffer); buffer = gst_buffer_make_metadata_writable (buffer);
@ -1083,8 +1086,7 @@ gst_live_adder_loop (gpointer data)
goto again; goto again;
if (GST_CLOCK_TIME_IS_VALID (adder->next_timestamp) && if (GST_CLOCK_TIME_IS_VALID (adder->next_timestamp) &&
GST_BUFFER_TIMESTAMP (buffer) != adder->next_timestamp) GST_BUFFER_TIMESTAMP (buffer) != adder->next_timestamp) {
{
if (llabs (GST_BUFFER_TIMESTAMP (buffer) - adder->next_timestamp) < if (llabs (GST_BUFFER_TIMESTAMP (buffer) - adder->next_timestamp) <
GST_SECOND / adder->rate) { GST_SECOND / adder->rate) {
GST_BUFFER_TIMESTAMP (buffer) = adder->next_timestamp; GST_BUFFER_TIMESTAMP (buffer) = adder->next_timestamp;
@ -1098,15 +1100,17 @@ gst_live_adder_loop (gpointer data)
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer))); GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
} }
} else { } else {
GST_DEBUG_OBJECT (adder, "Continuous buffer");
GST_BUFFER_FLAG_UNSET(buffer, GST_BUFFER_FLAG_DISCONT); GST_BUFFER_FLAG_UNSET(buffer, GST_BUFFER_FLAG_DISCONT);
} }
GST_BUFFER_OFFSET(buffer) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_OFFSET(buffer) = GST_BUFFER_OFFSET_NONE;
GST_BUFFER_OFFSET_END(buffer) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_OFFSET_END(buffer) = GST_BUFFER_OFFSET_NONE;
adder->next_timestamp = GST_BUFFER_TIMESTAMP (buffer) + if (GST_BUFFER_DURATION_IS_VALID (buffer))
GST_BUFFER_DURATION (buffer); adder->next_timestamp = GST_BUFFER_TIMESTAMP (buffer) +
GST_BUFFER_DURATION (buffer);
else
adder->next_timestamp = GST_CLOCK_TIME_NONE;
if (adder->segment_pending) if (adder->segment_pending)
{ {