Somewhat hackish fix for A-V desync with ao_oss and frame stepping:

send 0-samples according to the amount of data lost during pause.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23829 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-07-19 19:15:59 +00:00
parent daa6cb6cab
commit 7be3e8694b
1 changed files with 9 additions and 0 deletions

View File

@ -147,6 +147,7 @@ static int oss2format(int format)
static char *dsp=PATH_DEV_DSP;
static audio_buf_info zz;
static int audio_fd=-1;
static int prepause_space;
static const char *oss_mixer_device = PATH_DEV_MIXER;
static int oss_mixer_channel = SOUND_MIXER_PCM;
@ -448,13 +449,21 @@ static void reset(void){
// stop playing, keep buffers (for pause)
static void audio_pause(void)
{
prepause_space = get_space();
uninit(1);
}
// resume playing, after audio_pause()
static void audio_resume(void)
{
int fillcnt;
reset();
fillcnt = get_space() - prepause_space;
if (fillcnt > 0) {
void *silence = calloc(fillcnt, 1);
play(silence, fillcnt, 0);
free(silence);
}
}