|
@@ -578,6 +578,11 @@ static bool ffmpeg_data_init(struct ffmpeg_data *data,
|
|
avformat_alloc_output_context2(&data->output, output_format,
|
|
avformat_alloc_output_context2(&data->output, output_format,
|
|
NULL, NULL);
|
|
NULL, NULL);
|
|
|
|
|
|
|
|
+ if (!data->output) {
|
|
|
|
+ blog(LOG_WARNING, "Couldn't create avformat context");
|
|
|
|
+ goto fail;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (is_rtmp) {
|
|
if (is_rtmp) {
|
|
data->output->oformat->video_codec = AV_CODEC_ID_H264;
|
|
data->output->oformat->video_codec = AV_CODEC_ID_H264;
|
|
data->output->oformat->audio_codec = AV_CODEC_ID_AAC;
|
|
data->output->oformat->audio_codec = AV_CODEC_ID_AAC;
|
|
@@ -586,11 +591,6 @@ static bool ffmpeg_data_init(struct ffmpeg_data *data,
|
|
set_encoder_ids(data);
|
|
set_encoder_ids(data);
|
|
}
|
|
}
|
|
|
|
|
|
- if (!data->output) {
|
|
|
|
- blog(LOG_WARNING, "Couldn't create avformat context");
|
|
|
|
- goto fail;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (!init_streams(data))
|
|
if (!init_streams(data))
|
|
goto fail;
|
|
goto fail;
|
|
if (!open_output_file(data))
|
|
if (!open_output_file(data))
|