diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-08-21 22:47:59 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-08-21 22:47:59 +0300 |
commit | 68df2b2b3f9a3310e39b509b2ed7208dc0e95123 (patch) | |
tree | 58ad6ddab5c4644de7e1c18b4f7d2b4bbfc9816c /libmpdemux/yuv4mpeg.h | |
parent | da2b884c703d6cf7ef6ee3d496d1ba884e62dd13 (diff) | |
download | mpv-68df2b2b3f9a3310e39b509b2ed7208dc0e95123.tar.bz2 mpv-68df2b2b3f9a3310e39b509b2ed7208dc0e95123.tar.xz |
ad_ffmpeg: handle timing for partially decoded packets better
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.
Diffstat (limited to 'libmpdemux/yuv4mpeg.h')
0 files changed, 0 insertions, 0 deletions