Skip to content

Commit 2689e4a

Browse files
committed
LSMASHAudioSource: initialize channel layout only if necessary (#63)
1 parent 733f2da commit 2689e4a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

common/libavsmash.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,10 @@ void update_configuration
925925
lsmash_audio_summary_t *audio = (lsmash_audio_summary_t *)summary;
926926
codecpar->sample_rate = config->queue.sample_rate ? config->queue.sample_rate : audio->frequency;
927927
codecpar->bits_per_coded_sample = config->queue.bits_per_sample ? config->queue.bits_per_sample : audio->sample_size;
928-
av_channel_layout_default(&codecpar->ch_layout, config->queue.channels ? config->queue.channels : audio->channels);
928+
if (config->queue.channels)
929+
av_channel_layout_default(&codecpar->ch_layout, config->queue.channels);
930+
else if (codecpar->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
931+
av_channel_layout_default(&codecpar->ch_layout, audio->channels);
929932
}
930933
if( codec->id == AV_CODEC_ID_DTS )
931934
{

0 commit comments

Comments
 (0)