Skip to content
Snippets Groups Projects
Commit 05d3813d authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud
Browse files

decoder: set channel layout

Change-Id: I9aadd0696d7ad2e467ffe19841bc9e919e08777a
parent e3022741
No related branches found
No related tags found
No related merge requests found
...@@ -338,6 +338,10 @@ MediaDecoder::decode(const AudioFrame& decodedFrame) ...@@ -338,6 +338,10 @@ MediaDecoder::decode(const AudioFrame& decodedFrame)
if (frameFinished) { if (frameFinished) {
av_packet_unref(&inpacket); av_packet_unref(&inpacket);
// channel layout is needed if frame will be resampled
if (!frame->channel_layout)
frame->channel_layout = av_get_default_channel_layout(frame->channels);
auto packetTimestamp = frame->pts; auto packetTimestamp = frame->pts;
// NOTE don't use clock to rescale audio pts, it may create artifacts // NOTE don't use clock to rescale audio pts, it may create artifacts
frame->pts = av_rescale_q_rnd(frame->pts, avStream_->time_base, decoderCtx_->time_base, frame->pts = av_rescale_q_rnd(frame->pts, avStream_->time_base, decoderCtx_->time_base,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment