[Bug 646474] New: rtpspeexpay should drop empty samples
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Fri Apr 1 12:49:44 PDT 2011
https://bugzilla.gnome.org/show_bug.cgi?id=646474
GStreamer | gst-plugins-good | git
Summary: rtpspeexpay should drop empty samples
Classification: Platform
Product: GStreamer
Version: git
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gst-plugins-good
AssignedTo: gstreamer-bugs at lists.freedesktop.org
ReportedBy: bug-track at fisher-privat.net
QAContact: gstreamer-bugs at lists.freedesktop.org
GNOME target: ---
GNOME version: ---
speexenc has dtx (Discontinuous Transmission) option. If it enabled, speex
generate dummy samples if it get silence on input.
This dummy samples are needed if we write a file, but thay are useless if we
stream it over network with rtp.
With current speexenc ! rtpspeexpay ... i get about 30 kbit/s
with speexenc vbr=1 dtx=1 ! rtpspeexpay ... i get about 25 kbit/s
and about 19 kbit/s on complete silence. This can be reduced if rtpspeexpay
will drop this dummy samples or speexenc will have option to not generate it.
Here is the sample where it can be done.
diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c
index 4a0bba6..d4ded47 100644
--- a/ext/speex/gstspeexenc.c
+++ b/ext/speex/gstspeexenc.c
@@ -901,7 +901,7 @@ gst_speex_enc_encode (GstSpeexEnc * enc, gboolean flush)
while (gst_adapter_available (enc->adapter) >= bytes) {
gint16 *data;
- gint outsize, written;
+ gint outsize, written, dtx_ret;
GstBuffer *outbuf;
data = (gint16 *) gst_adapter_take (enc->adapter, bytes);
@@ -913,10 +913,13 @@ gst_speex_enc_encode (GstSpeexEnc * enc, gboolean flush)
if (enc->channels == 2) {
speex_encode_stereo_int (data, frame_size, &enc->bits);
}
- speex_encode_int (enc->state, data, &enc->bits);
+ dtx_ret = speex_encode_int (enc->state, data, &enc->bits);
g_free (data);
+ if (!dtx_ret)
+ continue;
+
enc->frameno++;
enc->frameno_out++;
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list