Hi,

On Tue, Nov 11, 2008 at 8:27 AM, Anatoliy <[EMAIL PROTECTED]> wrote:
> av_register_all();
> AVCodec* codec = avcodec_find_decoder(CODEC_ID_AAC); //successfully!!!
> AVCodecContext *c = avcodec_alloc_context();
> int err = avcodec_open(c, codec); //get error :-(
>
> Whats wrong with this code? Or may be AAC decoder not fully implemented
> right now?

You'd normally parse a raw AAC stream or get these kind of values from
the MP4 container, I'm talking about things such as bitrate,
samplerate, bits_per_sample, that kind of stuff in the AVCodecContext,
before calling avcodec_open(). Look at the _open() function in
aacdec.c to see what values need to be filled in exactly. The old
decoder (libfaad) did these checks during the decode() runs, from what
I remember.

Your code doesn't actually check that the return value of
_find_decoder() or _alloc_context() is not NULL, I'm assuming here you
left it out but your real code should check or that (memory alloc
error or decoder doesn't exist).

Ronald
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to