Commit 47a3439e authored by Anton Khirnov's avatar Anton Khirnov Committed by Michael Niedermayer

ffmpeg: save two levels of indentation in flush_encoders()

By replacing
if (foo)
    <do stuff>

with
if (!foo)
    continue;
<do stuff>
parent a16f1afb
......@@ -1451,17 +1451,17 @@ static void flush_encoders(int ist_index, OutputStream *ost_table, int nb_ostrea
for (i = 0; i < nb_ostreams; i++) {
OutputStream *ost = &ost_table[i];
if (ost->source_index == ist_index) {
AVCodecContext *enc = ost->st->codec;
AVFormatContext *os = output_files[ost->file_index].ctx;
if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <=1)
if (ost->source_index != ist_index || !ost->encoding_needed)
continue;
if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <=1)
continue;
if(ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE))
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE))
continue;
if (ost->encoding_needed) {
for(;;) {
AVPacket pkt;
int fifo_bytes;
......@@ -1528,8 +1528,6 @@ static void flush_encoders(int ist_index, OutputStream *ost_table, int nb_ostrea
write_frame(os, &pkt, ost->st->codec, ost->bitstream_filters);
}
}
}
}
}
/* pkt = NULL means EOF (needed to flush decoder buffers) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment