RTP: disable preemption during queueing
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 14 Oct 2009 16:37:16 +0000 (19:37 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 14 Oct 2009 16:38:00 +0000 (19:38 +0300)
This should fix a rare crash:
LibVLC fatal error destroying mutex (16) in thread 17390 at ../../src/misc/pthread.c:188 in vlc_mutex_destroy
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4[0xb7fff933]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4[0xb7fff9c8]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4(vlc_mutex_destroy+0x3f)[0xb7fffa39]
/home/remi/videolan/vlc/build/modules/access/rtp/.libs/librtp_plugin.so[0xb5563a41]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4(__module_unneed+0x29)[0xb7fe414f]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4[0xb7f9984e]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4[0xb7fa69fb]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4[0xb7fa6c0c]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4[0xb7faeef2]
/home/remi/videolan/vlc/build/src/.libs/libvlccore.so.4[0xb7feb16e]
/lib/i686/cmov/libpthread.so.0[0xb7f324b5]
/lib/i686/cmov/libc.so.6(clone+0x5e)[0xb7eaea5e]

modules/access/rtp/input.c

index 1ee0a73..6a14b69 100644 (file)
@@ -198,9 +198,11 @@ void *rtp_thread (void *data)
             autodetect = false;
         }
 
+        int canc = vlc_savecancel ();
         vlc_mutex_lock (&p_sys->lock);
         rtp_queue (demux, p_sys->session, block);
         vlc_mutex_unlock (&p_sys->lock);
+        vlc_restorecancel (canc);
 
         rtp_process (demux);
     }