# HG changeset patch # User Vittorio Giovara # Date 1447159994 -3600 # Node ID ba7e67586fcd510eec824f566812394b6616987f # Parent 9a17a39eccdc51aefa153aababcd9b1bd99875d0 videorec: Always initialize audio and video time bases In both context and stream. diff -r 9a17a39eccdc -r ba7e67586fcd 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;