Fix a crash when there is no audio (but we are set to external).
[dcpomatic.git] / src / lib / encoder.cc
index 61e95a38a2f5354a55cbb00b281a38d550ccbfdb..6e1209d83512b82374010ecc71d704acf535ef54 100644 (file)
@@ -136,7 +136,7 @@ void
 Encoder::process_end ()
 {
 #if HAVE_SWRESAMPLE    
-       if (_film->audio_stream() && _swr_context) {
+       if (_film->audio_stream() && _film->audio_stream()->channels() && _swr_context) {
 
                shared_ptr<AudioBuffers> out (new AudioBuffers (_film->audio_stream()->channels(), 256));