pub const MAX_QUEUE_SIZE: usize = (15 * 1024 * 1024);
pub const MIN_FRAMES : usize = 25;
pub const EXTERNAL_CLOCK_MIN_FRAMES : usize = 2;
pub const EXTERNAL_CLOCK_MAX_FRAMES: usize = 10;

/* Minimum SDL audio buffer size, in samples. */
pub const SDL_AUDIO_MIN_BUFFER_SIZE : usize = 512;
/* Calculate actual buffer size keeping in mind not cause too frequent audio callbacks */
pub const SDL_AUDIO_MAX_CALLBACKS_PER_SEC: usize = 30;

/* Step size for volume control in dB */
pub const SDL_VOLUME_STEP : f32 = (0.75);

/* no AV sync correction is done if below the minimum AV sync threshold */
pub const AV_SYNC_THRESHOLD_MIN : f32 = 0.04;
/* AV sync correction is done if above the maximum AV sync threshold */
pub const AV_SYNC_THRESHOLD_MAX : f32 = 0.1;
/* If a frame duration is longer than this, it will not be duplicated to compensate AV sync */
pub const AV_SYNC_FRAMEDUP_THRESHOLD : f32 =0.1;
/* no AV correction is done if too big error */
pub const AV_NOSYNC_THRESHOLD : f32 = 10.0;

/* maximum audio speed change to get correct sync */
pub const SAMPLE_CORRECTION_PERCENT_MAX : usize = 10;

/* external clock speed adjustment constants for realtime sources based on buffer fullness */
pub const EXTERNAL_CLOCK_SPEED_MIN  : f32 = 0.900;
pub const EXTERNAL_CLOCK_SPEED_MAX  : f32 = 1.010;
pub const EXTERNAL_CLOCK_SPEED_STEP : f32 = 0.001;

/* we use about AUDIO_DIFF_AVG_NB A-V differences to make the average */
pub const AUDIO_DIFF_AVG_NB : usize = 20;

/* polls for possible required screen refresh at least this often, should be less than 1/fps */
pub const REFRESH_RATE : f32 = 0.01;

/* NOTE: the size must be big enough to compensate the hardware audio buffersize size */
/* TODO: We assume that a decoded and resampled frame fits into this buffer */
pub const SAMPLE_ARRAY_SIZE : usize = (8 * 65536);

pub const CURSOR_HIDE_DELAY : usize = 1000000;

pub const USE_ONEPASS_SUBTITLE_RENDER : bool = true;

pub const VIDEO_PICTURE_QUEUE_SIZE : usize = 3;
pub const SUBPICTURE_QUEUE_SIZE : usize  = 16;
pub const SAMPLE_QUEUE_SIZE : usize =  9;
// FIXME  const FRAME_QUEUE_SIZE ffmax(SAMPLE_QUEUE_SIZE, ffmax(VIDEO_PICTURE_QUEUE_SIZE, SUBPICTURE_QUEUE_SIZE))
pub const FRAME_QUEUE_SIZE : usize = ffmax!(SAMPLE_QUEUE_SIZE, (ffmax!(VIDEO_PICTURE_QUEUE_SIZE, SUBPICTURE_QUEUE_SIZE)));