summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-26 17:56:11 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-26 17:56:11 +0000
commit328306708f6687e9cf43a32930b252bc18ba851f (patch)
tree03ca3a11bd7e8ef975ca8fa69ca50ac25471803e /stream
parentd304c1d56c5ffc242a0ffefcc2a1c9fedb12f56c (diff)
downloadmpv-328306708f6687e9cf43a32930b252bc18ba851f.tar.bz2
mpv-328306708f6687e9cf43a32930b252bc18ba851f.tar.xz
Re-enable wakeup-on-signal for cache process.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31224 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/cache2.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/stream/cache2.c b/stream/cache2.c
index fef316f627..e936e47dca 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -102,10 +102,7 @@ static void cache_wakeup(stream_t *s)
{
#if FORKED_CACHE
// signal process to wake up immediately
- // Disabled for now since it causes incorrect EOFs
- // due to interrupting read syscalls - this should be
- // fixed instead though
-// kill(s->cache_pid, SIGUSR1);
+ kill(s->cache_pid, SIGUSR1);
#endif
}
@@ -356,11 +353,20 @@ static void cache_mainloop(cache_vars_t *s) {
int sleep_count = 0;
do {
if (!cache_fill(s)) {
+#if FORKED_CACHE
+ // Let signal wake us up, we cannot leave this
+ // enabled since we do not handle EINTR in most places.
+ // This might need extra code to work on BSD.
+ signal(SIGUSR1, dummy_sighandler);
+#endif
if (sleep_count < INITIAL_FILL_USLEEP_COUNT) {
sleep_count++;
usec_sleep(INITIAL_FILL_USLEEP_TIME);
} else
usec_sleep(FILL_USLEEP_TIME); // idle
+#if FORKED_CACHE
+ signal(SIGUSR1, SIG_IGN);
+#endif
} else
sleep_count = 0;
// cache_stats(s->cache_data);
@@ -449,7 +455,6 @@ err_out:
use_gui = 0; // mp_msg may not use gui stuff in forked code
#endif
signal(SIGTERM,exit_sighandler); // kill
- signal(SIGUSR1, dummy_sighandler); // wakeup
cache_mainloop(s);
// make sure forked code never leaves this function
exit(0);