[vlc-commits] avcodec: avcodec_alloc_frame() requires avcodec_free_frame()

Rémi Denis-Courmont git at videolan.org
Thu Oct 2 07:50:15 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct  1 23:08:59 2014 +0300| [4e54f297879ff5f673446c2f4472f90caddd8731] | committer: Rémi Denis-Courmont

avcodec: avcodec_alloc_frame() requires avcodec_free_frame()

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

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

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index f2002c0..4cdc572 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1405,8 +1405,11 @@ void CloseEncoder( vlc_object_t *p_this )
     encoder_t *p_enc = (encoder_t *)p_this;
     encoder_sys_t *p_sys = p_enc->p_sys;
 
-    /*FIXME: we should use avcodec_free_frame, but we don't require so new avcodec that has it*/
+#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0))
+    avcodec_free_frame( &p_sys->frame );
+#else
     av_freep( &p_sys->frame );
+#endif
 
     vlc_avcodec_lock();
     avcodec_close( p_sys->p_context );



More information about the vlc-commits mailing list