提交 f1282836 编写于 作者: K kc5nra 提交者: John Bradley

obs-ffmpeg: Fix outputs without both video/audio

Fixes a crash in formats that don't support both video and audio
streams.
上级 8743e722
......@@ -526,6 +526,11 @@ static void receive_video(void *param, struct video_data *frame)
{
struct ffmpeg_output *output = param;
struct ffmpeg_data *data = &output->ff_data;
// codec doesn't support video or none configured
if (!data->video)
return;
AVCodecContext *context = data->video->codec;
AVPacket packet = {0};
int ret = 0, got_packet;
......@@ -671,6 +676,10 @@ static void receive_audio(void *param, struct audio_data *frame)
size_t frame_size_bytes;
struct audio_data in;
// codec doesn't support audio or none configured
if (!data->audio)
return;
AVCodecContext *context = data->audio->codec;
if (!data->start_timestamp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册