hedgewars/avwrapper/avwrapper.c
changeset 11316 516e9b1ac889
parent 11300 f9fa0d6dc69f
child 11347 f830c080aa9d
equal deleted inserted replaced
11315:5b2f07e56b93 11316:516e9b1ac889
   300         g_pVideo->weighted_p_pred = 2;
   300         g_pVideo->weighted_p_pred = 2;
   301     }
   301     }
   302 #endif
   302 #endif
   303 
   303 
   304     // open the codec
   304     // open the codec
   305 #if LIBAVCODEC_VERSION_MAJOR >= 53
   305     if (avcodec_open2(g_pVideo, g_pVCodec, NULL) < 0)
   306     AVDictionary* pDict = NULL;
       
   307     if (strcmp(g_pVCodec->name, "libx264") == 0)
       
   308         av_dict_set(&pDict, "preset", "medium", 0);
       
   309 #endif
       
   310 
       
   311     if (avcodec_open2(g_pVideo, g_pVCodec, &pDict) < 0)
       
   312         return FatalError("Could not open video codec %s", g_pVCodec->long_name);
   306         return FatalError("Could not open video codec %s", g_pVCodec->long_name);
   313 
   307 
   314     g_pVFrame = av_frame_alloc();
   308     g_pVFrame = av_frame_alloc();
   315     if (!g_pVFrame)
   309     if (!g_pVFrame)
   316         return FatalError("Could not allocate frame");
   310         return FatalError("Could not allocate frame");