[vlc-commits] mmal: Restore old buffer configuration
Julian Scheel
git at videolan.org
Tue Jan 20 07:08:07 CET 2015
vlc | branch: master | Julian Scheel <julian at jusst.de> | Mon Jan 19 11:30:29 2015 +0100| [f9b028aed85edcee2906c9a49121344bb3497f7e] | committer: Rémi Denis-Courmont
mmal: Restore old buffer configuration
With previours cleanups we reduced the number of allocated mmal buffers and
buffer headers. This caused some issues as the mmal components had to wait for
buffers frequently, which slowed them down. To avoid framedrops and even
picture stalls revert to the old buffer configuration, which wastes a bit
memory in theory but works way more reliably and smoothly.
Signed-off-by: Julian Scheel <julian at jusst.de>
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f9b028aed85edcee2906c9a49121344bb3497f7e
---
modules/hw/mmal/codec.c | 10 ++++++----
modules/hw/mmal/mmal_picture.h | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index 5e2bd83..497149f 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -38,10 +38,11 @@
#include "mmal_picture.h"
-/* These are only required when combined with image_fx filter. But as they
- * won't do much harm besides using a few MB GPU memory, keep them always on
+/*
+ * This seems to be a bit high, but reducing it causes instabilities
*/
-#define NUM_EXTRA_BUFFERS 5
+#define NUM_EXTRA_BUFFERS 20
+#define NUM_DECODER_BUFFER_HEADERS 20
#define MIN_NUM_BUFFERS_IN_TRANSIT 2
@@ -317,12 +318,13 @@ static int change_output_format(decoder_t *dec)
if (sys->opaque) {
sys->output->buffer_num = NUM_ACTUAL_OPAQUE_BUFFERS;
+ pool_size = NUM_DECODER_BUFFER_HEADERS;
} else {
sys->output->buffer_num = __MAX(sys->output->buffer_num_recommended,
MIN_NUM_BUFFERS_IN_TRANSIT);
+ pool_size = sys->output->buffer_num;
}
- pool_size = sys->output->buffer_num;
sys->output->buffer_size = sys->output->buffer_size_recommended;
status = mmal_port_enable(sys->output, output_port_cb);
diff --git a/modules/hw/mmal/mmal_picture.h b/modules/hw/mmal/mmal_picture.h
index e5276af..f30a277 100644
--- a/modules/hw/mmal/mmal_picture.h
+++ b/modules/hw/mmal/mmal_picture.h
@@ -25,7 +25,7 @@
#include <interface/mmal/mmal.h>
/* Think twice before changing this. Incorrect values cause havoc. */
-#define NUM_ACTUAL_OPAQUE_BUFFERS 20
+#define NUM_ACTUAL_OPAQUE_BUFFERS 40
struct picture_sys_t {
vlc_object_t *owner;
More information about the vlc-commits
mailing list