diff options
author | wiz <wiz> | 2014-09-16 21:44:52 +0000 |
---|---|---|
committer | wiz <wiz> | 2014-09-16 21:44:52 +0000 |
commit | 3935cdf066a72a01257871ef9f10cce398edadea (patch) | |
tree | 70d8d01ccbe41ce7b457e01bb9248bed1c5efc75 /multimedia/mpv/patches | |
parent | 344ac27486af12609c377d433aca22c81a5539f1 (diff) | |
download | pkgsrc-3935cdf066a72a01257871ef9f10cce398edadea.tar.gz |
Improve audio pause/playback patch; from Nat Sloss <nat@> again.
Bump PKGREVISION.
Diffstat (limited to 'multimedia/mpv/patches')
-rw-r--r-- | multimedia/mpv/patches/patch-audio_out_ao__oss.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/multimedia/mpv/patches/patch-audio_out_ao__oss.c b/multimedia/mpv/patches/patch-audio_out_ao__oss.c index f6e877ba50e..05abb287168 100644 --- a/multimedia/mpv/patches/patch-audio_out_ao__oss.c +++ b/multimedia/mpv/patches/patch-audio_out_ao__oss.c @@ -1,4 +1,4 @@ -$NetBSD: patch-audio_out_ao__oss.c,v 1.1 2014/09/15 17:31:18 wiz Exp $ +$NetBSD: patch-audio_out_ao__oss.c,v 1.2 2014/09/16 21:44:52 wiz Exp $ https://github.com/mpv-player/mpv/issues/1080 @@ -46,27 +46,19 @@ https://github.com/mpv-player/mpv/issues/1080 ioctl(p->audio_fd, SNDCTL_DSP_RESET, NULL); #else close_device(ao); -@@ -548,11 +555,18 @@ static int play(struct ao *ao, void **da - int len = samples * ao->sstride; - if (len == 0) - return len; -+ - if (len > p->outburst || !(flags & AOPLAY_FINAL_CHUNK)) { +@@ -552,7 +559,10 @@ static int play(struct ao *ao, void **da len /= p->outburst; len *= p->outburst; } - len = write(p->audio_fd, data[0], len); + -+ if (p->audio_fd < 0) { -+ usleep((1000000 * samples) / (ao->bps + 1)); -+ return samples; -+ } else ++ if (p->audio_fd >= 0) + len = write(p->audio_fd, data[0], len); + return len / ao->sstride; } -@@ -560,9 +574,12 @@ static int play(struct ao *ao, void **da +@@ -560,9 +570,15 @@ static int play(struct ao *ao, void **da static void audio_resume(struct ao *ao) { struct priv *p = ao->priv; @@ -74,19 +66,22 @@ https://github.com/mpv-player/mpv/issues/1080 +#if !defined (SNDCTL_DSP_RESET) || defined(__NetBSD__) reset(ao); #endif -+ if (p->audio_fd < 0) ++ if (p->audio_fd < 0) { ++ ao->untimed = true; + return; ++ } else ++ ao->untimed=false; + int fillframes = get_space(ao) - p->prepause_space / ao->sstride; if (fillframes > 0) ao_play_silence(ao, fillframes); -@@ -572,6 +589,10 @@ static void audio_resume(struct ao *ao) +@@ -572,6 +588,10 @@ static void audio_resume(struct ao *ao) static float get_delay(struct ao *ao) { struct priv *p = ao->priv; + + if (p->audio_fd < 0) -+ return 1.0; ++ return 0.0250; + /* Calculate how many bytes/second is sent out */ if (p->audio_delay_method == 2) { |