Fix ALAC playback

This commit is contained in:
Ilya Laktyushin 2023-02-20 03:28:17 +04:00
parent cb8651b003
commit b529625219

View File

@ -368,6 +368,11 @@ static av_cold int ffat_create_decoder(AVCodecContext *avctx, AVPacket *pkt)
avctx->sample_rate = out_format.mSampleRate = in_format.mSampleRate; avctx->sample_rate = out_format.mSampleRate = in_format.mSampleRate;
avctx->channels = out_format.mChannelsPerFrame = in_format.mChannelsPerFrame; avctx->channels = out_format.mChannelsPerFrame = in_format.mChannelsPerFrame;
out_format.mBytesPerFrame =
out_format.mChannelsPerFrame * (out_format.mBitsPerChannel / 8);
out_format.mBytesPerPacket =
out_format.mBytesPerFrame * out_format.mFramesPerPacket;
if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_QT) if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_QT)
in_format.mFramesPerPacket = 64; in_format.mFramesPerPacket = 64;