[Ffmpeg-devel] error in avcodec_open with WMAv2
Martin Boehme
boehme
Tue Jul 12 15:52:58 CEST 2005
Hi Osama,
> I am encountering an error while trying to use the WMA v2 decoder. The
> problem errors when i try to call avcodec_open(). Here is the piece of
> code im trying to run.
> [snip]
>
> c= avcodec_alloc_context();
>
> printf("about to open codec\n");
> /* open it */
> if (avcodec_open(c, codec) < 0) {
> fprintf(stderr, "could not open codec\n");
> exit(1);
> }
> [snip]
> Program received signal SIGFPE, Arithmetic exception.
> 0xb7ea8862 in wma_decode_init (avctx=0x19000) at wmadec.c:391
> 391 pos = ((block_len * 2 * a) + (b <<
> 1)) / (4 * b);
"b" in this line is the sample rate from the AVCodecContext -- this is
zero because you didn't specify it, hence the floating point
exception... ;-)
Solution: Specify sample rate, number of channels and bit rate before
opening codec (see libavcodec/apiexample.c).
HTH
Martin
--
Martin B?hme
Inst. f. Neuro- and Bioinformatics
Ratzeburger Allee 160, D-23538 Luebeck
Phone: +49 451 500 5514
Fax: +49 451 500 5502
boehme at inb.uni-luebeck.de
More information about the ffmpeg-devel
mailing list