summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-15 15:09:41 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-16 01:22:05 +0300
commit3d88e6f4c2da4c64e0daf658da2c97dff8c3963f (patch)
treebf00a4e64e7d292caeb8e1136002915ed4cdcf76 /demux/demux_lavf.c
parentf9bcb5c42c9a3adb54179ef154300734911ea2b5 (diff)
downloadmpv-3d88e6f4c2da4c64e0daf658da2c97dff8c3963f.tar.bz2
mpv-3d88e6f4c2da4c64e0daf658da2c97dff8c3963f.tar.xz
client API: fix potential sporadic freezes on termination
Although this was never observed to be happening, it seems definitely possible: we first tell the main thread to exit, and then we ask the main thread to do some work for us (with mp_dispatch_run()). Obviously this is racy, and the main thread could exit without doing this, which would block mp_dispatch_run() forever. Fix this by changing the order of operation, so that it makes sense. We could also just store the pthread_t of the main thread in some variable, but the fact that pthread_create() might set the pthread_t argument _after_ starting the thread makes this a bit messy (at least it doesn't seem to be guaranteed on a superficial look at the manpage).
Diffstat (limited to 'demux/demux_lavf.c')
0 files changed, 0 insertions, 0 deletions