[vlc-commits] mmal/codec: Don't send buffers to disabled ports

Julian Scheel git at videolan.org
Fri Jun 5 15:37:13 CEST 2015


vlc | branch: master | Julian Scheel <julian at jusst.de> | Wed Jun  3 09:37:29 2015 +0200| [de2115b5d2ba9199fecbb4c01228e6125c378633] | committer: Jean-Baptiste Kempf

mmal/codec: Don't send buffers to disabled ports

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>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de2115b5d2ba9199fecbb4c01228e6125c378633
---

 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:



More information about the vlc-commits mailing list