On Thu, 15 Aug 2013 16:16:46 -0400, Justin Ruggles <[email protected]> 
wrote:
> This allows for dropping or duplication to match a particular start time.
> ---
>  libavfilter/vf_fps.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
> index 7f51752..704f697 100644
> --- a/libavfilter/vf_fps.c
> +++ b/libavfilter/vf_fps.c
> @@ -54,6 +54,7 @@ typedef struct FPSContext {
>  #define V AV_OPT_FLAG_VIDEO_PARAM
>  static const AVOption options[] = {
>      { "fps", "A string describing desired output framerate", OFFSET(fps), 
> AV_OPT_TYPE_STRING, { .str = "25" }, .flags = V },
> +    { "first_pts", "Assume the first PTS should be this value.", 
> OFFSET(first_pts), AV_OPT_TYPE_INT64, { .i64 = AV_NOPTS_VALUE}, INT64_MIN, 
> INT64_MAX, V|F },
                                                                                
                                                                            ^
F?

>      { NULL },
>  };
>  
> @@ -177,7 +178,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
> *buf)
>              if (ret < 0)
>                  return ret;
>  
> -            s->first_pts = s->pts = buf->pts;
> +            if (s->first_pts != AV_NOPTS_VALUE)
> +                s->pts = s->first_pts;
> +            else
> +                s->first_pts = s->pts = buf->pts;

Is specifying the pts in the input timebase all that useful? It's usually not
known to the user.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to