[FFmpeg-cvslog] ffmpeg: move filtered_frame to the CONFIG_AVFILTER scope.
Clément Bœsch
git at videolan.org
Fri Feb 10 20:35:09 CET 2012
ffmpeg | branch: master | Clément Bœsch <clement.boesch at smartjog.com> | Tue Feb 7 13:26:53 2012 +0100| [086fc4d7656e518400cf17e6c317cd87219ccd19] | committer: Clément Bœsch
ffmpeg: move filtered_frame to the CONFIG_AVFILTER scope.
This simplifies a bit the #ifdefery.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=086fc4d7656e518400cf17e6c317cd87219ccd19
---
ffmpeg.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 16ac050..a02b1a9 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2120,7 +2120,6 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
rate_emu_sleep(ist);
for (i = 0; i < nb_output_streams; i++) {
- AVFrame *filtered_frame = NULL;
OutputStream *ost = &output_streams[i];
if (!check_output_constraints(ist, ost) || !ost->encoding_needed)
@@ -2129,6 +2128,8 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
#if CONFIG_AVFILTER
while (av_buffersink_poll_frame(ost->output_video_filter)) {
AVRational ist_pts_tb = ost->output_video_filter->inputs[0]->time_base;
+ AVFrame *filtered_frame;
+
if (av_buffersink_get_buffer_ref(ost->output_video_filter, &ost->picref, 0) < 0){
av_log(0, AV_LOG_WARNING, "AV Filter told us it has a frame available but failed to output one\n");
goto cont;
@@ -2146,16 +2147,14 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
}
if (ost->picref->video && !ost->frame_aspect_ratio)
ost->st->codec->sample_aspect_ratio = ost->picref->video->sample_aspect_ratio;
-#else
- filtered_frame = decoded_frame;
-#endif
-
do_video_out(output_files[ost->file_index].ctx, ost, ist, filtered_frame,
same_quant ? quality : ost->st->codec->global_quality);
-#if CONFIG_AVFILTER
cont:
avfilter_unref_buffer(ost->picref);
}
+#else
+ do_video_out(output_files[ost->file_index].ctx, ost, ist, decoded_frame,
+ same_quant ? quality : ost->st->codec->global_quality);
#endif
}
More information about the ffmpeg-cvslog
mailing list