Fix mismatch between a track timescale and the samplerate used by the audio decoder.
This commit is contained in:
1 file changed
+3
-4
@@ -276,8 +276,8 @@ static AVPacket * packetFromSampleBuffer(MP42SampleBuffer *sample)
|
|||||||
AVPacket *pkt = av_packet_alloc();
|
AVPacket *pkt = av_packet_alloc();
|
||||||
pkt->data = sample->data;
|
pkt->data = sample->data;
|
||||||
pkt->size = sample->size;
|
pkt->size = sample->size;
|
||||||
pkt->pts = sample->decodeTimestamp;
|
pkt->dts = sample->decodeTimestamp;
|
||||||
pkt->dts = AV_NOPTS_VALUE;
|
pkt->duration = sample->duration;
|
||||||
|
|
||||||
return pkt;
|
return pkt;
|
||||||
}
|
}
|
||||||
@@ -354,10 +354,9 @@ static void configureDescriptors(MP42DecodeContext *context, AVFrame *frame)
|
|||||||
context->inputFormat->mSampleRate = sample_rate;
|
context->inputFormat->mSampleRate = sample_rate;
|
||||||
|
|
||||||
if (sample_rate > 48000) {
|
if (sample_rate > 48000) {
|
||||||
sample_rate = 48000;
|
context->outputFormat->mSampleRate = sample_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
context->outputFormat->mSampleRate = sample_rate;
|
|
||||||
context->outputFormat->mBytesPerPacket = 4 * context->outputFormat->mChannelsPerFrame;
|
context->outputFormat->mBytesPerPacket = 4 * context->outputFormat->mChannelsPerFrame;
|
||||||
context->outputFormat->mBytesPerFrame = context->outputFormat->mBytesPerPacket * context->outputFormat->mFramesPerPacket;
|
context->outputFormat->mBytesPerFrame = context->outputFormat->mBytesPerPacket * context->outputFormat->mFramesPerPacket;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user