mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-31 01:33:44 -04:00
[player] Add config option high_resolution_clock
This commit is contained in:
parent
c2b1706855
commit
81a93bbec1
@ -37,6 +37,11 @@ general {
|
|||||||
# When starting playback, autoselect speaker (if none of the previously
|
# When starting playback, autoselect speaker (if none of the previously
|
||||||
# selected speakers/outputs are available)
|
# selected speakers/outputs are available)
|
||||||
# speaker_autoselect = yes
|
# speaker_autoselect = yes
|
||||||
|
|
||||||
|
# Most modern systems have a high-resolution clock, but if you are on an
|
||||||
|
# unusual platform and experience audio drop-outs, you can try changing
|
||||||
|
# this option
|
||||||
|
# high_resolution_clock = yes
|
||||||
}
|
}
|
||||||
|
|
||||||
# Library configuration
|
# Library configuration
|
||||||
|
@ -56,6 +56,11 @@ static cfg_opt_t sec_general[] =
|
|||||||
CFG_STR("cache_path", STATEDIR "/cache/" PACKAGE "/cache.db", CFGF_NONE),
|
CFG_STR("cache_path", STATEDIR "/cache/" PACKAGE "/cache.db", CFGF_NONE),
|
||||||
CFG_INT("cache_daap_threshold", 1000, CFGF_NONE),
|
CFG_INT("cache_daap_threshold", 1000, CFGF_NONE),
|
||||||
CFG_BOOL("speaker_autoselect", cfg_true, CFGF_NONE),
|
CFG_BOOL("speaker_autoselect", cfg_true, CFGF_NONE),
|
||||||
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
CFG_BOOL("high_resolution_clock", cfg_false, CFGF_NONE),
|
||||||
|
#else
|
||||||
|
CFG_BOOL("high_resolution_clock", cfg_true, CFGF_NONE),
|
||||||
|
#endif
|
||||||
CFG_STR("allow_origin", "*", CFGF_NONE),
|
CFG_STR("allow_origin", "*", CFGF_NONE),
|
||||||
CFG_END()
|
CFG_END()
|
||||||
};
|
};
|
||||||
|
13
src/player.c
13
src/player.c
@ -3173,13 +3173,12 @@ player_init(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
if (!cfg_getbool(cfg_getsec(cfg, "general"), "high_resolution_clock"))
|
||||||
/* FreeBSD will report a resolution of 1, but actually has a resolution
|
{
|
||||||
* larger than an audio packet
|
DPRINTF(E_INFO, L_PLAYER, "High resolution clock not enabled on this system (res is %ld)\n", timer_res.tv_nsec);
|
||||||
*/
|
|
||||||
if (timer_res.tv_nsec == 1)
|
timer_res.tv_nsec = 2 * AIRTUNES_V2_STREAM_PERIOD;
|
||||||
timer_res.tv_nsec = 2 * AIRTUNES_V2_STREAM_PERIOD;
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set the tick interval for the playback timer
|
// Set the tick interval for the playback timer
|
||||||
interval = MAX(timer_res.tv_nsec, AIRTUNES_V2_STREAM_PERIOD);
|
interval = MAX(timer_res.tv_nsec, AIRTUNES_V2_STREAM_PERIOD);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user