summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2012-06-02 21:40:12 +0200
committerMarton Balint <cus@passwd.hu>2012-06-02 21:56:08 +0200
commit22505c188ca96f123ebf10acc7e00130b5f5e079 (patch)
tree7388710e538d120daefc61e62f1cf42ed360415e /ffplay.c
parent0dad52920170f58f1c01c8dfd5ad851b467c6c5b (diff)
ffplay: calculate audio diff threshold based on the actual settings
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 700c89408c..3134c3a9d1 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2370,7 +2370,7 @@ static int stream_component_open(VideoState *is, int stream_index)
is->audio_diff_avg_count = 0;
/* since we do not have a precise anough audio fifo fullness,
we correct audio sync only if larger than this threshold */
- is->audio_diff_threshold = 2.0 * SDL_AUDIO_BUFFER_SIZE / avctx->sample_rate;
+ is->audio_diff_threshold = 2.0 * is->audio_hw_buf_size / av_samples_get_buffer_size(NULL, is->audio_tgt.channels, is->audio_tgt.freq, is->audio_tgt.fmt, 1);
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
memset(&is->audio_pkt_temp, 0, sizeof(is->audio_pkt_temp));