Skip to content

Commit

Permalink
Cleanup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Aug 7, 2024
1 parent 9696d86 commit 76df129
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ static input_container *open_audio_input(SEXP audio){
bail_if(avcodec_open2(decoder, codec, NULL), "avcodec_open2 (audio)");
#ifdef NEW_CHANNEL_API
if(channels)
decoder->ch_layout.nb_channels = channels;
if (channels || decoder->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
av_channel_layout_default(&decoder->ch_layout, decoder->ch_layout.nb_channels);
av_channel_layout_default(&decoder->ch_layout, channels); //PCM input
if (decoder->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
av_channel_layout_default(&decoder->ch_layout, decoder->ch_layout.nb_channels); //other stuff
#else
if(channels)
decoder->channels = channels;
Expand Down

0 comments on commit 76df129

Please sign in to comment.