[MPlayer-cvslog] r31250 - trunk/stream/cache2.c

reimar subversion at mplayerhq.hu
Fri May 28 18:57:16 CEST 2010


Author: reimar
Date: Fri May 28 18:57:16 2010
New Revision: 31250

Log:
Fix cache process accidentally being killed by SIGUSR1.

Modified:
   trunk/stream/cache2.c

Modified: trunk/stream/cache2.c
==============================================================================
--- trunk/stream/cache2.c	Fri May 28 13:52:12 2010	(r31249)
+++ trunk/stream/cache2.c	Fri May 28 18:57:16 2010	(r31250)
@@ -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
   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())){


More information about the MPlayer-cvslog mailing list