mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
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:
parent
daa6cb6cab
commit
7be3e8694b
@ -147,6 +147,7 @@ static int oss2format(int format)
|
|||||||
static char *dsp=PATH_DEV_DSP;
|
static char *dsp=PATH_DEV_DSP;
|
||||||
static audio_buf_info zz;
|
static audio_buf_info zz;
|
||||||
static int audio_fd=-1;
|
static int audio_fd=-1;
|
||||||
|
static int prepause_space;
|
||||||
|
|
||||||
static const char *oss_mixer_device = PATH_DEV_MIXER;
|
static const char *oss_mixer_device = PATH_DEV_MIXER;
|
||||||
static int oss_mixer_channel = SOUND_MIXER_PCM;
|
static int oss_mixer_channel = SOUND_MIXER_PCM;
|
||||||
@ -448,13 +449,21 @@ static void reset(void){
|
|||||||
// stop playing, keep buffers (for pause)
|
// stop playing, keep buffers (for pause)
|
||||||
static void audio_pause(void)
|
static void audio_pause(void)
|
||||||
{
|
{
|
||||||
|
prepause_space = get_space();
|
||||||
uninit(1);
|
uninit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// resume playing, after audio_pause()
|
// resume playing, after audio_pause()
|
||||||
static void audio_resume(void)
|
static void audio_resume(void)
|
||||||
{
|
{
|
||||||
|
int fillcnt;
|
||||||
reset();
|
reset();
|
||||||
|
fillcnt = get_space() - prepause_space;
|
||||||
|
if (fillcnt > 0) {
|
||||||
|
void *silence = calloc(fillcnt, 1);
|
||||||
|
play(silence, fillcnt, 0);
|
||||||
|
free(silence);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user