summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2012-07-02 17:32:14 -0700
committerDavid Schleef <ds@schleef.org>2012-07-02 18:59:33 -0700
commite49b155d8de440b5b5413e39d5cd175a950c64e9 (patch)
treec66343727876e6abcd9ae927fc150f6a7c337a33
parentb1d2e69afc6216d8d8a44e68a115d1f6b300cc42 (diff)
inter: Increase the inter audio surface buffering
-rw-r--r--gst/inter/gstinteraudiosink.c9
-rw-r--r--gst/inter/gstinteraudiosrc.c6
2 files changed, 8 insertions, 7 deletions
diff --git a/gst/inter/gstinteraudiosink.c b/gst/inter/gstinteraudiosink.c
index 0d58a537b..4c9272134 100644
--- a/gst/inter/gstinteraudiosink.c
+++ b/gst/inter/gstinteraudiosink.c
@@ -332,10 +332,11 @@ gst_inter_audio_sink_render (GstBaseSink * sink, GstBuffer * buffer)
g_mutex_lock (interaudiosink->surface->mutex);
n = gst_adapter_available (interaudiosink->surface->audio_adapter) / 4;
- if (n > (800 * 2 * 2)) {
- GST_INFO ("flushing 800 samples");
- gst_adapter_flush (interaudiosink->surface->audio_adapter, 800 * 4);
- n -= 800;
+#define SIZE 1600
+ if (n > (1600 * 3)) {
+ GST_WARNING ("flushing 800 samples");
+ gst_adapter_flush (interaudiosink->surface->audio_adapter, (SIZE / 2) * 4);
+ n -= (SIZE / 2);
}
gst_adapter_push (interaudiosink->surface->audio_adapter,
gst_buffer_ref (buffer));
diff --git a/gst/inter/gstinteraudiosrc.c b/gst/inter/gstinteraudiosrc.c
index 4f9d3a7ef..c996c3269 100644
--- a/gst/inter/gstinteraudiosrc.c
+++ b/gst/inter/gstinteraudiosrc.c
@@ -393,8 +393,8 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
g_mutex_lock (interaudiosrc->surface->mutex);
n = gst_adapter_available (interaudiosrc->surface->audio_adapter) / 4;
- if (n > SIZE * 2) {
- GST_DEBUG ("flushing %d samples", SIZE / 2);
+ if (n > SIZE * 3) {
+ GST_WARNING ("flushing %d samples", SIZE / 2);
gst_adapter_flush (interaudiosrc->surface->audio_adapter, (SIZE / 2) * 4);
n -= (SIZE / 2);
}
@@ -409,7 +409,7 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
if (n < SIZE) {
GstBuffer *newbuf = gst_buffer_new_and_alloc (SIZE * 4);
- GST_DEBUG ("creating %d samples of silence", SIZE - n);
+ GST_WARNING ("creating %d samples of silence", SIZE - n);
memset (GST_BUFFER_DATA (newbuf) + n * 4, 0, SIZE * 4 - n * 4);
if (buffer) {
memcpy (GST_BUFFER_DATA (newbuf), GST_BUFFER_DATA (buffer), n * 4);