1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00
mpv/mpvcore
wm4 8125252399 audio: don't let ao_lavc access frontend internals, change gapless audio
ao_lavc.c accesses ao->buffer, which I consider internal. The access was
done in ao_lavc.c/uninit(), which tried to get the left-over audio in
order to write the last (possibly partial) audio frame. The play()
function didn't accept partial frames, because the AOPLAY_FINAL_CHUNK
flag was not correctly set, and handling it otherwise would require an
internal FIFO.

Fix this by making sure that with gapless audio (used with encoding),
the AOPLAY_FINAL_CHUNK is set only once, instead when each file ends.
Basically, move the hack in ao_lavc's uninit to uninit_player.

One thing can not be entirely correctly handled: if gapless audio is
active, we don't know really whether the AO is closed because the file
ended playing (i.e. we want to send the buffered remainder of the audio
to the AO), or whether the user is quitting the player. (The stop_play
flag is overwritten, fixing that is perhaps not worth it.) Handle this
by adding additional code to drain the AO and the buffers when playback
is quit (see play_current_file() change).

Test case: mpv avdevice://lavfi:sine=441 avdevice://lavfi:sine=441 -length 0.2267  -gapless-audio
2013-11-08 20:00:58 +01:00
..
input input: remove unused key_down_event command 2013-11-06 00:08:38 +01:00
player audio: don't let ao_lavc access frontend internals, change gapless audio 2013-11-08 20:00:58 +01:00
asxparser.c core: add a playlist demuxer 2013-08-26 10:09:45 +02:00
asxparser.h
av_common.c
av_common.h
av_log.c configure: uniform the defines to #define HAVE_xxx (0|1) 2013-11-03 21:59:54 +01:00
av_log.h mplayer: print ffmpeg library versions along with mpv version info 2013-10-14 20:14:17 +02:00
av_opts.c
av_opts.h
bstr.c bstr: make UTF-8 check stricter 2013-08-15 23:40:03 +02:00
bstr.h bstr: add UTF-8 validation and sanitation functions 2013-08-15 23:40:02 +02:00
charset_conv.c configure: uniform the defines to #define HAVE_xxx (0|1) 2013-11-03 21:59:54 +01:00
charset_conv.h sub: don't print detected charset if it's UTF-8 2013-08-15 23:40:04 +02:00
codecs.c
codecs.h
cpudetect.c
cpudetect.h
encode_lavc.c Split mplayer.c 2013-10-30 01:53:53 +01:00
encode_lavc.h
encode.h Split mplayer.c 2013-10-30 01:53:53 +01:00
m_config.c Fix some more -Wshadow warnings 2013-11-01 17:35:38 +01:00
m_config.h Fix some more -Wshadow warnings 2013-11-01 17:35:38 +01:00
m_option.c command: add generic "multiply" command 2013-10-31 23:30:14 +01:00
m_option.h command: add generic "multiply" command 2013-10-31 23:30:14 +01:00
m_property.c command: when changing a property, allow showing an extra OSD message 2013-09-21 00:07:42 +02:00
m_property.h command: when changing a property, allow showing an extra OSD message 2013-09-21 00:07:42 +02:00
mp_common.c mp_common: add function which accepts a format string to format playback time 2013-09-15 02:51:17 +02:00
mp_common.h af: replace macros with too generic names 2013-10-26 15:05:59 +02:00
mp_memory_barrier.h
mp_msg.c mp_msg: remove gettext() support 2013-10-18 22:38:10 +02:00
mp_msg.h mp_msg: remove gettext() support 2013-10-18 22:38:10 +02:00
mp_ring.c mp_ring: fix mp_ring_read_cb() when read wraps around 2013-10-08 20:03:57 +02:00
mp_ring.h
mp_talloc.h mp_talloc: simplify a bit 2013-10-19 21:43:08 +02:00
mpv_global.h
options.c sd_lavc, sd_spu: make dvdsub stretching conditional on --stretch-dvd-subs. 2013-11-07 12:56:07 +01:00
options.h sd_lavc, sd_spu: make dvdsub stretching conditional on --stretch-dvd-subs. 2013-11-07 12:56:07 +01:00
parser-cfg.c parser-cfg: allow putting options with leading "--" 2013-10-14 23:41:26 +02:00
parser-cfg.h
parser-mpcmd.c options: don't let watch_later etc. overwite command line options 2013-10-25 22:52:54 +02:00
parser-mpcmd.h
path.c configure: uniform the defines to #define HAVE_xxx (0|1) 2013-11-03 21:59:54 +01:00
path.h Split mplayer.c 2013-10-30 01:53:53 +01:00
playlist_parser.c playlist: rewrite PLS parser 2013-11-04 23:55:41 +01:00
playlist_parser.h core: add a playlist demuxer 2013-08-26 10:09:45 +02:00
playlist.c playlist: check for NULL on caller site 2013-10-12 18:57:02 +02:00
playlist.h mplayer: fix looping of very short files 2013-09-29 21:10:45 +02:00
resolve_quvi9.c libquvi9: work around insane interaction between libquvi and libkdecore 2013-10-12 18:56:03 +02:00
resolve_quvi.c quvi: coerce libquvi 0.4 support into allowing format switching 2013-09-10 16:38:34 +02:00
resolve.h quvi: coerce libquvi 0.4 support into allowing format switching 2013-09-10 16:38:34 +02:00
version.c