crossbridge-community / crossbridge

C/C++ Compiler for the ActionScript Virtual Machine (AVM2)
http://sourceforge.net/projects/crossbridge-community/
Other
151 stars 36 forks source link

Porting pure c speex codec to as3 swc #60

Closed truthtracer closed 10 years ago

truthtracer commented 10 years ago

Compiling ENV : Windows 2008 R2 64bit jdk1.8.0_05 64bit CrossBridge_15.0.0.3 Flash Professional cs6

Every thing compiled well but swc will stack overflow when I call the function from swf :

    Error: Error #1023: Stack overflow occurred.
        at global/data.encoders.oggEncoder::F___vfprintf()
        at global/data.encoders.oggEncoder::F_vfprintf()
        at global/data.encoders.oggEncoder::F_printf()
        at global/data.encoders.oggEncoder::F_sb_encoder_ctl()
        at global/data.encoders.oggEncoder::F_speex_encoder_ctl()
        at global/data.encoders.oggEncoder::F_sb_encoder_ctl()
        ......

When I use the same code compile to exe under windows, the code works well and can encode wav to speex ogg file.

The Makefile : FLASCC=/cygdrive/d/crossbridge/sdk FLEX=/cygdrive/d/flex_sdk_4.6 CC=/cygdrive/d/crossbridge/sdk/usr/bin/gcc LOCAL_CFLAGS=-Werror=implicit-function-declaration -D USE_SMALLFT -D FIXED_POINT -D DISABLE_VBR -D MINIMIZE_SPEEX -D MINIMIZE_OGG

exe: $(CC) ./third/ogg/.c ./third/speex/.c ./*.c -I. -Ithird -o speex_ogg.exe $(LOCAL_CFLAGS)

release: $(CC) ./third/ogg/.c ./third/speex/.c ./*.c -I. -Ithird -O4 -emit-llvm -emit-swc=data.encoders.oggEncoder -o encoder-ogg-release.swc $(LOCAL_CFLAGS)

debug: $(CC) ./third/ogg/.c ./third/speex/.c ./*.c -I. -Ithird -g -O0 -emit-llvm -emit-swc=data.encoders.oggEncoder -o encoder-ogg-debug.swc $(LOCAL_CFLAGS)

clean: rm -f .swf .swc .o .exe

truthtracer commented 10 years ago

This is caused by Flash CS6, the swc used in a swf which compiled under crossbridge works well

vpmedia commented 10 years ago

Great! Maybe you have to overlay the AIR SDK into FL CS6 to solve this:

https://helpx.adobe.com/x-productkb/multi/overlay-air-sdk-flash-professional1.html

http://www.yeahbutisitflash.com/?p=4141

vpmedia commented 10 years ago

I'm closing this since the issue is not tied to CrossBridge, please re-open if you think otherwise. Also please share the Speex example in some repo. if possible, so we can fork it. Thanks!

truthtracer commented 10 years ago

Flash CS6 with update 3 will fix this issue