summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-19 18:41:13 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:35 +0200
commitdbcd654e612ca32673cf2703758b05700cb87d03 (patch)
tree838cf589df1519e50afdcd1c73a73217772d793d /input/input.c
parent8816e1117ee65039dbb5700219ba3537d3e5290e (diff)
downloadmpv-dbcd654e612ca32673cf2703758b05700cb87d03.tar.bz2
mpv-dbcd654e612ca32673cf2703758b05700cb87d03.tar.xz
player: make playback termination asynchronous
Until now, stopping playback aborted the demuxer and I/O layer violently by signaling mp_cancel (bound to libavformat's AVIOInterruptCB mechanism). Change it to try closing them gracefully. The main purpose is to silence those libavformat errors that happen when you request termination. Most of libavformat barely cares about the termination mechanism (AVIOInterruptCB), and essentially it's like the network connection is abruptly severed, or file I/O suddenly returns I/O errors. There were issues with dumb TLS warnings, parsers complaining about incomplete data, and some special protocols that require server communication to gracefully disconnect. We still want to abort it forcefully if it refuses to terminate on its own, so a timeout is required. Users can set the timeout to 0, which should give them the old behavior. This also removes the old mechanism that treats certain commands (like "quit") specially, and tries to terminate the demuxers even if the core is currently frozen. This is for situations where the core synchronized to the demuxer or stream layer while network is unresponsive. This in turn can only happen due to the "program" or "cache-size" properties in the current code (see one of the previous commits). Also, the old mechanism doesn't fit particularly well with the new one. We wouldn't want to abort playback immediately on a "quit" command - the new code is all about giving it a chance to end it gracefully. We'd need some sort of watchdog thread or something equally complicated to handle this. So just remove it. The change in osd.c is to prevent that it clears the status line while waiting for termination. The normal status line code doesn't output anything useful at this point, and the code path taken clears it, both of which is an annoying behavior change, so just let it show the old one.
Diffstat (limited to 'input/input.c')
0 files changed, 0 insertions, 0 deletions