summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorZhao Zhili <wantlamy@gmail.com>2018-05-14 20:17:59 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2018-05-16 00:39:52 +0200
commit84d4af4ea8aacb43abef57f0542cec209705fead (patch)
treefcb4bd75f573fac278c6e47346d109d34820bdab /doc
parent989c5a84acffa327cc3daf90c2e4226cf2174481 (diff)
downloadffmpeg-streaming-84d4af4ea8aacb43abef57f0542cec209705fead.zip
ffmpeg-streaming-84d4af4ea8aacb43abef57f0542cec209705fead.tar.gz
examples/filtering_video: drop an always true condition
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/filtering_video.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c
index 38ff9bb..b219125 100644
--- a/doc/examples/filtering_video.c
+++ b/doc/examples/filtering_video.c
@@ -247,27 +247,25 @@ int main(int argc, char **argv)
goto end;
}
- if (ret >= 0) {
- frame->pts = frame->best_effort_timestamp;
+ frame->pts = frame->best_effort_timestamp;
- /* push the decoded frame into the filtergraph */
- if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
+ /* push the decoded frame into the filtergraph */
+ if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
+ break;
+ }
+
+ /* pull filtered frames from the filtergraph */
+ while (1) {
+ ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
+ if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
break;
- }
-
- /* pull filtered frames from the filtergraph */
- while (1) {
- ret = av_buffersink_get_frame(buffersink_ctx, filt_frame);
- if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
- break;
- if (ret < 0)
- goto end;
- display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base);
- av_frame_unref(filt_frame);
- }
- av_frame_unref(frame);
+ if (ret < 0)
+ goto end;
+ display_frame(filt_frame, buffersink_ctx->inputs[0]->time_base);
+ av_frame_unref(filt_frame);
}
+ av_frame_unref(frame);
}
}
av_packet_unref(&packet);
OpenPOWER on IntegriCloud