On Sat, May 12, 2012 at 08:54:38PM +0200, Robert Nagy wrote:
> The previous update to PATCH 1/2 broke PATCH 2/2, this one should be ok.
>
> --- a/libavfilter/vf_yadif.c
> +++ b/libavfilter/vf_yadif.c
> @@ -218,14 +218,16 @@ static void return_frame(AVFilterContext *ctx, int
> is_second)
> filter(ctx, yadif->out, tff ^ !is_second, tff);
>
> if (is_second) {
> - if (yadif->next->pts != AV_NOPTS_VALUE &&
> - yadif->cur->pts != AV_NOPTS_VALUE) {
> - yadif->out->pts =
> - (yadif->next->pts&yadif->cur->pts) +
> - ((yadif->next->pts^yadif->cur->pts)>>1);
> + int64_t prev_pts = yadif->prev->pts;
> + int64_t cur_pts = yadif->cur->pts;
> + int64_t next_pts = yadif->next ? yadif->next->pts :
> 2*cur_pts-prev_pts;
spaces around *
> + if (next_pts != AV_NOPTS_VALUE &&
> + cur_pts != AV_NOPTS_VALUE) {
> + yadif->out->pts = cur_pts + next_pts;
> } else {
> yadif->out->pts = AV_NOPTS_VALUE;
> - }
> + }
Don't add trailing whitespace.
> @@ -255,6 +257,7 @@ static void start_frame(AVFilterLink *link,
> AVFilterBufferRef *picref)
> avfilter_unref_buffer(yadif->prev);
> yadif->prev = NULL;
> + yadif->out->pts = yadif->out->pts == AV_NOPTS_VALUE ?
> yadif->out->pts : yadif->out->pts*2+0;
spaces around operators
> @@ -267,6 +270,7 @@ static void start_frame(AVFilterLink *link,
> AVFilterBufferRef *picref)
> yadif->out->video->interlaced = 0;
> + yadif->out->pts = yadif->out->pts == AV_NOPTS_VALUE ? yadif->out->pts :
> yadif->out->pts*2+0;
ditto
> @@ -400,6 +404,16 @@ static av_cold int init(AVFilterContext *ctx, const char
> *args, void *opaque)
>
> +static int out_config_props(AVFilterLink* link)
> +{
> + link->time_base.num = link->src->inputs[0]->time_base.num;
> + link->time_base.den = link->src->inputs[0]->time_base.den*2;
> + link->w = link->src->inputs[0]->w;
> + link->h = link->src->inputs[0]->h;
Align the '='.
> @@ -420,6 +434,7 @@ AVFilter avfilter_vf_yadif = {
> .outputs = (AVFilterPad[]) {{ .name = "default",
> .type = AVMEDIA_TYPE_VIDEO,
> .poll_frame = poll_frame,
> - .request_frame = request_frame, },
> + .request_frame = request_frame,
> + .config_props = out_config_props,
> },
Please drop the extra spaces.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel