summaryrefslogtreecommitdiffstats
path: root/player/lua.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-05 18:01:40 +0100
committerwm4 <wm4@nowhere>2014-03-11 00:19:56 +0100
commit72c70eb05b5e5907b3f444989cda63578b883ecd (patch)
tree659a098f017fa9f900a1f233d4fc6381d2a20a9b /player/lua.c
parentdf0ec554997e9c08860f8cfba8e183278363ff43 (diff)
downloadmpv-72c70eb05b5e5907b3f444989cda63578b883ecd.tar.bz2
mpv-72c70eb05b5e5907b3f444989cda63578b883ecd.tar.xz
ao_jack: fix termination on the end of file
The player didn't quit when the end of a file was reached. The reason for this is that jack reported a constant audio delay even when all audio was done playing. Whether that was recognized as EOF by the player depended whether the exact value was higher or lower than the player's threshhold for what it considers no more audio. get_delay() should return amount of time it takes until the last sample written to the audio buffer reaches the speaker. Therefore, we have to track the estimated time when the last sample is done, and subtract it from the calculated latency. Basically, the latency is the only amount of time left in the delay, and it should go towards 0 as audio reaches ths speakers. I'm not sure if this is correct, but at least it solves the problem. One suspicious thing is that we use system time to estimate the end of the audio time. Maybe using jack_frame_time() would be more correct. But apart from this, there doesn't seem to be a better way to handle this.
Diffstat (limited to 'player/lua.c')
0 files changed, 0 insertions, 0 deletions