Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "libogg"]
path = libogg
url = git://git.xiph.org/mirrors/ogg.git
[submodule "ogg"]
path = ogg
url = https://git.xiph.org/ogg.git
23 changes: 14 additions & 9 deletions compileOgg.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
#!/bin/bash
set -e

# configure libogg
cd libogg
cd ogg
if [ ! -f configure ]; then
# generate configuration script
./autogen.sh

# -O20 and -04 cause problems
# see https://github.com/kripken/emscripten/issues/264
sed -i '' 's/-O20/-O2/g' configure
sed -i '' 's/-O4/-O2/g' configure

# finally, run configuration script
emconfigure ./configure --prefix="`pwd`" --disable-static
sed -i 's/-O20/-O2/g' configure
sed -i 's/-O4/-O2/g' configure
fi

# finally, run configuration script
emconfigure ./configure --prefix="`pwd`" --disable-shared --enable-static

# compile libogg
emmake make
emmake make install
emmake make -i install

# compile wrapper
cd ..
mkdir -p build
emcc -O3 -s RESERVED_FUNCTION_POINTERS=50 -s EXPORTED_FUNCTIONS="['_AVOggInit', '_AVOggRead', '_AVOggDestroy']" -I libogg/include -Llibogg/lib -logg src/ogg.c -o build/libogg.js
emcc -s WASM=0 \
-s RESERVED_FUNCTION_POINTERS=2 \
-s EXTRA_EXPORTED_RUNTIME_METHODS="['addFunction', 'removeFunction']" \
-s EXPORTED_FUNCTIONS="['_AVOggInit', '_AVOggRead', '_AVOggDestroy']" \
-O3 -I ogg/include src/ogg.c ogg/lib/libogg.a -o build/libogg.js --memory-init-file 0
echo "module.exports = Module" >> build/libogg.js
1 change: 0 additions & 1 deletion libogg
Submodule libogg deleted from ab7819
1 change: 1 addition & 0 deletions ogg
Submodule ogg added at 0acd32
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"av": "~0.4.0"
},
"devDependencies": {
"browserify": "^4.1.10",
"browserify": "^16.2.3",
"browserify-shim": "^3.5.0"
},
"browserify-shim": {
Expand Down
4 changes: 2 additions & 2 deletions src/ogg.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var OggDemuxer = AV.Demuxer.extend(function() {
// copy the stream in case we override it, e.g. flac
this._stream = this.stream;

this.callback = Ogg.Runtime.addFunction(function(packet, bytes) {
this.callback = Ogg.addFunction(function(packet, bytes) {
var data = new Uint8Array(Ogg.HEAPU8.subarray(packet, packet + bytes));

// find plugin for codec
Expand Down Expand Up @@ -60,7 +60,7 @@ var OggDemuxer = AV.Demuxer.extend(function() {

this.prototype.destroy = function() {
this._super();
Ogg.Runtime.removeFunction(this.callback);
Ogg.removeFunction(this.callback);
Ogg._AVOggDestroy(this.ogg);
Ogg._free(this.buf);

Expand Down