[vlc-devel] [PATCH 2/8] mmal/codec: Don't send buffers to disabled ports
Julian Scheel
julian at jusst.de
Wed Jun 3 09:37:29 CEST 2015
If a port is not enabled sending any buffers to it will cause an error, so
just don't try it.
Signed-off-by: Julian Scheel <julian at jusst.de>
---
modules/hw/mmal/codec.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index 3204def..0466c3a 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -389,11 +389,13 @@ static int send_output_buffer(decoder_t *dec)
int buffer_size = 0;
int ret = 0;
+ if (!sys->output->is_enabled)
+ return VLC_EGENERIC;
+
buffer = mmal_queue_get(sys->output_pool->queue);
if (!buffer) {
msg_Warn(dec, "Failed to get new buffer");
- ret = -1;
- goto out;
+ return VLC_EGENERIC;
}
picture = decoder_NewPicture(dec);
@@ -438,7 +440,6 @@ static int send_output_buffer(decoder_t *dec)
}
sys->output_in_transit++;
-out:
return ret;
err:
--
2.4.0
More information about the vlc-devel
mailing list