From 10a1f8395fb72ef4c7096c4d8c4949a477b2ef14 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 29 Sep 2011 14:22:33 +0100 Subject: [PATCH 1/3] opusenc: fix calculation of filler data size https://bugzilla.gnome.org/show_bug.cgi?id=660469 --- ext/opus/gstopusenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index 75ccaaa573..9fc30757fe 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -807,7 +807,7 @@ gst_opus_enc_encode (GstOpusEnc * enc, gboolean flush) (enc->bitrate * enc->frame_samples / enc->sample_rate + 4) / 8; if (flush && gst_adapter_available (enc->adapter) % bytes != 0) { - guint diff = gst_adapter_available (enc->adapter) % bytes; + guint diff = bytes - gst_adapter_available (enc->adapter) % bytes; GstBuffer *buf = gst_buffer_new_and_alloc (diff); memset (GST_BUFFER_DATA (buf), 0, diff); From ca14e2e0617f466aef588adb5b3cebec80a2d7a2 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Wed, 5 Oct 2011 15:47:06 +0100 Subject: [PATCH 2/3] opusenc: use debug level for debug info, not error https://bugzilla.gnome.org/show_bug.cgi?id=660999 --- ext/opus/gstopusenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index 9fc30757fe..f25cbca43d 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -270,7 +270,7 @@ gst_opus_enc_sink_setcaps (GstPad * pad, GstCaps * caps) gst_caps_unref (otherpadcaps); } - GST_ERROR_OBJECT (pad, "channels=%d rate=%d frame-size=%d", + GST_DEBUG_OBJECT (pad, "channels=%d rate=%d frame-size=%d", enc->n_channels, enc->sample_rate, enc->frame_size); switch (enc->frame_size) { case 2: @@ -296,7 +296,7 @@ gst_opus_enc_sink_setcaps (GstPad * pad, GstCaps * caps) return FALSE; break; } - GST_ERROR ("frame_samples %d", enc->frame_samples); + GST_DEBUG_OBJECT (pad, "frame_samples %d", enc->frame_samples); gst_opus_enc_setup (enc); From 2488107279285be1dde759aeaf20857a529e0f8d Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Wed, 5 Oct 2011 18:25:58 +0100 Subject: [PATCH 3/3] opusenc: fix latency query This makes live 'audiosrc ! opusenc ! opusdec ! audiosink' pipelines actually work without all audio being dumped. https://bugzilla.gnome.org/show_bug.cgi?id=660999 --- ext/opus/gstopusenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index f25cbca43d..51ae5c2a37 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -534,7 +534,7 @@ gst_opus_enc_src_query (GstPad * pad, GstQuery * query) GstClockTime min_latency, max_latency; gint64 latency; - if ((res = gst_pad_peer_query (pad, query))) { + if ((res = gst_pad_peer_query (enc->sinkpad, query))) { gst_query_parse_latency (query, &live, &min_latency, &max_latency); latency = gst_opus_enc_get_latency (enc);