浏览代码

Merge pull request #1658 from cristisilaghi/master2

obs-ffmpeg: Fix crash when audio not configured
Jim 6 年之前
父节点
当前提交
25bc6db718
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      plugins/obs-ffmpeg/obs-ffmpeg-output.c

+ 4 - 0
plugins/obs-ffmpeg/obs-ffmpeg-output.c

@@ -894,6 +894,10 @@ static void receive_audio(void *param, size_t mix_idx, struct audio_data *frame)
 	struct audio_data in;
 	struct audio_data in;
 	int track_order;
 	int track_order;
 
 
+	// codec doesn't support audio or none configured
+	if (!data->audio_streams)
+		return;
+
 	/* check that the track was selected */
 	/* check that the track was selected */
 	if ((data->audio_tracks & (1 << mix_idx)) == 0)
 	if ((data->audio_tracks & (1 << mix_idx)) == 0)
 		return;
 		return;