[FFmpeg-devel] [PATCH] Work around msvc (c99wrap) build failure

Don Moir donmoir at comcast.net
Mon Aug 26 20:21:42 CEST 2013


----- Original Message ----- 
From: "Pavel Koshevoy" <pkoshevoy at gmail.com>
To: <ffmpeg-devel at ffmpeg.org>
Sent: Monday, August 26, 2013 12:59 AM
Subject: Re: [FFmpeg-devel] [PATCH] Work around msvc (c99wrap) build failure


> On 8/25/13 10:16 PM, Michael Niedermayer wrote:
>> On Sun, Aug 25, 2013 at 09:57:45PM -0600, Pavel Koshevoy wrote:
>>> On 8/25/13 9:13 PM, Michael Niedermayer wrote:
>>>> On Sun, Aug 25, 2013 at 06:30:35PM -0600, pkoshevoy at gmail.com wrote:
>>>>> From: Pavel Koshevoy <pkoshevoy at gmail.com>
>>>>>
>>>>> c99wrap choked on initialization of .dbl start_time option with
>>>>> AV_NOPTS_VALUE: Unable to parse int64_t as expression primary
>>>>>
>>>>> Signed-off-by: Pavel Koshevoy <pkoshevoy at gmail.com>
>>>>> ---
>>>>>   libavfilter/vf_fps.c |    6 ++++--
>>>>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
>>>>> index e30e90b..219bcd1 100644
>>>>> --- a/libavfilter/vf_fps.c
>>>>> +++ b/libavfilter/vf_fps.c
>>>>> @@ -25,6 +25,8 @@
>>>>>    * a filter enforcing given constant framerate
>>>>>    */
>>>>> +#include <float.h>
>>>>> +
>>>>>   #include "libavutil/common.h"
>>>>>   #include "libavutil/fifo.h"
>>>>>   #include "libavutil/mathematics.h"
>>>>> @@ -61,7 +63,7 @@ typedef struct FPSContext {
>>>>>   #define F AV_OPT_FLAG_FILTERING_PARAM
>>>>>   static const AVOption fps_options[] = {
>>>>>       { "fps", "A string describing desired output framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 
>>>>> .flags = V|F },
>>>>> -    { "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = 
>>>>> AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX, V },
>>>>> +    { "start_time", "Assume the first PTS should be this value.", OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = 
>>>>> DBL_MAX }, -DBL_MAX, DBL_MAX, V },
>>>> does INT64_MIN work as well ?
>>>> if so i think its preferable as it has the same nummeric value as
>>>> AV_NOPTS_VALUE, introducing no change except the fix/workaround
>>>> (vf_fps.c could check by assert that the 2 match)
>>>>
>>> No, INT64_MIN triggers the same error from c99wrap: Unable to parse
>>> int64_t as expression primary
>>>
>>> I suspect c99wrap chokes on the typecast statement.
>>>
>>> If I change it to { .dbl = 0 } it compiles fine.
>>> If I change it to { .dbl = (double)0 } it complains:  Unable to
>>> parse double as expression primary
>> next try:
>> -9223372036854775808.0
>>
>>
>>> I don't see why there is any particular attachment to AV_NOPTS_VALUE
>>> as initial value for start_time.  It's appears to be just that -- an
>> its the "not set" value throughout the codebase, also some user
>> app could be setting that intentionally or unintenionally
>
> changing { .dbl = AV_NOPTS_VALUE} to { .dbl = -9223372036854775808.0 } compiles successfully.
>
>     Pavel.

double no_value = -9223372036854775808.0;

no_value == -9223372036854775800.0




More information about the ffmpeg-devel mailing list