obs-ffmpeg: Fix outputs without both video/audio

Fixes a crash in formats that don't support both video and audio
streams.
This commit is contained in:
kc5nra
2015-03-28 00:54:47 -05:00
committed by John Bradley
parent 8743e722ae
commit f128283655

View File

@@ -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)