[FFmpeg-devel] [PATCH] incorrect return type for opt_bitrate/type safety

Morten Hustveit lists
Wed Jan 2 00:25:22 CET 2008


Hello,

during use I discovered that my -b and -vb options were rejected by ffmpeg.  In
the `options' array, the `opt_bitrate' function is declared to be a OPT_FUNC2
handler, yet it void.  OPT_FUNC2 handlers are supposed to return int, and
negative values for failures.

This is symptomatic of lack of type safety; the compiler could have warned about
passing an incorrect function pointer type if given the chance, but in every
case the pointers were casted to (void*).  I have attached a patch which
establishes type safety in the `options' array, in addition to removing all the
warnings this caused.

-- 
Morten Hustveit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg_c-option-type-safety.patch
Type: text/x-diff
Size: 26730 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080102/205d6cbd/attachment.patch>



More information about the ffmpeg-devel mailing list