[libav-api] How to play/decode audio file with libav

Ronald S. Bultje rsbultje at gmail.com
Sun Jun 26 18:00:59 CEST 2011


Hi,

On Sun, Jun 26, 2011 at 4:16 AM, Manuel Reimer
<Manuel.Spam at nurfuerspam.de> wrote:
> Ronald S. Bultje wrote:
>> Yes it can do all of that. Start looking at ffplay.c it is way more
>> complex than what you need, but will serve as an example.
>> libavcodec/api-example.c is a simple decoding example, and the packet
>> reading can be got from ffplay.c.
>
> Thanks for the pointers. Will look into that and ask again, if I have more
> detailed questions.
>
> Just one last thing: Is libav thread-safe? I plan to use libav in a Plugin
> for an application. My stuff will run in a separate thread. Will another
> plugin, in the same process but another thread, still be able to use libav
> without crashes?

Yes. Calls to avcodec_open() and avcodec_close() should be surrounded
by a mutex, and then it's threadsafe.

Ronald


More information about the libav-api mailing list