diff options
author | Olivier Crete <olivier.crete@collabora.co.uk> | 2008-04-03 00:40:12 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-02-17 19:29:03 +0100 |
commit | 56757b3ae2a379415b341d254b7e53281dfff485 (patch) | |
tree | 2abd24dc52cd483b486d74607d3acb7d4fef46d8 | |
parent | dc27b8f5694a2c60962da6b68f5d1739f460231d (diff) | |
download | gst-plugins-bad-56757b3ae2a379415b341d254b7e53281dfff485.tar.gz gst-plugins-bad-56757b3ae2a379415b341d254b7e53281dfff485.tar.bz2 gst-plugins-bad-56757b3ae2a379415b341d254b7e53281dfff485.zip |
[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
-rw-r--r-- | gst/liveadder/liveadder.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c index 19ba7bb2..1c126f99 100644 --- a/gst/liveadder/liveadder.c +++ b/gst/liveadder/liveadder.c @@ -827,8 +827,11 @@ gst_live_live_adder_chain (GstPad *pad, GstBuffer *buffer) GST_TIME_ARGS (padprivate->next_timestamp), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer))); - padprivate->next_timestamp = GST_BUFFER_TIMESTAMP (buffer) + - GST_BUFFER_DURATION (buffer); + if ( GST_BUFFER_DURATION_IS_VALID(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); @@ -1083,8 +1086,7 @@ gst_live_adder_loop (gpointer data) goto again; 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) < GST_SECOND / adder->rate) { GST_BUFFER_TIMESTAMP (buffer) = adder->next_timestamp; @@ -1098,15 +1100,17 @@ gst_live_adder_loop (gpointer data) GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer))); } } else { - GST_DEBUG_OBJECT (adder, "Continuous buffer"); GST_BUFFER_FLAG_UNSET(buffer, GST_BUFFER_FLAG_DISCONT); } GST_BUFFER_OFFSET(buffer) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_OFFSET_END(buffer) = GST_BUFFER_OFFSET_NONE; - adder->next_timestamp = GST_BUFFER_TIMESTAMP (buffer) + - GST_BUFFER_DURATION (buffer); + if (GST_BUFFER_DURATION_IS_VALID (buffer)) + adder->next_timestamp = GST_BUFFER_TIMESTAMP (buffer) + + GST_BUFFER_DURATION (buffer); + else + adder->next_timestamp = GST_CLOCK_TIME_NONE; if (adder->segment_pending) { |