mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
encode: make the central lock recursive
Unfortunately, there's a recursive function call in ao_lavc.c (play function), leading to a deadlock. The locking is getting a bit messy, so just make the lock recursive. This fixes #844.
This commit is contained in:
parent
0b7facf05d
commit
231c667214
@ -30,6 +30,7 @@
|
||||
#include "options/m_option.h"
|
||||
#include "options/options.h"
|
||||
#include "osdep/timer.h"
|
||||
#include "osdep/threads.h"
|
||||
#include "video/out/vo.h"
|
||||
#include "talloc.h"
|
||||
#include "stream/stream.h"
|
||||
@ -174,7 +175,7 @@ struct encode_lavc_context *encode_lavc_init(struct encode_opts *options,
|
||||
mp_msg_force_stderr(global, true);
|
||||
|
||||
ctx = talloc_zero(NULL, struct encode_lavc_context);
|
||||
pthread_mutex_init(&ctx->lock, NULL);
|
||||
mpthread_mutex_init_recursive(&ctx->lock);
|
||||
ctx->log = mp_log_new(ctx, global->log, "encode-lavc");
|
||||
ctx->global = global;
|
||||
encode_lavc_discontinuity(ctx);
|
||||
|
Loading…
Reference in New Issue
Block a user