At least the libavcodec WavPack decoder can return output for an audio
frame in multiple parts and return 0 bytes input consumed for the
initial parts. Timing info was not set correctly in this case:
sh_audio->pts and pts_bytes were reset each time when decoding more
from the packet, as if the packet had been new (ds_get_packet_pts()
has a check to return MP_NOPTS_VALUE if the packet has already been
partially read, but that didn't trigger since libavcodec returned
exactly 0 bytes read so the demuxer-visible packet state didn't
change).
Add a field to keep track of whether a packet has already been decoded
from, and don't reset timing info again if so. Adding the field
requires adding a decoder context to store it (there wasn't one
before).
BTW the WavPack decoder behavior and avcodec_decode_audio3()
documentation don't match - the documentation says the return value is
"zero if no frame data was decompressed (used) from the input
AVPacket", while the decoder DOES return some frame data which comes
from the input packet.
Compiling with full features requires development files for several
external libraries. Below is a list of some important requirements. For
more information see the output of './configure --help' for a list of options,
or look at the list of enabled and disabled features printed after running
'./configure'. If you think you have support for some feature installed
but configure fails to detect it, the file config.log may contain information
about the reasons for the failure.
Libraries specific to particular video output methods
(you'll want at least one of VDPAU, GL or Xv):
- libvdpau (for VDPAU output, best choice for NVIDIA cards)
- libGL (OpenGL output)
- libXv (XVideo output)
general:
- libasound (ALSA audio output)
- various general X development libraries
- libfreetype
- libfontconfig
- libass
- FFmpeg libraries (libavutil libavcodec libavformat libswscale libpostproc)
Most of the above libraries are available in suitable versions on normal
Linux distributions. However FFmpeg is an exception (distro versions may be
too old to work at all or work well). For that reason you may want to use
the separately available build wrapper that first compiles FFmpeg libraries
and libass, and then compiles the player statically linked against those.