[Ffmpeg-devel] Re: error in avcodec_open with WMAv2
Osama Khan
oskhan
Tue Jul 12 15:47:47 CEST 2005
I just read on ur webpage that you require more information from the
debugger. Here is the additional output:
/****************************/
(gdb) bt
#0 0xb7ea88f8 in wma_decode_init (avctx=0x19000) at wmadec.c:357
#1 0xb7cc9390 in avcodec_open (avctx=0x804a020, codec=0x0) at utils.c:551
#2 0x08048812 in main (argc=1, argv=0xbffffa34) at example2.cpp:43
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0xb7ea88d8 to 0xb7ea8918:
0xb7ea88d8 <wma_decode_init+1960>: add %al,(%eax)
0xb7ea88da <wma_decode_init+1962>: mov 0xffffff8c(%ebp),%ecx
0xb7ea88dd <wma_decode_init+1965>: xor %esi,%esi
0xb7ea88df <wma_decode_init+1967>: sar %ecx
0xb7ea88e1 <wma_decode_init+1969>: mov %ecx,0xffffffbc(%ebp)
0xb7ea88e4 <wma_decode_init+1972>: movzwl 0xb7f83800(%esi,%esi,1),%eax
0xb7ea88ec <wma_decode_init+1980>: mov 0xffffffbc(%ebp),%edx
0xb7ea88ef <wma_decode_init+1983>: imul %ebx,%eax
0xb7ea88f2 <wma_decode_init+1986>: lea (%edx,%eax,2),%ecx
0xb7ea88f5 <wma_decode_init+1989>: mov %ecx,%eax
0xb7ea88f7 <wma_decode_init+1991>: cltd
0xb7ea88f8 <wma_decode_init+1992>: idivl 0xffffff8c(%ebp)
0xb7ea88fb <wma_decode_init+1995>: cmp %ebx,%eax
0xb7ea88fd <wma_decode_init+1997>: mov %eax,%ecx
0xb7ea88ff <wma_decode_init+1999>: jle 0xb7ea8903 <wma_decode_init+2003>
0xb7ea8901 <wma_decode_init+2001>: mov %ebx,%ecx
0xb7ea8903 <wma_decode_init+2003>: mov 0xffffffd0(%ebp),%edx
0xb7ea8906 <wma_decode_init+2006>: mov %ecx,%eax
0xb7ea8908 <wma_decode_init+2008>: sub %edx,%eax
0xb7ea890a <wma_decode_init+2010>: mov %ax,0x5c(%edi,%esi,2)
0xb7ea890f <wma_decode_init+2015>: cmp %ebx,%ecx
0xb7ea8911 <wma_decode_init+2017>: jge 0xb7ea8924 <wma_decode_init+2036>
0xb7ea8913 <wma_decode_init+2019>: mov %ecx,0xffffffd0(%ebp)
0xb7ea8916 <wma_decode_init+2022>: inc %esi
0xb7ea8917 <wma_decode_init+2023>: cmp $0x18,%esi
End of assembler dump.
(gdb) info all-registers
eax 0x19000 102400
ecx 0x19000 102400
edx 0x0 0
ebx 0x200 512
esp 0xbffff890 0xbffff890
ebp 0xbffff958 0xbffff958
esi 0x0 0
edi 0xb79b3020 -1214566368
eip 0xb7ea88f8 0xb7ea88f8
eflags 0x10246 66118
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
st0 0 (raw 0x00000000000000000000)
st1 0.5 (raw 0x3ffe8000000000000000)
st2 0 (raw 0x00000000000000000000)
st3 0 (raw 0x00000000000000000000)
st4 0 (raw 0x00000000000000000000)
st5 0 (raw 0x00000000000000000000)
st6 inf (raw 0x7fff8000000000000000)
st7 0.75 (raw 0x3ffec000000000000000)
fctrl 0x37f 895
fstat 0x3005 12293
ftag 0x1fff 8191
fiseg 0x73 115
fioff 0xb7ea8323 -1209367773
foseg 0x7b 123
fooff 0xbffff940 -1073743552
fop 0x145 325
xmm0 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm1 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm2 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm3 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm4 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm5 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm6 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm7 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0,
0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0,
0x0, 0x0, 0x0,
0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
mxcsr 0x1f80 8064
mm0 {uint64 = 0x8000000000000000, v2_int32 = {0x0,
0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x80}}
mm1 {uint64 = 0xc000000000000000, v2_int32 = {0x0,
0xc0000000}, v4_int16 = {0x0, 0x0, 0x0, 0xc000}, v8_int8 = {0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0xc0}}
---Type <return> to continue, or q <return> to quit---
mm2 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm3 {uint64 = 0x8000000000000000, v2_int32 = {0x0,
0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x80}}
mm4 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm5 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm6 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm7 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0,
0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
/***********************************/
On 7/12/05, Osama Khan <oskhan at gmail.com> wrote:
> Hi,
>
> 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.
>
>
> /***************************************/
>
> #include <stdlib.h>
> #include <stdio.h>
> #include <string.h>
> #include <math.h>
>
> //#ifdef HAVE_AV_CONFIG_H
> //#undef HAVE_AV_CONFIG_H
> //#endif
> //#ifndef UINT8
> //#define UINT8 uint8_t
> //#endif
> #include "/home/okhan/ffmpeg/libavcodec/avcodec.h"
>
> #define INBUF_SIZE 4096
>
> int main(int argc, char **argv)
> {
>
> AVCodec *codec;
> AVCodecContext *c= NULL;
>
> /* must be called before using avcodec lib */
> avcodec_init();
>
> /* register all the codecs (you can also register only the codec
> you wish to have smaller code */
> avcodec_register_all();
>
> printf("%d\n", avcodec_build());
>
> printf("Audio decoding\n");
>
> codec = avcodec_find_decoder(CODEC_ID_WMAV2);
> if (!codec) {
> fprintf(stderr, "codec not found\n");
> exit(1);
> }
>
> 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);
> }
>
> printf("opened codec\n");
> return 0;
> }
>
> /***************************************/
>
> I tried running it through the debugger and here is the output:
>
> /***************************************/
>
> okhan at cable:~$ g++ example2.cpp -lavcodec
> -L/home/okhan/ffmpeg/libavcodec -lavformat
> -L/home/okhan/ffmpeg/libavformat -g
> okhan at cable:~$ gdb a.out
> GNU gdb 6.3-debian
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "i386-linux"...Using host libthread_db
> library "/lib/tls/libthread_db.so.1".
>
> (gdb) run
> Starting program: /home/okhan/a.out
> 4757
> Audio decoding
> about to open codec
>
> 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);
> Current language: auto; currently c
> (gdb) quit
>
> /****************************************/
>
> Hope thats all that is required to solve this problem.
>
> Awaiting replies.
>
> Regards,
> Osama
>
More information about the ffmpeg-devel
mailing list