summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-28 16:57:16 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-28 16:57:16 +0000
commit4448190ef0c0c8029a3b3a41aab5b913ca0caa2b (patch)
treed2621678c01c716798caa313f4bba1e3086d006f /stream
parent95e86309811d6dadf66c3d60e4f18e5165e78ba2 (diff)
downloadmpv-4448190ef0c0c8029a3b3a41aab5b913ca0caa2b.tar.bz2
mpv-4448190ef0c0c8029a3b3a41aab5b913ca0caa2b.tar.xz
Fix cache process accidentally being killed by SIGUSR1.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31250 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/cache2.c7
1 files changed, 7 insertions, 0 deletions
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())){