[gstreamer-bugs] [Bug 586570] Add GAP Flag support to audioresample

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Oct 14 19:03:07 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=586570
  GStreamer | gst-plugins-base | git

Leo Singer <lsinger> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lsinger at caltech.edu

--- Comment #19 from Leo Singer <lsinger at caltech.edu> 2010-10-15 02:02:56 UTC ---
Here is why these three unit tests are failing.  The effect of this patch is to
shrink each gap by half a filter-length on either side.  I decided to treat the
first buffer of a new segment as if it had been preceded by a gap, so upon
output there is an extra half-filter-length of non-gap data at the beginning of
the stream.

The third unit test fails for that reason: the way in which it calculates the
output latency no longer works.  Telling the unit test explicitly how much
latency to expect results in the unit test passing; see the patch below.

The first and second unit test failures occur for the following reason: If the
input stream's timestamps started from zero, the output stream's timestamps
would have to start at minus a half filter length.  Since timestamps are
unsigned, this results in integer overflow, which is why you see the timestamp
18446744073708218283.

Should I alter my patch so that the first half-filter-length of transient
response at the beginning of a new segment is discarded?



The following patch fixes the third unit test failure; the first two unit test
failures remain.

diff --git a/tests/check/elements/audioresample.c
b/tests/check/elements/audioresample.c
index a9a2e3b..0fc025c 100644
--- a/tests/check/elements/audioresample.c
+++ b/tests/check/elements/audioresample.c
@@ -768,9 +768,6 @@ fakesink_handoff_cb (GstElement * object, GstBuffer *
buffer, GstPad * pad,
   TimestampDriftCtx *ctx = user_data;

   ctx->out_buffer_count++;
-  if (ctx->latency == GST_CLOCK_TIME_NONE) {
-    ctx->latency = 1000 - GST_BUFFER_SIZE (buffer) / 8;
-  }

   /* Check if we have a perfectly timestampped stream */
   if (ctx->next_out_ts != GST_CLOCK_TIME_NONE)
@@ -838,6 +835,7 @@ GST_START_TEST (test_timestamp_drift)
   GstBus *bus;
   GMainLoop *loop;
   GstCaps *caps;
+  gint filter_length;

   pipeline = gst_pipeline_new ("pipeline");
   fail_unless (pipeline != NULL);
@@ -870,6 +868,8 @@ GST_START_TEST (test_timestamp_drift)
       ("audio/x-raw-float, channels=1, width=64, rate=4096");
   g_object_set (G_OBJECT (capsfilter2), "caps", caps, NULL);
   gst_caps_unref (caps);
+  g_object_get (G_OBJECT (audioresample), "filter-length", &filter_length,
NULL);
+  ctx.latency = filter_length / 2;

   fakesink = gst_element_factory_make ("fakesink", "sink");
   fail_unless (fakesink != NULL);


(In reply to comment #17)
> Unfortunately this patch makes the unit test for audioresample fail
> (tests/check/elements/audioresample):
> 
> 
> $ make elements/audioresample.check
>   CC     elements_audioresample-audioresample.o
>   CCLD   elements/audioresample
> Running suite(s): audioresample
> 62%: Checks: 8, Failures: 3, Errors: 0
> elements/audioresample.c:156:F:general:test_perfect_stream:0: 'timestamp' (0)
> is not equal to 'GST_BUFFER_TIMESTAMP (buffer)' (18446744073708218283)
> elements/audioresample.c:310:F:general:test_discont_stream:0: 'ints' (0) is not
> equal to 'GST_BUFFER_TIMESTAMP (outbuffer)' (18446744073708218283)
> elements/audioresample.c:811:F:general:test_timestamp_drift:0: expected output
> timestamp 0:00:00.244140625 (244140625) got output timestamp 0:00:00.236328125
> (236328125)
> Running suite(s): audioresample
> 0:00:00.146490264  3264      0x19a33e0 WARN           basetransform
> gstbasetransform.c:1558:gst_base_transform_prepare_output_buffer:<audioresample>
> pad-alloc failed: wrong-state
> 0:00:00.146539083  3264      0x19a33e0 WARN           basetransform
> gstbasetransform.c:2219:gst_base_transform_handle_buffer:<audioresample> could
> not get buffer from pool: wrong-state
> 0:00:00.157771447  3264 0x2b90e8003270 WARN           basetransform
> gstbasetransform.c:1558:gst_base_transform_prepare_output_buffer:<audioresample>
> pad-alloc failed: wrong-state
> 0:00:00.157823269  3264 0x2b90e8003270 WARN           basetransform
> gstbasetransform.c:2219:gst_base_transform_handle_buffer:<audioresample> could
> not get buffer from pool: wrong-state
> 0:00:00.199778672  3264 0x2b90e8003270 WARN           basetransform
> gstbasetransform.c:1558:gst_base_transform_prepare_output_buffer:<audioresample>
> pad-alloc failed: wrong-state
> 0:00:00.199800882  3264 0x2b90e8003270 WARN           basetransform
> gstbasetransform.c:2219:gst_base_transform_handle_buffer:<audioresample> could
> not get buffer from pool: wrong-state
> 0:00:00.222552028  3264 0x2b90e8003270 WARN           basetransform
> gstbasetransform.c:1558:gst_base_transform_prepare_output_buffer:<audioresample>
> pad-alloc failed: wrong-state
> 0:00:00.222586111  3264 0x2b90e8003270 WARN           basetransform
> gstbasetransform.c:2219:gst_base_transform_handle_buffer:<audioresample> could
> not get buffer from pool: wrong-state
> 0:00:00.231833794  3264      0x19a33e0 WARN           basetransform
> gstbasetransform.c:1558:gst_base_transform_prepare_output_buffer:<audioresample>
> pad-alloc failed: wrong-state
> 0:00:00.231868854  3264      0x19a33e0 WARN           basetransform
> gstbasetransform.c:2219:gst_base_transform_handle_buffer:<audioresample> could
> not get buffer from pool: wrong-state
> 0:00:00.283478911  3267      0x191a010 WARN           audioresample
> gstaudioresample.c:1014:gst_audio_resample_check_discont:<audioresample>
> encountered timestamp discontinuity of 19992 samples = 0:00:00.399840000
> 62%: Checks: 8, Failures: 3, Errors: 0
> elements/audioresample.c:156:F:general:test_perfect_stream:0: 'timestamp' (0)
> is not equal to 'GST_BUFFER_TIMESTAMP (buffer)' (18446744073708218283)
> elements/audioresample.c:310:F:general:test_discont_stream:0: 'ints' (0) is not
> equal to 'GST_BUFFER_TIMESTAMP (outbuffer)' (18446744073708218283)
> elements/audioresample.c:811:F:general:test_timestamp_drift:0: expected output
> timestamp 0:00:00.244140625 (244140625) got output timestamp 0:00:00.236328125
> (236328125)
> make: *** [elements/audioresample.check] Error 3

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.




More information about the Gstreamer-bugs mailing list