summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2018-03-01 18:24:33 -0500
committerOlivier CrĂȘte <olivier.crete@collabora.com>2018-03-01 18:25:02 -0500
commit96261ce220bebb12267dc8dd0aef53b2c6013077 (patch)
tree5e5f50b0c77b5a62057518aed0c562e20e2fb63a
parentc0bf793c05cf793aa18a8548cda702625e388115 (diff)
flvmux: Duration & unit tests
The muxed buffers will not carry the duration of the incoming buffers. https://bugzilla.gnome.org/show_bug.cgi?id=793457
-rw-r--r--gst/flv/gstflvmux.c6
-rw-r--r--tests/check/elements/flvmux.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/gst/flv/gstflvmux.c b/gst/flv/gstflvmux.c
index c3ec66c24..2efb3d210 100644
--- a/gst/flv/gstflvmux.c
+++ b/gst/flv/gstflvmux.c
@@ -1174,9 +1174,11 @@ gst_flv_mux_buffer_to_tag_internal (GstFlvMux * mux, GstBuffer * buffer,
GstClockTime timestamp = GST_CLOCK_TIME_NONE;
if (gst_segment_to_running_time_full (&GST_AGGREGATOR_PAD (pad)->segment,
- GST_FORMAT_TIME, GST_BUFFER_DTS_OR_PTS (buffer), &timestamp) == 1)
+ GST_FORMAT_TIME, GST_BUFFER_DTS_OR_PTS (buffer),
+ &timestamp) == 1) {
GST_BUFFER_PTS (tag) = timestamp;
-
+ GST_BUFFER_DURATION (tag) = GST_BUFFER_DURATION (buffer);
+ }
GST_BUFFER_OFFSET (tag) = GST_BUFFER_OFFSET_NONE;
GST_BUFFER_OFFSET_END (tag) = GST_BUFFER_OFFSET_NONE;
} else {
diff --git a/tests/check/elements/flvmux.c b/tests/check/elements/flvmux.c
index 0cf9b997b..34b5d1c33 100644
--- a/tests/check/elements/flvmux.c
+++ b/tests/check/elements/flvmux.c
@@ -260,7 +260,8 @@ GST_START_TEST (test_speex_streamable)
/* pull header0 */
buf = gst_harness_pull (h);
fail_unless_equals_uint64 (base_time, GST_BUFFER_PTS (buf));
- fail_unless_equals_uint64 (base_time, GST_BUFFER_DTS (buf));
+ fail_unless_equals_uint64 (GST_CLOCK_TIME_NONE, GST_BUFFER_DTS (buf));
+ fail_unless_equals_uint64 (0, GST_BUFFER_DURATION (buf));
gst_buffer_map (buf, &map, GST_MAP_READ);
/* 0x08 means it is audio */
fail_unless_equals_int (0x08, map.data[0]);
@@ -276,7 +277,7 @@ GST_START_TEST (test_speex_streamable)
/* pull header1 */
buf = gst_harness_pull (h);
fail_unless_equals_uint64 (base_time, GST_BUFFER_PTS (buf));
- fail_unless_equals_uint64 (base_time, GST_BUFFER_DTS (buf));
+ fail_unless_equals_uint64 (GST_CLOCK_TIME_NONE, GST_BUFFER_DTS (buf));
fail_unless_equals_uint64 (0, GST_BUFFER_DURATION (buf));
gst_buffer_map (buf, &map, GST_MAP_READ);
/* 0x08 means it is audio */
@@ -293,7 +294,7 @@ GST_START_TEST (test_speex_streamable)
/* pull data */
buf = gst_harness_pull (h);
fail_unless_equals_uint64 (base_time, GST_BUFFER_PTS (buf));
- fail_unless_equals_uint64 (base_time, GST_BUFFER_DTS (buf));
+ fail_unless_equals_uint64 (GST_CLOCK_TIME_NONE, GST_BUFFER_DTS (buf));
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,
@@ -313,7 +314,7 @@ GST_START_TEST (test_speex_streamable)
/* pull data */
buf = gst_harness_pull (h);
fail_unless_equals_uint64 (base_time + duration, GST_BUFFER_PTS (buf));
- fail_unless_equals_uint64 (base_time + duration, GST_BUFFER_DTS (buf));
+ fail_unless_equals_uint64 (GST_CLOCK_TIME_NONE, GST_BUFFER_DTS (buf));
fail_unless_equals_uint64 (duration, GST_BUFFER_DURATION (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE, GST_BUFFER_OFFSET (buf));
fail_unless_equals_uint64 (GST_BUFFER_OFFSET_NONE,