From 4448190ef0c0c8029a3b3a41aab5b913ca0caa2b Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 28 May 2010 16:57:16 +0000 Subject: Fix cache process accidentally being killed by SIGUSR1. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31250 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/cache2.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'stream') diff --git a/stream/cache2.c b/stream/cache2.c index e534f381c7..e13f3e75f3 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -351,6 +351,9 @@ static void dummy_sighandler(int x) { */ static void cache_mainloop(cache_vars_t *s) { int sleep_count = 0; +#if FORKED_CACHE + signal(SIGUSR1, SIG_IGN); +#endif do { if (!cache_fill(s)) { #if FORKED_CACHE @@ -401,6 +404,10 @@ int stream_enable_cache(stream_t *stream,int size,int min,int seek_limit){ if (min > s->buffer_size - s->fill_limit) { min = s->buffer_size - s->fill_limit; } + // to make sure we wait for the cache process/thread to be active + // before continuing + if (min <= 0) + min = 1; #if FORKED_CACHE if((stream->cache_pid=fork())){ -- cgit v1.2.3