flvmux: Simplify an if-else chain

Merge the identical branches and turn the condition around to make it
easier to read.
This commit is contained in:
Jan Alexander Steffens (heftig) 2019-06-19 12:31:46 +02:00
parent 9a70ce87db
commit 9528bfd78f
No known key found for this signature in database
GPG key ID: DE5E0C5F25941CA5

View file

@ -1478,24 +1478,19 @@ gst_flv_mux_write_header (GstFlvMux * mux)
gst_query_unref (query);
}
if (!mux->streamable) {
if (mux->streamable && mux->sent_header) {
GstBuffer **video_codec_data_p = NULL, **audio_codec_data_p = NULL;
if (mux->video_pad && mux->video_pad->info_changed)
video_codec_data_p = &video_codec_data;
if (mux->audio_pad && mux->audio_pad->info_changed)
audio_codec_data_p = &audio_codec_data;
caps = gst_flv_mux_prepare_src_caps (mux,
NULL, NULL, video_codec_data_p, audio_codec_data_p);
} else {
caps = gst_flv_mux_prepare_src_caps (mux,
&header, &metadata, &video_codec_data, &audio_codec_data);
} else {
if (!mux->sent_header) {
caps = gst_flv_mux_prepare_src_caps (mux,
&header, &metadata, &video_codec_data, &audio_codec_data);
} else {
GstBuffer **video_codec_data_p = NULL, **audio_codec_data_p = NULL;
if (mux->video_pad && mux->video_pad->info_changed)
video_codec_data_p = &video_codec_data;
if (mux->audio_pad && mux->audio_pad->info_changed)
audio_codec_data_p = &audio_codec_data;
caps = gst_flv_mux_prepare_src_caps (mux,
NULL, NULL, video_codec_data_p, audio_codec_data_p);
}
}
gst_aggregator_set_src_caps (GST_AGGREGATOR_CAST (mux), caps);