diff options
author | Marton Balint <cus@passwd.hu> | 2012-03-15 00:41:57 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2012-03-19 22:54:40 +0100 |
commit | ee4b14322155b5808eeceb463f5edcd751eb3a98 (patch) | |
tree | b8b0f517c453533982e110374cb202d44be91c17 | |
parent | a2c5be631962a8d0dd59b12fa58292d8c042236c (diff) | |
download | ffmpeg-ee4b14322155b5808eeceb463f5edcd751eb3a98.tar.gz |
ffplay: use frame count based queueing for audio queue
This reduces the number of queued frames for audio data but also reduces the
amount of A-V difference after changing the audio stream (because less frames
are queued). Fixes bug #1035.
Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r-- | ffplay.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -64,7 +64,6 @@ const char program_name[] = "ffplay"; const int program_birth_year = 2003; #define MAX_QUEUE_SIZE (15 * 1024 * 1024) -#define MIN_AUDIOQ_SIZE (20 * 16 * 1024) #define MIN_FRAMES 5 /* SDL audio buffer size, in samples. Should be small to have precise @@ -2612,7 +2611,7 @@ static int read_thread(void *arg) /* if the queue are full, no need to read more */ if ( is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE - || ( (is->audioq .size > MIN_AUDIOQ_SIZE || is->audio_stream < 0) + || ( (is->audioq .nb_packets > MIN_FRAMES || is->audio_stream < 0) && (is->videoq .nb_packets > MIN_FRAMES || is->video_stream < 0) && (is->subtitleq.nb_packets > MIN_FRAMES || is->subtitle_stream < 0))) { /* wait 10 ms */ |