Pablos-Sanchez, Rolando
2001-Sep-04 10:00 UTC
[vorbis-dev] Problems trying to run the examples in windows vorbis sdk
I have just downloaded the vorbis sdk for windows, for researching purposes. I have compiled the example 'encoder_example.c' just to start, and it compiles, but I got a error in the following line just at the beginning: vorbis_encode_init(&vi,2,44100, -1, 128000, -1); The error is more or less: The instruction at '0xaddresss' referenced memory at '0xaddress'. The memory could not be "read". Something about bad pointed pointers, I think. So I haven't been able to start testing yet. I have tried with static link library and dynamic but nothing to do. Besides, with the static link I got the following linker errors: MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgheap.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgheap.obj) MSVCRT.lib(MSVCRT.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj) etc... Then I have downloaded the source and I got the same problem, but now I know in which exact line the error is. Inside the vorbisenc.c, we have the following function: static void codec_setup_partialcopy(codec_setup_info *ci, codec_setup_info *cs){ int i; memcpy(ci,cs,sizeof(codec_setup_info)); /* to get the flat numbers */ /* codebooks */ for(i=0;i<ci->books;i++){ ci->book_param[i]=cs->book_param[i]; } /* time backend settings */ for(i=0;i<ci->times;i++){ ci->time_param[i]=_time_P[ci->time_type[i]]-> // <---The error is in this line copy_info(cs->time_param[i]); } ... Finally, just to say that decoder_example.c compiles and works, so it seems that the problem is just encoding. I am using VC++ 6.0 under Windows 2000. If anyone knows how I can fix this problem, please, let me know. Thank you very much --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Chris Wolf
2001-Sep-05 02:12 UTC
[vorbis-dev] Problems trying to run the examples in windows vorbis sdk
On 9/4/2001 at 6:00 PM Pablos-Sanchez, Rolando wrote:>I have just downloaded the vorbis sdk for windows, for researching >purposes. > >I have compiled the example 'encoder_example.c' just to start, and it >compiles, but I got a error in the following line just at the beginning: >vorbis_encode_init(&vi,2,44100, -1, 128000, -1); >The error is more or less: The instruction at '0xaddresss' referenced >memory >at '0xaddress'. The memory could not be "read". >Something about bad pointed pointers, I think. >So I haven't been able to start testing yet. I have tried with static link >library and dynamic but nothing to do. > >Then I have downloaded the source and I got the same problem, but now I >know >in which exact line the error is. >Inside the vorbisenc.c, we have the following function: >static void codec_setup_partialcopy(codec_setup_info *ci, >codec_setup_info *cs){ >int i; >memcpy(ci,cs,sizeof(codec_setup_info)); /* to get the flat numbers */ >/* codebooks */ >for(i=0;i<ci->books;i++){ >ci->book_param[i]=cs->book_param[i]; >} >/* time backend settings */ >for(i=0;i<ci->times;i++){ >ci->time_param[i]=_time_P[ci->time_type[i]]-> // <---The error is in this >line >copy_info(cs->time_param[i]); >} >...The work around for this problem is to include vorbisenc.c in the vorbis DLL and not have a separate, stand alone vorbisenc.dll. If you do this, then this problem disappears. Obviously, since the vorbisenc code is quite large, and a lot of applications will only be decoding, this is not a permenent solution. This may have to do with how global data is treated in DLLs, which is that each client gets a fresh instance of the global data. The problem seems to be accessing _time_P accross DLLs (vorbisenc.dll accessing _time_P in vorbis.dll) I'm thinking of trying a named data segment. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.