[vlc-commits] Avparser: fix compilation with some older libav/FFmpeg versions

Jean-Baptiste Kempf git at videolan.org
Sun Mar 1 18:38:14 CET 2015


vlc/vlc-2.2 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Mar  1 18:30:10 2015 +0100| [e7bb1508373b22cd88e1ae0c0c5a9a548f1dfbb8] | committer: Jean-Baptiste Kempf

Avparser: fix compilation with some older libav/FFmpeg versions

Ref #12135

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

 modules/packetizer/avparser.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/modules/packetizer/avparser.c b/modules/packetizer/avparser.c
index c5d2891..fdc4573 100644
--- a/modules/packetizer/avparser.c
+++ b/modules/packetizer/avparser.c
@@ -38,6 +38,20 @@
 #include "../codec/avcodec/avcommon.h"
 
 #include "avparser.h"
+
+#if !LIBAVCODEC_VERSION_CHECK( 55, 52, 0, 63, 100 )
+#include <libavutil/mem.h>
+static inline void avcodec_free_context( AVCodecContext **ctx )
+{
+    if( !*ctx )
+        return;
+
+    av_free( (*ctx)->extradata );
+    av_free( *ctx );
+    *ctx = NULL;
+}
+#endif
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/



More information about the vlc-commits mailing list