# HG changeset patch # User Stepan777 # Date 1341667580 -14400 # Node ID 8bb4da06b065042d3227bc3edf8e765ec408c607 # Parent 1ae5cf294216dd2a929881ca9739ab15b0312cd3 Fix compilation of hwengine on ffmpeg 0.7.13. But frontend does not compiles. diff -r 1ae5cf294216 -r 8bb4da06b065 hedgewars/avwrapper.c --- a/hedgewars/avwrapper.c Sat Jul 07 16:21:42 2012 +0400 +++ b/hedgewars/avwrapper.c Sat Jul 07 17:26:20 2012 +0400 @@ -123,7 +123,11 @@ g_pAudio->flags |= CODEC_FLAG_GLOBAL_HEADER; // open it +#if LIBAVCODEC_VERSION_MAJOR >= 53 if (avcodec_open2(g_pAudio, g_pACodec, NULL) < 0) +#else + if (avcodec_open(g_pAudio, g_pACodec) < 0) +#endif { Log("Could not open audio codec %s\n", g_pACodec->long_name); return; @@ -232,16 +236,20 @@ g_pVideo->global_quality = g_VQuality*FF_QP2LAMBDA; } - AVDictionary* pDict = NULL; - if (strcmp(g_pVCodec->name, "libx264") == 0) - av_dict_set(&pDict, "preset", g_pPreset, 0); - // some formats want stream headers to be separate if (g_pFormat->flags & AVFMT_GLOBALHEADER) g_pVideo->flags |= CODEC_FLAG_GLOBAL_HEADER; // open the codec +#if LIBAVCODEC_VERSION_MAJOR >= 53 + AVDictionary* pDict = NULL; + if (strcmp(g_pVCodec->name, "libx264") == 0) + av_dict_set(&pDict, "preset", g_pPreset, 0); + if (avcodec_open2(g_pVideo, g_pVCodec, &pDict) < 0) +#else + if (avcodec_open(g_pVideo, g_pVCodec) < 0) +#endif FatalError("Could not open video codec %s", g_pVCodec->long_name); g_pVFrame = avcodec_alloc_frame();