[FFmpeg-devel] [PATCH] lavfi/setpts: set SAMPLE_RATE to NAN when input is no audio

Michael Niedermayer michaelni at gmx.at
Mon Sep 10 18:23:43 CEST 2012


On Mon, Sep 10, 2012 at 12:06:49PM +0200, Stefano Sabatini wrote:
> Should be more robust/consistent.
> ---
>  libavfilter/f_setpts.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/f_setpts.c b/libavfilter/f_setpts.c
> index 61446c1..2afdc65 100644
> --- a/libavfilter/f_setpts.c
> +++ b/libavfilter/f_setpts.c
> @@ -106,8 +106,8 @@ static int config_input(AVFilterLink *inlink)
>      setpts->type = inlink->type;
>      setpts->var_values[VAR_TB] = av_q2d(inlink->time_base);
>  
> -    if (setpts->type == AVMEDIA_TYPE_AUDIO)
> -        setpts->var_values[VAR_SAMPLE_RATE] = inlink->sample_rate;
> +    setpts->var_values[VAR_SAMPLE_RATE] =
> +        setpts->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
>  
>      setpts->var_values[VAR_FRAME_RATE] = inlink->frame_rate.num && inlink->frame_rate.den ?
>          av_q2d(inlink->frame_rate) : NAN;

0 or NAN, should both be ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120910/b639d511/attachment.asc>


More information about the ffmpeg-devel mailing list