summaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-02-07 16:54:16 +0100
committerJohns <johns98@gmx.net>2013-02-07 16:54:16 +0100
commitd4535a34c9afa899cc21eeba5cc0e6acedc7b1a9 (patch)
tree35ddf375c34bf04fa09c9c1c3609d5fc29fa346b /video.c
parentebd2f85f902d0c35c47dc37c27a336b881750129 (diff)
downloadvdr-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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/video.c b/video.c
index 5370807..839c517 100644
--- a/video.c
+++ b/video.c
@@ -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);