Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-04-24 19:55:55 +0400
committerClément Bœsch <ubitux@gmail.com>2013-04-24 20:30:43 +0400
commitc7d2a3abf037f0bd7755f2ac39ee6dead979c596 (patch)
tree280e461b5fffd1b1695d293916b67b7ccbb15cef /libavfilter/vf_vidstabdetect.c
parentc82f6e58daf65e79cba3eff79111cf8b627eb13f (diff)
lavfi/vidstabdetect: fix direct path.
The frame must be writable if the show option is set, otherwise pass the frame unchanged.
Diffstat (limited to 'libavfilter/vf_vidstabdetect.c')
-rw-r--r--libavfilter/vf_vidstabdetect.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c
index bbc8ef4762..d96ca8e9f6 100644
--- a/libavfilter/vf_vidstabdetect.c
+++ b/libavfilter/vf_vidstabdetect.c
@@ -160,22 +160,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
LocalMotions localmotions;
AVFilterLink *outlink = inlink->dst->outputs[0];
- int direct = 0;
- AVFrame *out;
VSFrame frame;
int plane;
- if (av_frame_is_writable(in)) {
- direct = 1;
- out = in;
- } else {
- out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
- if (!out) {
- av_frame_free(&in);
- return AVERROR(ENOMEM);
- }
- av_frame_copy_props(out, in);
- }
+ if (sd->conf.show > 0 && !av_frame_is_writable(in))
+ av_frame_make_writable(in);
for (plane = 0; plane < md->fi.planes; plane++) {
frame.data[plane] = in->data[plane];
@@ -191,16 +180,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
vs_vector_del(&localmotions);
}
- if (sd->conf.show > 0 && !direct) {
- av_image_copy(out->data, out->linesize,
- (void*)in->data, in->linesize,
- in->format, in->width, in->height);
- }
-
- if (!direct)
- av_frame_free(&in);
- return ff_filter_frame(outlink, out);
+ return ff_filter_frame(outlink, in);
}
static const AVFilterPad avfilter_vf_vidstabdetect_inputs[] = {