[MPlayer-dev-eng] [PATCH] audio dropping
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Nov 6 18:52:23 CET 2006
Hello,
the attached patch implements audio dropping if audio is too far behind
video, e.g. when using -delay 10. This also (except for the large
startup delay) fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=609
Like this it would be enabled by default, heavy testing will be needed
to see if this is a good idea.
If there are no objections I will apply soon.
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c (revision 20725)
+++ mplayer.c (working copy)
@@ -312,6 +312,7 @@
float force_fps=0;
static int force_srate=0;
static int audio_output_format=0;
+ int audio_dropping=1;
int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode
static int play_n_frames=-1;
static int play_n_frames_mf=-1;
@@ -4093,6 +4096,9 @@
}
break;
}
+ if (audio_dropping && (playback_speed*audio_out->get_delay() - sh_audio->delay) > 1.0)
+ sh_audio->delay+=playback_speed*ret/(double)ao_data.bps;
+ else
sh_audio->a_out_buffer_len+=ret;
}
t=GetTimer()-t;
Index: cfg-mplayer.h
===================================================================
--- cfg-mplayer.h (revision 20725)
+++ cfg-mplayer.h (working copy)
@@ -305,6 +305,8 @@
{"framedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"hardframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 2, NULL},
{"noframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ {"audiodrop", &audio_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+ {"noaudiodrop", &audio_dropping, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
More information about the MPlayer-dev-eng
mailing list