mirror of https://git.ffmpeg.org/ffmpeg.git
avconv: save two levels of indentation in flush_encoders()
By replacing if (foo) <do stuff> with if (!foo) continue; <do stuff>
This commit is contained in:
parent
4a4ce2e743
commit
6f1c66d526
8
avconv.c
8
avconv.c
|
@ -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->source_index != ist_index || !ost->encoding_needed)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <=1)
|
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;
|
||||||
|
@ -1480,8 +1480,6 @@ static void flush_encoders(int ist_index, OutputStream *ost_table, int nb_ostrea
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* pkt = NULL means EOF (needed to flush decoder buffers) */
|
/* pkt = NULL means EOF (needed to flush decoder buffers) */
|
||||||
static int output_packet(InputStream *ist, int ist_index,
|
static int output_packet(InputStream *ist, int ist_index,
|
||||||
|
|
Loading…
Reference in New Issue