summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-06 12:59:04 +0200
committerwm4 <wm4@nowhere>2014-09-06 12:59:04 +0200
commit39609fc19acb8ebe04e476ca7ad964c3f15903e7 (patch)
tree4ccede07615ad547ac2d09342fb28811885df7a1 /player
parent769ac6fb7bb39cb04933e1dede32cdbec4f74098 (diff)
downloadmpv-39609fc19acb8ebe04e476ca7ad964c3f15903e7.tar.bz2
mpv-39609fc19acb8ebe04e476ca7ad964c3f15903e7.tar.xz
audio/out/push: redo audio waiting
Improve the logic how the audio thread decides how to wait until the AO is ready for new data. The previous commit makes some of this easier, although it turned out that it wasn't required, and we still can handle AOs with bad get_space implementation (although the new code prints an error message, and it might fail in obscure situations). The new code is pretty similar to the old one, and the main thing that changes is that complicated conditions are tweaked. AO waiting is now used better (mainly instead of max>0, r>0 is used). Whether to wakeup is reevaluated every time, instead of somehow doing the wrong thing and compensating for it with a flag. This fixes the specific situation when the device buffer is full, and we don't want to buffer more data. In the old code, this wasn't handled correctly: the AO went to sleep forever, because it prevented proper wakeup by the AO driver, and as consequence never asked the core for new data. Commit 4fa3ffeb was a hack-fix against this, and now that we have a proper solution, this hack is removed as well. Also make the refill threshold consistent and always use 1/4 of the buffer. (The threshold is used for situations when an AO doesn't support proper waiting or chunked processing.) This commit will probably cause a bunch of regressions again.
Diffstat (limited to 'player')
0 files changed, 0 insertions, 0 deletions