# HG changeset patch # User Vittorio Giovara # Date 1447159994 -3600 # Node ID 846aa36f7cdc7efb3ecc3fbf1f47c366e44cadb3 # Parent dc17a495ee7f8b40a74d2fdf3dce11f4a4bdbb59 videorec: Always initialize audio and video time bases In both context and stream. diff -r dc17a495ee7f -r 846aa36f7cdc hedgewars/avwrapper/avwrapper.c --- a/hedgewars/avwrapper/avwrapper.c Tue Nov 10 13:53:13 2015 +0100 +++ b/hedgewars/avwrapper/avwrapper.c Tue Nov 10 13:53:14 2015 +0100 @@ -149,6 +149,10 @@ g_pAudio->sample_rate = g_Frequency; g_pAudio->channels = g_Channels; + // set time base as invers of sample rate + g_pAudio->time_base.den = g_pAStream->time_base.den = g_Frequency; + g_pAudio->time_base.num = g_pAStream->time_base.num = 1; + // set quality g_pAudio->bit_rate = 160000; @@ -254,8 +258,8 @@ of which frame timestamps are represented. for fixed-fps content, timebase should be 1/framerate and timestamp increments should be identically 1. */ - g_pVideo->time_base.den = g_Framerate.num; - g_pVideo->time_base.num = g_Framerate.den; + g_pVideo->time_base.den = g_pVStream->time_base.den = g_Framerate.num; + g_pVideo->time_base.num = g_pVStream->time_base.num = g_Framerate.den; //g_pVideo->gop_size = 12; /* emit one intra frame every twelve frames at most */ g_pVideo->pix_fmt = AV_PIX_FMT_YUV420P;