mirror of https://github.com/mpv-player/mpv
6f6632b8dd
It turns out that some code that was removed earlier was still needed. avcodec_decode_audio4() can decode packets "partially". In that case, you have to "slice" the packet and call the decode function again. Codecs which need this are obscure and in low numbers. One sample that needs it is here: rsync://fate-suite.ffmpeg.org/fate-suite/lossless-audio/luckynight-partial.shn (This one decodes in rather small increments.) The new code is much simpler than what has been removed earlier, though. The fact that we own the packet returned by the demuxer helps a lot. Not sure what should happen if avcodec_decode_audio4() returns 0. Currently, we throw away the packet in this case. We don't want to be stuck in an endless loop (could happen if the decoder produces no output either). |
||
---|---|---|
.. | ||
ad.c | ||
ad.h | ||
ad_internal.h | ||
ad_lavc.c | ||
ad_mpg123.c | ||
ad_spdif.c | ||
dec_audio.c | ||
dec_audio.h |