On Tue, Nov 11, 2008 at 8:36 AM, Ronald S. Bultje <[EMAIL PROTECTED]> wrote: > 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). >
I'm not sure if it might be relevant here, but the ffmpeg code needs to be compiled with --enable-small or --disable-optimizations. For me the whole parser failed for the normal (no option'ed) configuration. Markus _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
