audio output: Allow i_physical_channels to be unset when using pass through
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>
Tue, 1 Aug 2017 11:20:00 +0000 (13:20 +0200)
committerHugo Beauzée-Luyssen <hugo@beauzee.fr>
Wed, 2 Aug 2017 07:39:53 +0000 (09:39 +0200)
Fix #18614

src/audio_output/output.c

index 08104f8..1bd9160 100644 (file)
@@ -546,6 +546,7 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt,
         }
 
         aout_FormatPrepare (fmt);
+        assert (aout_FormatNbChannels(fmt) > 0);
     }
 
     aout->current_sink_info.headphones = false;
@@ -560,7 +561,6 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt,
                             i_nb_input_channels, i_forced_stereo_mode);
 
     aout_FormatPrepare (fmt);
-    assert (aout_FormatNbChannels(fmt) > 0);
     assert (fmt->i_bytes_per_frame > 0 && fmt->i_frame_length > 0);
     aout_FormatPrint (aout, "output", fmt);
     return 0;