diff options
author | Johns <johns98@gmx.net> | 2013-02-07 16:54:16 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-02-07 16:54:16 +0100 |
commit | d4535a34c9afa899cc21eeba5cc0e6acedc7b1a9 (patch) | |
tree | 35ddf375c34bf04fa09c9c1c3609d5fc29fa346b /video.c | |
parent | ebd2f85f902d0c35c47dc37c27a336b881750129 (diff) | |
download | vdr-plugin-softhddevice-d4535a34c9afa899cc21eeba5cc0e6acedc7b1a9.tar.gz vdr-plugin-softhddevice-d4535a34c9afa899cc21eeba5cc0e6acedc7b1a9.tar.bz2 |
Fix xcb deadlock while closing PIP decoder.
Close video decoder from inside the decoder thread,
otherwise xcb hangs in a lock.
Diffstat (limited to 'video.c')
-rw-r--r-- | video.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -2237,7 +2237,6 @@ static void VaapiExit(void) int i; // FIXME: more VA-API cleanups... - // FIXME: can hang with vdpau in pthread_rwlock_wrlock for (i = 0; i < VaapiDecoderN; ++i) { if (VaapiDecoders[i]) { @@ -8484,6 +8483,7 @@ static void VdpauDisplayHandlerThread(void) } else { err = VideoPollInput(decoder->Stream); } + // decoder can be invalid here if (err) { // nothing buffered? if (err == -1 && decoder->Closing) { @@ -9589,9 +9589,15 @@ VideoHwDecoder *VideoNewHwDecoder(VideoStream * stream) void VideoDelHwDecoder(VideoHwDecoder * hw_decoder) { if (hw_decoder) { - VideoThreadLock(); +#ifdef DEBUG + if (!pthread_equal(pthread_self(), VideoThread)) { + Debug(3, "video: should only be called from inside the thread\n"); + } +#endif + // only called from inside the thread + //VideoThreadLock(); VideoUsedModule->DelHwDecoder(hw_decoder); - VideoThreadUnlock(); + //VideoThreadUnlock(); } } @@ -10806,7 +10812,7 @@ void VideoInit(const char *display_name) // FIXME: we need to retry connection return; } - XInitThreads(); + //XInitThreads(); // Register error handler XSetIOErrorHandler(VideoIOErrorHandler); |