[FFmpeg-devel] [PATCH] HWAccel infrastructure (take 4)

Gwenole Beauchesne gbeauchesne
Thu Feb 19 17:04:27 CET 2009

On Thu, 19 Feb 2009, Reimar D?ffinger wrote:

> Also what is the problem with avctx->get_format ==
> avcodec_default_get_format, as long as it doesn't crash let the user do
> what they want, particularly since this check might actually not work
> reliably e.g. on Windows or when -Bsymbolic is used.
> I'd be in favour of a clear remark in the documentation instead of this.

I don't understand this argument. Actually, ::get_format is a pointer to 
function and avcodec_default_get_format() is a function, so IIRC the test 
should work. However, that would obviously have failed if ::get_format was 
a pointer. i.e. sizeof(void *) != sizeof(void (*)(void));

IOW, that should work even if the pointer to function is actually a 
function descriptor (function address + toc on linux/ppc64 or function 
address + gp on linux/ia64).

If direct comparison is a problem for you, we could also make a temporary 
const pointer to function initialized to avcodec_default_get_format() and 
compare against that.

More information about the ffmpeg-devel mailing list