Commit 6f1c66d5 authored by Anton Khirnov's avatar Anton Khirnov

avconv: save two levels of indentation in flush_encoders()

By replacing
if (foo)
    <do stuff>

with
if (!foo)
    continue;
<do stuff>
parent 4a4ce2e7
...@@ -1402,17 +1402,17 @@ static void flush_encoders(int ist_index, OutputStream *ost_table, int nb_ostrea ...@@ -1402,17 +1402,17 @@ static void flush_encoders(int ist_index, OutputStream *ost_table, int nb_ostrea
for (i = 0; i < nb_ostreams; i++) { for (i = 0; i < nb_ostreams; i++) {
OutputStream *ost = &ost_table[i]; OutputStream *ost = &ost_table[i];
if (ost->source_index == ist_index) {
AVCodecContext *enc = ost->st->codec; AVCodecContext *enc = ost->st->codec;
AVFormatContext *os = output_files[ost->file_index].ctx; 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; 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; continue;
if (ost->encoding_needed) {
for(;;) { for(;;) {
AVPacket pkt; AVPacket pkt;
int fifo_bytes; int fifo_bytes;
...@@ -1479,8 +1479,6 @@ static void flush_encoders(int ist_index, OutputStream *ost_table, int nb_ostrea ...@@ -1479,8 +1479,6 @@ static void flush_encoders(int ist_index, OutputStream *ost_table, int nb_ostrea
write_frame(os, &pkt, ost->st->codec, ost->bitstream_filters); write_frame(os, &pkt, ost->st->codec, ost->bitstream_filters);
} }
} }
}
}
} }
/* pkt = NULL means EOF (needed to flush decoder buffers) */ /* 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