I recently tried to upgrade the ffmpeg libraries I use in my Mac OS X application by downloading and compiling ffmpeg from source.
My code works correctly with pre-c
I've found a solution for my problem, even though I would still be interested if anyone can help me with an explanation of my problem.
Basically, I was calling only av_register_all() at the top of my function. Now when adding avcodec_register_all() after this, my code works again. I don't understand why though, because avcodec_register_all() should be called by av_register_all() from looking at the source code.
See http://www.ffmpeg.org/doxygen/trunk/allformats_8c-source.html#l00039 for the source code
in av_register_all():
static int initialized;
if (initialized)
return;
initialized = 1;
avcodec_register_all();
Maybe due to some unnoticed factors, the static int variable "initialized" has been initialized while the avcodec has not been registered...Then we should call avcodec_register_all() to explicitly fulfill it. But I am inclined to think that it is a bug in ffmpeg.