diff options
author | Marton Balint <cus@passwd.hu> | 2015-08-08 21:07:44 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2015-08-09 23:57:51 +0200 |
commit | 0166d329c3e37fdee3a5aec9546d98afed343a49 (patch) | |
tree | 48f9c8eacd8078a968ed811be8d615e6b9f663ad /ffplay.c | |
parent | 7fbafd0b1bfb8bd1f318f68baa78667c82cc8c71 (diff) | |
download | ffmpeg-0166d329c3e37fdee3a5aec9546d98afed343a49.tar.gz |
ffplay: add specific constants for buffer fullness settings when using external clock
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -67,6 +67,8 @@ const int program_birth_year = 2003; #define MAX_QUEUE_SIZE (15 * 1024 * 1024) #define MIN_FRAMES 5 +#define EXTERNAL_CLOCK_MIN_FRAMES 2 +#define EXTERNAL_CLOCK_MAX_FRAMES 10 /* Minimum SDL audio buffer size, in samples. */ #define SDL_AUDIO_MIN_BUFFER_SIZE 512 @@ -1301,11 +1303,11 @@ static double get_master_clock(VideoState *is) } static void check_external_clock_speed(VideoState *is) { - if (is->video_stream >= 0 && is->videoq.nb_packets <= MIN_FRAMES / 2 || - is->audio_stream >= 0 && is->audioq.nb_packets <= MIN_FRAMES / 2) { + if (is->video_stream >= 0 && is->videoq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES || + is->audio_stream >= 0 && is->audioq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES) { set_clock_speed(&is->extclk, FFMAX(EXTERNAL_CLOCK_SPEED_MIN, is->extclk.speed - EXTERNAL_CLOCK_SPEED_STEP)); - } else if ((is->video_stream < 0 || is->videoq.nb_packets > MIN_FRAMES * 2) && - (is->audio_stream < 0 || is->audioq.nb_packets > MIN_FRAMES * 2)) { + } else if ((is->video_stream < 0 || is->videoq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES) && + (is->audio_stream < 0 || is->audioq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES)) { set_clock_speed(&is->extclk, FFMIN(EXTERNAL_CLOCK_SPEED_MAX, is->extclk.speed + EXTERNAL_CLOCK_SPEED_STEP)); } else { double speed = is->extclk.speed; |