[vlc-commits] avcodec: release block on flushing if we are not using it

Ilkka Ollakka git at videolan.org
Sun Oct 20 16:19:10 CEST 2013


vlc/vlc-2.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Oct 19 20:38:36 2013 +0300| [925f709460cc9f0565d8355ff566d30c754b3e18] | committer: Jean-Baptiste Kempf

avcodec: release block on flushing if we are not using it

(cherry picked from commit 4c4b954783f6bf236856306193b397c7cb2075cd)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/avcodec/encoder.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index dee617b..ef92e42 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1257,8 +1257,10 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
             else
                 p_block->i_dts = p_block->i_pts = VLC_TS_INVALID;
 
-            if( i_out >= 0 && got_packet )
+            if( likely(i_out >= 0 && got_packet ))
                 block_ChainAppend( &p_chain, p_block );
+            else
+                block_Release( p_block );
         } while( got_packet && (i_out>=0) );
         return p_chain;
     }



More information about the vlc-commits mailing list