Control: tags -1 + patch

On 2013-08-24 13:14:51, Dominic Hargreaves wrote:
> Source: linphone
> Version: 3.6.1-2
> Severity: serious
> Justification: FTBFS
> Tags: sid jessie
> 
> This package FTBFS in a clean sid chroot:
> 
> make[5]: Entering directory 
> `/build/dom-linphone_3.6.1-2-i386-bnH7wt/linphone-3.6.1/mediastreamer2/tools'
>   CC       mediastream.o
>   CCLD     mediastream
> ../src/.libs/libmediastreamer_voip.so: undefined reference to 
> `avcodec_get_context_defaults'
> ../src/.libs/libmediastreamer_voip.so: undefined reference to `avcodec_open'
> ../src/.libs/libmediastreamer_voip.so: undefined reference to 
> `avcodec_alloc_context'
> collect2: error: ld returned 1 exit status
> make[5]: *** [mediastream] Error 1

The attached patch fixes this issue.

Regards
-- 
Sebastian Ramacher
--- a/mediastreamer2/src/utils/ffmpeg-priv.c
+++ b/mediastreamer2/src/utils/ffmpeg-priv.c
@@ -20,20 +20,14 @@
 
 #include "ffmpeg-priv.h"
 
-#ifdef FF_API_ALLOC_CONTEXT
-#if !FF_API_ALLOC_CONTEXT
+#if LIBAVCODEC_VERSION_MAJOR >= 54
 AVCodecContext *avcodec_alloc_context(void) {
 	return avcodec_alloc_context3(NULL);
 }
 void avcodec_get_context_defaults(AVCodecContext *s) {
 	avcodec_get_context_defaults3(s, NULL);
 }
-#endif
-#endif
-#ifdef FF_API_AVCODEC_OPEN
-#if !FF_API_AVCODEC_OPEN
 int avcodec_open(AVCodecContext *avctx, AVCodec *codec) {
 	return avcodec_open2(avctx, codec, NULL);
 }
 #endif
-#endif
--- a/mediastreamer2/src/utils/ffmpeg-priv.h
+++ b/mediastreamer2/src/utils/ffmpeg-priv.h
@@ -75,15 +75,9 @@
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0)
 #define CodecID AVCodecID
 #endif
-#ifdef FF_API_ALLOC_CONTEXT
-#if !FF_API_ALLOC_CONTEXT
+#if LIBAVCODEC_VERSION_MAJOR >= 54
 AVCodecContext *avcodec_alloc_context(void); 
 void avcodec_get_context_defaults(AVCodecContext *s);
-#endif
-#endif
-#ifdef FF_API_AVCODEC_OPEN
-#if !FF_API_AVCODEC_OPEN
 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
 #endif
-#endif
 #endif /* FFMPEG_PRIV_H */

Attachment: signature.asc
Description: Digital signature

Reply via email to