gosu 0.7.16 → 0.7.17
Sign up to get free protection for your applications and to get access to all the features.
- data/Gosu/Version.hpp +2 -2
- data/GosuImpl/AudioFmod.cpp +7 -1
- data/GosuImpl/RubyGosuStub.mm +4 -1
- data/GosuImpl/RubyGosu_wrap.cxx +2 -2
- data/GosuImpl/TimingUnix.cpp +4 -1
- data/GosuImpl/TimingWin.cpp +31 -28
- data/GosuImpl/WindowWin.cpp +4 -0
- data/Rakefile +12 -18
- data/examples/ChipmunkIntegration.rb +1 -1
- data/examples/OpenGLIntegration.rb +1 -1
- data/examples/RMagickIntegration.rb +1 -1
- data/examples/Tutorial.cpp +2 -2
- data/examples/Tutorial.rb +1 -1
- data/lib/gosu/patches.rb +2 -2
- data/reference/cpp/_version_8hpp.html +4 -4
- data/reference/cpp/_version_8hpp_source.html +2 -2
- data/reference/rdoc/classes/Gosu.html +10 -10
- data/reference/rdoc/classes/Gosu/Color.html +3 -3
- data/reference/rdoc/classes/Gosu/Font.html +5 -5
- data/reference/rdoc/classes/Gosu/Image.html +9 -9
- data/reference/rdoc/classes/Gosu/Sample.html +3 -3
- data/reference/rdoc/classes/Gosu/SampleInstance.html +5 -5
- data/reference/rdoc/classes/Gosu/Song.html +7 -7
- data/reference/rdoc/classes/Gosu/TextInput.html +1 -1
- data/reference/rdoc/classes/Gosu/Window.html +17 -17
- data/reference/rdoc/classes/Numeric.html +2 -2
- data/reference/rdoc/created.rid +1 -1
- metadata +2 -912
- data/dependencies/libogg/AUTHORS +0 -4
- data/dependencies/libogg/CHANGES +0 -33
- data/dependencies/libogg/COPYING +0 -28
- data/dependencies/libogg/Makefile.am +0 -32
- data/dependencies/libogg/Makefile.in +0 -713
- data/dependencies/libogg/README +0 -103
- data/dependencies/libogg/aclocal.m4 +0 -6807
- data/dependencies/libogg/compile +0 -142
- data/dependencies/libogg/config.guess +0 -1465
- data/dependencies/libogg/config.h.in +0 -70
- data/dependencies/libogg/config.sub +0 -1569
- data/dependencies/libogg/configure +0 -23018
- data/dependencies/libogg/configure.in +0 -301
- data/dependencies/libogg/debian/changelog +0 -68
- data/dependencies/libogg/debian/control +0 -22
- data/dependencies/libogg/debian/copyright +0 -37
- data/dependencies/libogg/debian/libogg-dev.docs +0 -1
- data/dependencies/libogg/debian/libogg-dev.install +0 -8
- data/dependencies/libogg/debian/libogg0.README.Debian +0 -6
- data/dependencies/libogg/debian/libogg0.install +0 -1
- data/dependencies/libogg/debian/rules +0 -154
- data/dependencies/libogg/debian/watch +0 -3
- data/dependencies/libogg/depcomp +0 -529
- data/dependencies/libogg/doc/Makefile.am +0 -11
- data/dependencies/libogg/doc/Makefile.in +0 -518
- data/dependencies/libogg/doc/framing.html +0 -431
- data/dependencies/libogg/doc/index.html +0 -104
- data/dependencies/libogg/doc/libogg/Makefile.am +0 -28
- data/dependencies/libogg/doc/libogg/Makefile.in +0 -378
- data/dependencies/libogg/doc/libogg/bitpacking.html +0 -99
- data/dependencies/libogg/doc/libogg/datastructures.html +0 -59
- data/dependencies/libogg/doc/libogg/decoding.html +0 -100
- data/dependencies/libogg/doc/libogg/encoding.html +0 -64
- data/dependencies/libogg/doc/libogg/general.html +0 -105
- data/dependencies/libogg/doc/libogg/index.html +0 -39
- data/dependencies/libogg/doc/libogg/ogg_packet.html +0 -75
- data/dependencies/libogg/doc/libogg/ogg_packet_clear.html +0 -62
- data/dependencies/libogg/doc/libogg/ogg_page.html +0 -74
- data/dependencies/libogg/doc/libogg/ogg_page_bos.html +0 -65
- data/dependencies/libogg/doc/libogg/ogg_page_checksum_set.html +0 -62
- data/dependencies/libogg/doc/libogg/ogg_page_continued.html +0 -64
- data/dependencies/libogg/doc/libogg/ogg_page_eos.html +0 -65
- data/dependencies/libogg/doc/libogg/ogg_page_granulepos.html +0 -65
- data/dependencies/libogg/doc/libogg/ogg_page_packets.html +0 -75
- data/dependencies/libogg/doc/libogg/ogg_page_pageno.html +0 -63
- data/dependencies/libogg/doc/libogg/ogg_page_serialno.html +0 -63
- data/dependencies/libogg/doc/libogg/ogg_page_version.html +0 -63
- data/dependencies/libogg/doc/libogg/ogg_stream_clear.html +0 -61
- data/dependencies/libogg/doc/libogg/ogg_stream_destroy.html +0 -62
- data/dependencies/libogg/doc/libogg/ogg_stream_eos.html +0 -62
- data/dependencies/libogg/doc/libogg/ogg_stream_flush.html +0 -67
- data/dependencies/libogg/doc/libogg/ogg_stream_init.html +0 -66
- data/dependencies/libogg/doc/libogg/ogg_stream_packetin.html +0 -65
- data/dependencies/libogg/doc/libogg/ogg_stream_packetout.html +0 -71
- data/dependencies/libogg/doc/libogg/ogg_stream_packetpeek.html +0 -85
- data/dependencies/libogg/doc/libogg/ogg_stream_pagein.html +0 -67
- data/dependencies/libogg/doc/libogg/ogg_stream_pageout.html +0 -66
- data/dependencies/libogg/doc/libogg/ogg_stream_reset.html +0 -61
- data/dependencies/libogg/doc/libogg/ogg_stream_reset_serialno.html +0 -67
- data/dependencies/libogg/doc/libogg/ogg_stream_state.html +0 -121
- data/dependencies/libogg/doc/libogg/ogg_sync_buffer.html +0 -67
- data/dependencies/libogg/doc/libogg/ogg_sync_clear.html +0 -62
- data/dependencies/libogg/doc/libogg/ogg_sync_destroy.html +0 -62
- data/dependencies/libogg/doc/libogg/ogg_sync_init.html +0 -63
- data/dependencies/libogg/doc/libogg/ogg_sync_pageout.html +0 -79
- data/dependencies/libogg/doc/libogg/ogg_sync_pageseek.html +0 -68
- data/dependencies/libogg/doc/libogg/ogg_sync_reset.html +0 -63
- data/dependencies/libogg/doc/libogg/ogg_sync_state.html +0 -67
- data/dependencies/libogg/doc/libogg/ogg_sync_wrote.html +0 -73
- data/dependencies/libogg/doc/libogg/oggpack_adv.html +0 -64
- data/dependencies/libogg/doc/libogg/oggpack_adv1.html +0 -62
- data/dependencies/libogg/doc/libogg/oggpack_bits.html +0 -62
- data/dependencies/libogg/doc/libogg/oggpack_buffer.html +0 -66
- data/dependencies/libogg/doc/libogg/oggpack_bytes.html +0 -62
- data/dependencies/libogg/doc/libogg/oggpack_get_buffer.html +0 -62
- data/dependencies/libogg/doc/libogg/oggpack_look.html +0 -66
- data/dependencies/libogg/doc/libogg/oggpack_look1.html +0 -63
- data/dependencies/libogg/doc/libogg/oggpack_read.html +0 -65
- data/dependencies/libogg/doc/libogg/oggpack_read1.html +0 -63
- data/dependencies/libogg/doc/libogg/oggpack_readinit.html +0 -64
- data/dependencies/libogg/doc/libogg/oggpack_reset.html +0 -62
- data/dependencies/libogg/doc/libogg/oggpack_write.html +0 -68
- data/dependencies/libogg/doc/libogg/oggpack_writealign.html +0 -65
- data/dependencies/libogg/doc/libogg/oggpack_writeclear.html +0 -62
- data/dependencies/libogg/doc/libogg/oggpack_writecopy.html +0 -69
- data/dependencies/libogg/doc/libogg/oggpack_writeinit.html +0 -62
- data/dependencies/libogg/doc/libogg/oggpack_writetrunc.html +0 -65
- data/dependencies/libogg/doc/libogg/overview.html +0 -44
- data/dependencies/libogg/doc/libogg/reference.html +0 -93
- data/dependencies/libogg/doc/libogg/style.css +0 -7
- data/dependencies/libogg/doc/libogg/vorbis_comment.html +0 -70
- data/dependencies/libogg/doc/libogg/vorbis_info.html +0 -80
- data/dependencies/libogg/doc/ogg-multiplex.html +0 -445
- data/dependencies/libogg/doc/oggstream.html +0 -234
- data/dependencies/libogg/doc/rfc3533.txt +0 -843
- data/dependencies/libogg/doc/rfc3534.txt +0 -339
- data/dependencies/libogg/doc/stream.png +0 -0
- data/dependencies/libogg/doc/vorbisword2.png +0 -0
- data/dependencies/libogg/doc/white-ogg.png +0 -0
- data/dependencies/libogg/doc/white-xifish.png +0 -0
- data/dependencies/libogg/include/Makefile.am +0 -3
- data/dependencies/libogg/include/Makefile.in +0 -481
- data/dependencies/libogg/include/ogg/Makefile.am +0 -6
- data/dependencies/libogg/include/ogg/Makefile.in +0 -428
- data/dependencies/libogg/include/ogg/config_types.h.in +0 -11
- data/dependencies/libogg/include/ogg/ogg.h +0 -202
- data/dependencies/libogg/include/ogg/os_types.h +0 -127
- data/dependencies/libogg/install-sh +0 -323
- data/dependencies/libogg/libogg.spec +0 -106
- data/dependencies/libogg/libogg.spec.in +0 -106
- data/dependencies/libogg/ltmain.sh +0 -6426
- data/dependencies/libogg/macos/compat/strdup.c +0 -21
- data/dependencies/libogg/macos/compat/sys/types.h +0 -1
- data/dependencies/libogg/macos/libogg.mcp +0 -0
- data/dependencies/libogg/macos/libogg.mcp.exp +0 -64
- data/dependencies/libogg/macosx/English.lproj/InfoPlist.strings +0 -0
- data/dependencies/libogg/macosx/Info.plist +0 -30
- data/dependencies/libogg/macosx/Ogg.xcodeproj/project.pbxproj +0 -303
- data/dependencies/libogg/macosx/Ogg_Prefix.pch +0 -5
- data/dependencies/libogg/missing +0 -357
- data/dependencies/libogg/ogg-uninstalled.pc.in +0 -14
- data/dependencies/libogg/ogg.m4 +0 -102
- data/dependencies/libogg/ogg.pc.in +0 -14
- data/dependencies/libogg/src/Makefile.am +0 -28
- data/dependencies/libogg/src/Makefile.in +0 -536
- data/dependencies/libogg/src/bitwise.c +0 -784
- data/dependencies/libogg/src/framing.c +0 -1800
- data/dependencies/libogg/win32/Makefile.am +0 -5
- data/dependencies/libogg/win32/Makefile.in +0 -327
- data/dependencies/libogg/win32/build_ogg_dynamic.bat +0 -18
- data/dependencies/libogg/win32/build_ogg_dynamic_debug.bat +0 -18
- data/dependencies/libogg/win32/build_ogg_static.bat +0 -18
- data/dependencies/libogg/win32/build_ogg_static_debug.bat +0 -18
- data/dependencies/libogg/win32/ogg.def +0 -78
- data/dependencies/libogg/win32/ogg.dsw +0 -41
- data/dependencies/libogg/win32/ogg_dynamic.dsp +0 -128
- data/dependencies/libogg/win32/ogg_static.dsp +0 -108
- data/dependencies/libpng/ANNOUNCE +0 -61
- data/dependencies/libpng/CHANGES +0 -2173
- data/dependencies/libpng/INSTALL +0 -199
- data/dependencies/libpng/KNOWNBUG +0 -22
- data/dependencies/libpng/LICENSE +0 -109
- data/dependencies/libpng/README +0 -264
- data/dependencies/libpng/TODO +0 -24
- data/dependencies/libpng/Y2KINFO +0 -55
- data/dependencies/libpng/configure +0 -13
- data/dependencies/libpng/contrib/gregbook/COPYING +0 -340
- data/dependencies/libpng/contrib/gregbook/LICENSE +0 -50
- data/dependencies/libpng/contrib/gregbook/Makefile.mingw32 +0 -130
- data/dependencies/libpng/contrib/gregbook/Makefile.sgi +0 -104
- data/dependencies/libpng/contrib/gregbook/Makefile.unx +0 -132
- data/dependencies/libpng/contrib/gregbook/Makefile.w32 +0 -113
- data/dependencies/libpng/contrib/gregbook/README +0 -186
- data/dependencies/libpng/contrib/gregbook/makevms.com +0 -132
- data/dependencies/libpng/contrib/gregbook/readpng.c +0 -304
- data/dependencies/libpng/contrib/gregbook/readpng.h +0 -88
- data/dependencies/libpng/contrib/gregbook/readpng2.c +0 -645
- data/dependencies/libpng/contrib/gregbook/readpng2.h +0 -121
- data/dependencies/libpng/contrib/gregbook/readppm.c +0 -179
- data/dependencies/libpng/contrib/gregbook/rpng-win.c +0 -684
- data/dependencies/libpng/contrib/gregbook/rpng-x.c +0 -904
- data/dependencies/libpng/contrib/gregbook/rpng2-win.c +0 -1225
- data/dependencies/libpng/contrib/gregbook/rpng2-x.c +0 -2127
- data/dependencies/libpng/contrib/gregbook/toucan.png +0 -0
- data/dependencies/libpng/contrib/gregbook/wpng.c +0 -853
- data/dependencies/libpng/contrib/gregbook/writepng.c +0 -392
- data/dependencies/libpng/contrib/gregbook/writepng.h +0 -133
- data/dependencies/libpng/contrib/pngminim/decoder/README +0 -6
- data/dependencies/libpng/contrib/pngminim/decoder/gather.sh +0 -8
- data/dependencies/libpng/contrib/pngminim/decoder/makefile.std +0 -44
- data/dependencies/libpng/contrib/pngminim/decoder/pngusr.h +0 -67
- data/dependencies/libpng/contrib/pngminim/encoder/README +0 -6
- data/dependencies/libpng/contrib/pngminim/encoder/dummy_inflate.c +0 -27
- data/dependencies/libpng/contrib/pngminim/encoder/gather.sh +0 -9
- data/dependencies/libpng/contrib/pngminim/encoder/makefile.std +0 -43
- data/dependencies/libpng/contrib/pngminim/encoder/pngusr.h +0 -66
- data/dependencies/libpng/contrib/pngminus/README +0 -153
- data/dependencies/libpng/contrib/pngminus/makefile.std +0 -65
- data/dependencies/libpng/contrib/pngminus/makefile.tc3 +0 -38
- data/dependencies/libpng/contrib/pngminus/makevms.com +0 -92
- data/dependencies/libpng/contrib/pngminus/png2pnm.bat +0 -41
- data/dependencies/libpng/contrib/pngminus/png2pnm.c +0 -430
- data/dependencies/libpng/contrib/pngminus/png2pnm.sh +0 -42
- data/dependencies/libpng/contrib/pngminus/pngminus.bat +0 -4
- data/dependencies/libpng/contrib/pngminus/pngminus.sh +0 -5
- data/dependencies/libpng/contrib/pngminus/pnm2png.bat +0 -41
- data/dependencies/libpng/contrib/pngminus/pnm2png.c +0 -533
- data/dependencies/libpng/contrib/pngminus/pnm2png.sh +0 -42
- data/dependencies/libpng/contrib/pngsuite/basn0g01.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn0g02.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn0g04.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn0g08.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn0g16.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn2c08.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn2c16.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn3p01.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn3p02.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn3p04.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn3p08.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn4a08.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn4a16.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn6a08.png +0 -0
- data/dependencies/libpng/contrib/pngsuite/basn6a16.png +0 -0
- data/dependencies/libpng/contrib/visupng/PngFile.c +0 -439
- data/dependencies/libpng/contrib/visupng/PngFile.h +0 -27
- data/dependencies/libpng/contrib/visupng/README.txt +0 -58
- data/dependencies/libpng/contrib/visupng/VisualPng.c +0 -961
- data/dependencies/libpng/contrib/visupng/VisualPng.dsp +0 -147
- data/dependencies/libpng/contrib/visupng/VisualPng.dsw +0 -29
- data/dependencies/libpng/contrib/visupng/VisualPng.ico +0 -0
- data/dependencies/libpng/contrib/visupng/VisualPng.png +0 -0
- data/dependencies/libpng/contrib/visupng/VisualPng.rc +0 -152
- data/dependencies/libpng/contrib/visupng/cexcept.h +0 -243
- data/dependencies/libpng/contrib/visupng/resource.h +0 -23
- data/dependencies/libpng/example.c +0 -814
- data/dependencies/libpng/libpng-1.2.29.txt +0 -2906
- data/dependencies/libpng/libpng.3 +0 -3680
- data/dependencies/libpng/libpngpf.3 +0 -274
- data/dependencies/libpng/png.5 +0 -74
- data/dependencies/libpng/png.c +0 -798
- data/dependencies/libpng/png.h +0 -3569
- data/dependencies/libpng/pngbar.jpg +0 -0
- data/dependencies/libpng/pngbar.png +0 -0
- data/dependencies/libpng/pngconf.h +0 -1481
- data/dependencies/libpng/pngerror.c +0 -343
- data/dependencies/libpng/pnggccrd.c +0 -103
- data/dependencies/libpng/pngget.c +0 -901
- data/dependencies/libpng/pngmem.c +0 -608
- data/dependencies/libpng/pngnow.png +0 -0
- data/dependencies/libpng/pngpread.c +0 -1598
- data/dependencies/libpng/pngread.c +0 -1479
- data/dependencies/libpng/pngrio.c +0 -167
- data/dependencies/libpng/pngrtran.c +0 -4292
- data/dependencies/libpng/pngrutil.c +0 -3183
- data/dependencies/libpng/pngset.c +0 -1268
- data/dependencies/libpng/pngtest.c +0 -1563
- data/dependencies/libpng/pngtest.png +0 -0
- data/dependencies/libpng/pngtrans.c +0 -662
- data/dependencies/libpng/pngvcrd.c +0 -1
- data/dependencies/libpng/pngwio.c +0 -234
- data/dependencies/libpng/pngwrite.c +0 -1532
- data/dependencies/libpng/pngwtran.c +0 -572
- data/dependencies/libpng/pngwutil.c +0 -2802
- data/dependencies/libpng/projects/beos/x86-shared.proj +0 -0
- data/dependencies/libpng/projects/beos/x86-shared.txt +0 -22
- data/dependencies/libpng/projects/beos/x86-static.proj +0 -0
- data/dependencies/libpng/projects/beos/x86-static.txt +0 -22
- data/dependencies/libpng/projects/cbuilder5/libpng.bpf +0 -22
- data/dependencies/libpng/projects/cbuilder5/libpng.bpg +0 -25
- data/dependencies/libpng/projects/cbuilder5/libpng.bpr +0 -157
- data/dependencies/libpng/projects/cbuilder5/libpng.cpp +0 -29
- data/dependencies/libpng/projects/cbuilder5/libpng.readme.txt +0 -25
- data/dependencies/libpng/projects/cbuilder5/libpngstat.bpf +0 -22
- data/dependencies/libpng/projects/cbuilder5/libpngstat.bpr +0 -109
- data/dependencies/libpng/projects/cbuilder5/zlib.readme.txt +0 -14
- data/dependencies/libpng/projects/netware.txt +0 -6
- data/dependencies/libpng/projects/visualc6/README.txt +0 -57
- data/dependencies/libpng/projects/visualc6/libpng.dsp +0 -472
- data/dependencies/libpng/projects/visualc6/libpng.dsw +0 -59
- data/dependencies/libpng/projects/visualc6/pngtest.dsp +0 -314
- data/dependencies/libpng/projects/visualc71/PRJ0041.mak +0 -21
- data/dependencies/libpng/projects/visualc71/README.txt +0 -57
- data/dependencies/libpng/projects/visualc71/README_zlib.txt +0 -44
- data/dependencies/libpng/projects/visualc71/libpng.sln +0 -88
- data/dependencies/libpng/projects/visualc71/libpng.vcproj +0 -702
- data/dependencies/libpng/projects/visualc71/pngtest.vcproj +0 -459
- data/dependencies/libpng/projects/visualc71/zlib.vcproj +0 -670
- data/dependencies/libpng/projects/wince.txt +0 -6
- data/dependencies/libpng/scripts/CMakeLists.txt +0 -210
- data/dependencies/libpng/scripts/SCOPTIONS.ppc +0 -7
- data/dependencies/libpng/scripts/descrip.mms +0 -52
- data/dependencies/libpng/scripts/libpng-config-body.in +0 -96
- data/dependencies/libpng/scripts/libpng-config-head.in +0 -21
- data/dependencies/libpng/scripts/libpng-config.in +0 -124
- data/dependencies/libpng/scripts/libpng.icc +0 -44
- data/dependencies/libpng/scripts/libpng.pc-configure.in +0 -10
- data/dependencies/libpng/scripts/libpng.pc.in +0 -10
- data/dependencies/libpng/scripts/makefile.32sunu +0 -254
- data/dependencies/libpng/scripts/makefile.64sunu +0 -254
- data/dependencies/libpng/scripts/makefile.acorn +0 -51
- data/dependencies/libpng/scripts/makefile.aix +0 -113
- data/dependencies/libpng/scripts/makefile.amiga +0 -48
- data/dependencies/libpng/scripts/makefile.atari +0 -51
- data/dependencies/libpng/scripts/makefile.bc32 +0 -152
- data/dependencies/libpng/scripts/makefile.beos +0 -226
- data/dependencies/libpng/scripts/makefile.bor +0 -162
- data/dependencies/libpng/scripts/makefile.cygwin +0 -299
- data/dependencies/libpng/scripts/makefile.darwin +0 -234
- data/dependencies/libpng/scripts/makefile.dec +0 -214
- data/dependencies/libpng/scripts/makefile.dj2 +0 -55
- data/dependencies/libpng/scripts/makefile.elf +0 -275
- data/dependencies/libpng/scripts/makefile.freebsd +0 -48
- data/dependencies/libpng/scripts/makefile.gcc +0 -79
- data/dependencies/libpng/scripts/makefile.gcmmx +0 -271
- data/dependencies/libpng/scripts/makefile.hp64 +0 -235
- data/dependencies/libpng/scripts/makefile.hpgcc +0 -245
- data/dependencies/libpng/scripts/makefile.hpux +0 -232
- data/dependencies/libpng/scripts/makefile.ibmc +0 -71
- data/dependencies/libpng/scripts/makefile.intel +0 -102
- data/dependencies/libpng/scripts/makefile.knr +0 -99
- data/dependencies/libpng/scripts/makefile.linux +0 -249
- data/dependencies/libpng/scripts/makefile.mingw +0 -289
- data/dependencies/libpng/scripts/makefile.mips +0 -83
- data/dependencies/libpng/scripts/makefile.msc +0 -86
- data/dependencies/libpng/scripts/makefile.ne12bsd +0 -45
- data/dependencies/libpng/scripts/makefile.netbsd +0 -45
- data/dependencies/libpng/scripts/makefile.nommx +0 -252
- data/dependencies/libpng/scripts/makefile.openbsd +0 -73
- data/dependencies/libpng/scripts/makefile.os2 +0 -69
- data/dependencies/libpng/scripts/makefile.sco +0 -229
- data/dependencies/libpng/scripts/makefile.sggcc +0 -242
- data/dependencies/libpng/scripts/makefile.sgi +0 -245
- data/dependencies/libpng/scripts/makefile.so9 +0 -251
- data/dependencies/libpng/scripts/makefile.solaris +0 -249
- data/dependencies/libpng/scripts/makefile.solaris-x86 +0 -248
- data/dependencies/libpng/scripts/makefile.std +0 -92
- data/dependencies/libpng/scripts/makefile.sunos +0 -97
- data/dependencies/libpng/scripts/makefile.tc3 +0 -89
- data/dependencies/libpng/scripts/makefile.vcawin32 +0 -99
- data/dependencies/libpng/scripts/makefile.vcwin32 +0 -99
- data/dependencies/libpng/scripts/makefile.watcom +0 -109
- data/dependencies/libpng/scripts/makevms.com +0 -144
- data/dependencies/libpng/scripts/pngos2.def +0 -257
- data/dependencies/libpng/scripts/pngw32.def +0 -238
- data/dependencies/libpng/scripts/pngw32.rc +0 -112
- data/dependencies/libpng/scripts/smakefile.ppc +0 -30
- data/dependencies/libvorbis/AUTHORS +0 -3
- data/dependencies/libvorbis/CHANGES +0 -48
- data/dependencies/libvorbis/COPYING +0 -28
- data/dependencies/libvorbis/Makefile.am +0 -41
- data/dependencies/libvorbis/Makefile.in +0 -759
- data/dependencies/libvorbis/README +0 -132
- data/dependencies/libvorbis/acinclude.m4 +0 -161
- data/dependencies/libvorbis/aclocal.m4 +0 -7273
- data/dependencies/libvorbis/autogen.sh +0 -127
- data/dependencies/libvorbis/config.guess +0 -1500
- data/dependencies/libvorbis/config.h.in +0 -78
- data/dependencies/libvorbis/config.sub +0 -1616
- data/dependencies/libvorbis/configure +0 -22114
- data/dependencies/libvorbis/configure.in +0 -246
- data/dependencies/libvorbis/depcomp +0 -584
- data/dependencies/libvorbis/doc/Makefile +0 -665
- data/dependencies/libvorbis/doc/Makefile.am +0 -137
- data/dependencies/libvorbis/doc/Makefile.in +0 -665
- data/dependencies/libvorbis/doc/Vorbis_I_spec.html +0 -2292
- data/dependencies/libvorbis/doc/Vorbis_I_spec.pdf +0 -0
- data/dependencies/libvorbis/doc/components.png +0 -0
- data/dependencies/libvorbis/doc/draft-ietf-avt-rtp-vorbis-06.txt +0 -1401
- data/dependencies/libvorbis/doc/draft-ietf-avt-rtp-vorbis-06.xml +0 -1388
- data/dependencies/libvorbis/doc/eightphase.png +0 -0
- data/dependencies/libvorbis/doc/evenlsp.png +0 -0
- data/dependencies/libvorbis/doc/fish_xiph_org.png +0 -0
- data/dependencies/libvorbis/doc/floor1-1.png +0 -0
- data/dependencies/libvorbis/doc/floor1-2.png +0 -0
- data/dependencies/libvorbis/doc/floor1-3.png +0 -0
- data/dependencies/libvorbis/doc/floor1-4.png +0 -0
- data/dependencies/libvorbis/doc/floor1_inverse_dB_table.html +0 -154
- data/dependencies/libvorbis/doc/floorval.png +0 -0
- data/dependencies/libvorbis/doc/fourphase.png +0 -0
- data/dependencies/libvorbis/doc/framing.html +0 -431
- data/dependencies/libvorbis/doc/helper.html +0 -239
- data/dependencies/libvorbis/doc/hufftree-under.png +0 -0
- data/dependencies/libvorbis/doc/hufftree.png +0 -0
- data/dependencies/libvorbis/doc/index.html +0 -114
- data/dependencies/libvorbis/doc/lspmap.png +0 -0
- data/dependencies/libvorbis/doc/oddlsp.png +0 -0
- data/dependencies/libvorbis/doc/oggstream.html +0 -234
- data/dependencies/libvorbis/doc/programming.html +0 -554
- data/dependencies/libvorbis/doc/residue-pack.png +0 -0
- data/dependencies/libvorbis/doc/residue2.png +0 -0
- data/dependencies/libvorbis/doc/squarepolar.png +0 -0
- data/dependencies/libvorbis/doc/stereo.html +0 -418
- data/dependencies/libvorbis/doc/stream.png +0 -0
- data/dependencies/libvorbis/doc/v-comment.html +0 -285
- data/dependencies/libvorbis/doc/vorbis-clip.txt +0 -139
- data/dependencies/libvorbis/doc/vorbis-errors.txt +0 -103
- data/dependencies/libvorbis/doc/vorbis-fidelity.html +0 -180
- data/dependencies/libvorbis/doc/vorbis.html +0 -234
- data/dependencies/libvorbis/doc/vorbisenc/Makefile +0 -382
- data/dependencies/libvorbis/doc/vorbisenc/Makefile.am +0 -9
- data/dependencies/libvorbis/doc/vorbisenc/Makefile.in +0 -382
- data/dependencies/libvorbis/doc/vorbisenc/changes.html +0 -104
- data/dependencies/libvorbis/doc/vorbisenc/examples.html +0 -133
- data/dependencies/libvorbis/doc/vorbisenc/index.html +0 -40
- data/dependencies/libvorbis/doc/vorbisenc/ov_ectl_ratemanage2_arg.html +0 -92
- data/dependencies/libvorbis/doc/vorbisenc/ov_ectl_ratemanage_arg.html +0 -92
- data/dependencies/libvorbis/doc/vorbisenc/overview.html +0 -382
- data/dependencies/libvorbis/doc/vorbisenc/reference.html +0 -48
- data/dependencies/libvorbis/doc/vorbisenc/style.css +0 -7
- data/dependencies/libvorbis/doc/vorbisenc/vorbis_encode_ctl.html +0 -169
- data/dependencies/libvorbis/doc/vorbisenc/vorbis_encode_init.html +0 -88
- data/dependencies/libvorbis/doc/vorbisenc/vorbis_encode_init_vbr.html +0 -81
- data/dependencies/libvorbis/doc/vorbisenc/vorbis_encode_setup_init.html +0 -88
- data/dependencies/libvorbis/doc/vorbisenc/vorbis_encode_setup_managed.html +0 -102
- data/dependencies/libvorbis/doc/vorbisenc/vorbis_encode_setup_vbr.html +0 -90
- data/dependencies/libvorbis/doc/vorbisenc/vorbis_info.html +0 -81
- data/dependencies/libvorbis/doc/vorbisfile/Makefile +0 -396
- data/dependencies/libvorbis/doc/vorbisfile/Makefile.am +0 -23
- data/dependencies/libvorbis/doc/vorbisfile/Makefile.in +0 -396
- data/dependencies/libvorbis/doc/vorbisfile/OggVorbis_File.html +0 -137
- data/dependencies/libvorbis/doc/vorbisfile/callbacks.html +0 -121
- data/dependencies/libvorbis/doc/vorbisfile/chaining_example_c.html +0 -90
- data/dependencies/libvorbis/doc/vorbisfile/chainingexample.html +0 -175
- data/dependencies/libvorbis/doc/vorbisfile/crosslap.html +0 -121
- data/dependencies/libvorbis/doc/vorbisfile/datastructures.html +0 -61
- data/dependencies/libvorbis/doc/vorbisfile/decoding.html +0 -87
- data/dependencies/libvorbis/doc/vorbisfile/example.html +0 -208
- data/dependencies/libvorbis/doc/vorbisfile/exampleindex.html +0 -39
- data/dependencies/libvorbis/doc/vorbisfile/fileinfo.html +0 -95
- data/dependencies/libvorbis/doc/vorbisfile/index.html +0 -49
- data/dependencies/libvorbis/doc/vorbisfile/initialization.html +0 -118
- data/dependencies/libvorbis/doc/vorbisfile/ov_bitrate.html +0 -72
- data/dependencies/libvorbis/doc/vorbisfile/ov_bitrate_instant.html +0 -65
- data/dependencies/libvorbis/doc/vorbisfile/ov_callbacks.html +0 -117
- data/dependencies/libvorbis/doc/vorbisfile/ov_clear.html +0 -64
- data/dependencies/libvorbis/doc/vorbisfile/ov_comment.html +0 -66
- data/dependencies/libvorbis/doc/vorbisfile/ov_crosslap.html +0 -100
- data/dependencies/libvorbis/doc/vorbisfile/ov_fopen.html +0 -124
- data/dependencies/libvorbis/doc/vorbisfile/ov_info.html +0 -64
- data/dependencies/libvorbis/doc/vorbisfile/ov_open.html +0 -183
- data/dependencies/libvorbis/doc/vorbisfile/ov_open_callbacks.html +0 -147
- data/dependencies/libvorbis/doc/vorbisfile/ov_pcm_seek.html +0 -83
- data/dependencies/libvorbis/doc/vorbisfile/ov_pcm_seek_lap.html +0 -103
- data/dependencies/libvorbis/doc/vorbisfile/ov_pcm_seek_page.html +0 -84
- data/dependencies/libvorbis/doc/vorbisfile/ov_pcm_seek_page_lap.html +0 -112
- data/dependencies/libvorbis/doc/vorbisfile/ov_pcm_tell.html +0 -63
- data/dependencies/libvorbis/doc/vorbisfile/ov_pcm_total.html +0 -67
- data/dependencies/libvorbis/doc/vorbisfile/ov_raw_seek.html +0 -83
- data/dependencies/libvorbis/doc/vorbisfile/ov_raw_seek_lap.html +0 -110
- data/dependencies/libvorbis/doc/vorbisfile/ov_raw_tell.html +0 -65
- data/dependencies/libvorbis/doc/vorbisfile/ov_raw_total.html +0 -68
- data/dependencies/libvorbis/doc/vorbisfile/ov_read.html +0 -123
- data/dependencies/libvorbis/doc/vorbisfile/ov_read_float.html +0 -101
- data/dependencies/libvorbis/doc/vorbisfile/ov_seekable.html +0 -63
- data/dependencies/libvorbis/doc/vorbisfile/ov_serialnumber.html +0 -67
- data/dependencies/libvorbis/doc/vorbisfile/ov_streams.html +0 -64
- data/dependencies/libvorbis/doc/vorbisfile/ov_test.html +0 -101
- data/dependencies/libvorbis/doc/vorbisfile/ov_test_callbacks.html +0 -111
- data/dependencies/libvorbis/doc/vorbisfile/ov_test_open.html +0 -82
- data/dependencies/libvorbis/doc/vorbisfile/ov_time_seek.html +0 -82
- data/dependencies/libvorbis/doc/vorbisfile/ov_time_seek_lap.html +0 -105
- data/dependencies/libvorbis/doc/vorbisfile/ov_time_seek_page.html +0 -83
- data/dependencies/libvorbis/doc/vorbisfile/ov_time_seek_page_lap.html +0 -112
- data/dependencies/libvorbis/doc/vorbisfile/ov_time_tell.html +0 -63
- data/dependencies/libvorbis/doc/vorbisfile/ov_time_total.html +0 -67
- data/dependencies/libvorbis/doc/vorbisfile/overview.html +0 -61
- data/dependencies/libvorbis/doc/vorbisfile/reference.html +0 -83
- data/dependencies/libvorbis/doc/vorbisfile/return.html +0 -77
- data/dependencies/libvorbis/doc/vorbisfile/seekexample.html +0 -152
- data/dependencies/libvorbis/doc/vorbisfile/seeking.html +0 -107
- data/dependencies/libvorbis/doc/vorbisfile/seeking_example_c.html +0 -86
- data/dependencies/libvorbis/doc/vorbisfile/seeking_test_c.html +0 -86
- data/dependencies/libvorbis/doc/vorbisfile/seekingexample.html +0 -203
- data/dependencies/libvorbis/doc/vorbisfile/style.css +0 -7
- data/dependencies/libvorbis/doc/vorbisfile/threads.html +0 -50
- data/dependencies/libvorbis/doc/vorbisfile/vorbis_comment.html +0 -70
- data/dependencies/libvorbis/doc/vorbisfile/vorbis_info.html +0 -80
- data/dependencies/libvorbis/doc/vorbisfile/vorbisfile_example_c.html +0 -106
- data/dependencies/libvorbis/doc/vorbisword2.png +0 -0
- data/dependencies/libvorbis/doc/wait.png +0 -0
- data/dependencies/libvorbis/doc/white-ogg.png +0 -0
- data/dependencies/libvorbis/doc/white-xifish.png +0 -0
- data/dependencies/libvorbis/doc/window1.png +0 -0
- data/dependencies/libvorbis/doc/window2.png +0 -0
- data/dependencies/libvorbis/doc/xifish.pdf +0 -0
- data/dependencies/libvorbis/doc/xml/01-introduction.xml +0 -665
- data/dependencies/libvorbis/doc/xml/02-bitpacking.xml +0 -280
- data/dependencies/libvorbis/doc/xml/03-codebook.xml +0 -458
- data/dependencies/libvorbis/doc/xml/04-codec.xml +0 -711
- data/dependencies/libvorbis/doc/xml/05-comment.xml +0 -284
- data/dependencies/libvorbis/doc/xml/06-floor0.xml +0 -257
- data/dependencies/libvorbis/doc/xml/07-floor1.xml +0 -450
- data/dependencies/libvorbis/doc/xml/08-residue.xml +0 -492
- data/dependencies/libvorbis/doc/xml/09-helper.xml +0 -211
- data/dependencies/libvorbis/doc/xml/10-tables.xml +0 -94
- data/dependencies/libvorbis/doc/xml/TODO +0 -28
- data/dependencies/libvorbis/doc/xml/Vorbis_I_spec.xml +0 -30
- data/dependencies/libvorbis/doc/xml/a1-encapsulation_ogg.xml +0 -201
- data/dependencies/libvorbis/doc/xml/a2-encapsulation_rtp.xml +0 -31
- data/dependencies/libvorbis/doc/xml/footer.xml +0 -60
- data/dependencies/libvorbis/doc/xml/spec-common.xsl +0 -24
- data/dependencies/libvorbis/doc/xml/spec-fo.xsl +0 -16
- data/dependencies/libvorbis/doc/xml/spec-html.xsl +0 -5
- data/dependencies/libvorbis/examples/Makefile +0 -515
- data/dependencies/libvorbis/examples/Makefile.am +0 -28
- data/dependencies/libvorbis/examples/Makefile.in +0 -515
- data/dependencies/libvorbis/examples/chaining_example.c +0 -72
- data/dependencies/libvorbis/examples/decoder_example.c +0 -307
- data/dependencies/libvorbis/examples/encoder_example.c +0 -253
- data/dependencies/libvorbis/examples/frameview.pl +0 -630
- data/dependencies/libvorbis/examples/seeking_example.c +0 -256
- data/dependencies/libvorbis/examples/vorbisfile_example.c +0 -87
- data/dependencies/libvorbis/include/Makefile.am +0 -3
- data/dependencies/libvorbis/include/Makefile.in +0 -506
- data/dependencies/libvorbis/include/vorbis/Makefile.am +0 -7
- data/dependencies/libvorbis/include/vorbis/Makefile.in +0 -426
- data/dependencies/libvorbis/include/vorbis/codec.h +0 -241
- data/dependencies/libvorbis/include/vorbis/vorbisenc.h +0 -112
- data/dependencies/libvorbis/include/vorbis/vorbisfile.h +0 -183
- data/dependencies/libvorbis/install-sh +0 -507
- data/dependencies/libvorbis/lib/Makefile.am +0 -44
- data/dependencies/libvorbis/lib/Makefile.in +0 -706
- data/dependencies/libvorbis/lib/analysis.c +0 -121
- data/dependencies/libvorbis/lib/backends.h +0 -146
- data/dependencies/libvorbis/lib/barkmel.c +0 -64
- data/dependencies/libvorbis/lib/bitrate.c +0 -253
- data/dependencies/libvorbis/lib/bitrate.h +0 -59
- data/dependencies/libvorbis/lib/block.c +0 -993
- data/dependencies/libvorbis/lib/books/Makefile.am +0 -3
- data/dependencies/libvorbis/lib/books/Makefile.in +0 -506
- data/dependencies/libvorbis/lib/books/coupled/Makefile.am +0 -3
- data/dependencies/libvorbis/lib/books/coupled/Makefile.in +0 -347
- data/dependencies/libvorbis/lib/books/coupled/res_books_stereo.h +0 -20681
- data/dependencies/libvorbis/lib/books/floor/Makefile.am +0 -3
- data/dependencies/libvorbis/lib/books/floor/Makefile.in +0 -347
- data/dependencies/libvorbis/lib/books/floor/floor_books.h +0 -1838
- data/dependencies/libvorbis/lib/books/uncoupled/Makefile.am +0 -3
- data/dependencies/libvorbis/lib/books/uncoupled/Makefile.in +0 -347
- data/dependencies/libvorbis/lib/books/uncoupled/res_books_uncoupled.h +0 -11517
- data/dependencies/libvorbis/lib/codebook.c +0 -634
- data/dependencies/libvorbis/lib/codebook.h +0 -160
- data/dependencies/libvorbis/lib/codec_internal.h +0 -137
- data/dependencies/libvorbis/lib/envelope.c +0 -382
- data/dependencies/libvorbis/lib/envelope.h +0 -81
- data/dependencies/libvorbis/lib/floor0.c +0 -223
- data/dependencies/libvorbis/lib/floor1.c +0 -1094
- data/dependencies/libvorbis/lib/highlevel.h +0 -57
- data/dependencies/libvorbis/lib/info.c +0 -644
- data/dependencies/libvorbis/lib/lookup.c +0 -94
- data/dependencies/libvorbis/lib/lookup.h +0 -32
- data/dependencies/libvorbis/lib/lookup_data.h +0 -189
- data/dependencies/libvorbis/lib/lookups.pl +0 -142
- data/dependencies/libvorbis/lib/lpc.c +0 -149
- data/dependencies/libvorbis/lib/lpc.h +0 -29
- data/dependencies/libvorbis/lib/lsp.c +0 -455
- data/dependencies/libvorbis/lib/lsp.h +0 -28
- data/dependencies/libvorbis/lib/mapping0.c +0 -844
- data/dependencies/libvorbis/lib/masking.h +0 -785
- data/dependencies/libvorbis/lib/mdct.c +0 -564
- data/dependencies/libvorbis/lib/mdct.h +0 -83
- data/dependencies/libvorbis/lib/misc.h +0 -52
- data/dependencies/libvorbis/lib/modes/Makefile.am +0 -6
- data/dependencies/libvorbis/lib/modes/Makefile.in +0 -351
- data/dependencies/libvorbis/lib/modes/floor_all.h +0 -248
- data/dependencies/libvorbis/lib/modes/psych_11.h +0 -51
- data/dependencies/libvorbis/lib/modes/psych_16.h +0 -136
- data/dependencies/libvorbis/lib/modes/psych_44.h +0 -666
- data/dependencies/libvorbis/lib/modes/psych_8.h +0 -102
- data/dependencies/libvorbis/lib/modes/residue_16.h +0 -163
- data/dependencies/libvorbis/lib/modes/residue_44.h +0 -294
- data/dependencies/libvorbis/lib/modes/residue_44u.h +0 -318
- data/dependencies/libvorbis/lib/modes/residue_8.h +0 -109
- data/dependencies/libvorbis/lib/modes/setup_11.h +0 -141
- data/dependencies/libvorbis/lib/modes/setup_16.h +0 -149
- data/dependencies/libvorbis/lib/modes/setup_22.h +0 -128
- data/dependencies/libvorbis/lib/modes/setup_32.h +0 -132
- data/dependencies/libvorbis/lib/modes/setup_44.h +0 -107
- data/dependencies/libvorbis/lib/modes/setup_44u.h +0 -74
- data/dependencies/libvorbis/lib/modes/setup_8.h +0 -146
- data/dependencies/libvorbis/lib/modes/setup_X.h +0 -226
- data/dependencies/libvorbis/lib/os.h +0 -156
- data/dependencies/libvorbis/lib/psy.c +0 -1227
- data/dependencies/libvorbis/lib/psy.h +0 -186
- data/dependencies/libvorbis/lib/psytune.c +0 -524
- data/dependencies/libvorbis/lib/registry.c +0 -46
- data/dependencies/libvorbis/lib/registry.h +0 -32
- data/dependencies/libvorbis/lib/res0.c +0 -919
- data/dependencies/libvorbis/lib/scales.h +0 -86
- data/dependencies/libvorbis/lib/sharedbook.c +0 -735
- data/dependencies/libvorbis/lib/smallft.c +0 -1255
- data/dependencies/libvorbis/lib/smallft.h +0 -34
- data/dependencies/libvorbis/lib/synthesis.c +0 -170
- data/dependencies/libvorbis/lib/tone.c +0 -54
- data/dependencies/libvorbis/lib/vorbisenc.c +0 -1184
- data/dependencies/libvorbis/lib/vorbisfile.c +0 -2194
- data/dependencies/libvorbis/lib/window.c +0 -2136
- data/dependencies/libvorbis/lib/window.h +0 -26
- data/dependencies/libvorbis/libvorbis.spec +0 -118
- data/dependencies/libvorbis/libvorbis.spec.in +0 -118
- data/dependencies/libvorbis/ltmain.sh +0 -6871
- data/dependencies/libvorbis/macos/compat/strdup.c +0 -21
- data/dependencies/libvorbis/macos/compat/sys/types.h +0 -1
- data/dependencies/libvorbis/macos/decoder_example.mcp +0 -0
- data/dependencies/libvorbis/macos/encoder_example.mcp +0 -0
- data/dependencies/libvorbis/macos/libvorbis.mcp +0 -0
- data/dependencies/libvorbis/macos/libvorbis.mcp.exp +0 -45
- data/dependencies/libvorbis/macos/libvorbisenc.mcp +0 -0
- data/dependencies/libvorbis/macos/libvorbisenc.mcp.exp +0 -8
- data/dependencies/libvorbis/macos/libvorbisfile.mcp +0 -0
- data/dependencies/libvorbis/macos/libvorbisfile.mcp.exp +0 -45
- data/dependencies/libvorbis/macos/vorbis.mcp +0 -0
- data/dependencies/libvorbis/macosx/English.lproj/InfoPlist.strings +0 -0
- data/dependencies/libvorbis/macosx/Info.plist +0 -30
- data/dependencies/libvorbis/macosx/Vorbis.xcodeproj/project.pbxproj +0 -893
- data/dependencies/libvorbis/missing +0 -367
- data/dependencies/libvorbis/symbian/bld.inf +0 -35
- data/dependencies/libvorbis/symbian/config.h +0 -54
- data/dependencies/libvorbis/symbian/vorbis.mmp +0 -43
- data/dependencies/libvorbis/todo.txt +0 -22
- data/dependencies/libvorbis/vorbis-uninstalled.pc.in +0 -14
- data/dependencies/libvorbis/vorbis.m4 +0 -122
- data/dependencies/libvorbis/vorbis.pc.in +0 -14
- data/dependencies/libvorbis/vorbisenc-uninstalled.pc.in +0 -14
- data/dependencies/libvorbis/vorbisenc.pc.in +0 -14
- data/dependencies/libvorbis/vorbisfile-uninstalled.pc.in +0 -14
- data/dependencies/libvorbis/vorbisfile.pc.in +0 -14
- data/dependencies/libvorbis/vq/16.vqs +0 -77
- data/dependencies/libvorbis/vq/16u.vqs +0 -71
- data/dependencies/libvorbis/vq/44c-1.vqs +0 -63
- data/dependencies/libvorbis/vq/44c0.vqs +0 -65
- data/dependencies/libvorbis/vq/44c1.vqs +0 -66
- data/dependencies/libvorbis/vq/44c2.vqs +0 -37
- data/dependencies/libvorbis/vq/44c3.vqs +0 -36
- data/dependencies/libvorbis/vq/44c4.vqs +0 -36
- data/dependencies/libvorbis/vq/44c5.vqs +0 -37
- data/dependencies/libvorbis/vq/44c6.vqs +0 -37
- data/dependencies/libvorbis/vq/44c7.vqs +0 -38
- data/dependencies/libvorbis/vq/44c8.vqs +0 -39
- data/dependencies/libvorbis/vq/44c9.vqs +0 -37
- data/dependencies/libvorbis/vq/44u0.vqs +0 -33
- data/dependencies/libvorbis/vq/44u1.vqs +0 -33
- data/dependencies/libvorbis/vq/44u2.vqs +0 -32
- data/dependencies/libvorbis/vq/44u3.vqs +0 -33
- data/dependencies/libvorbis/vq/44u4.vqs +0 -33
- data/dependencies/libvorbis/vq/44u5.vqs +0 -35
- data/dependencies/libvorbis/vq/44u6.vqs +0 -35
- data/dependencies/libvorbis/vq/44u7.vqs +0 -34
- data/dependencies/libvorbis/vq/44u8.vqs +0 -35
- data/dependencies/libvorbis/vq/44u9.vqs +0 -36
- data/dependencies/libvorbis/vq/8.vqs +0 -43
- data/dependencies/libvorbis/vq/8u.vqs +0 -41
- data/dependencies/libvorbis/vq/Makefile +0 -532
- data/dependencies/libvorbis/vq/Makefile.am +0 -34
- data/dependencies/libvorbis/vq/Makefile.in +0 -532
- data/dependencies/libvorbis/vq/auxpartition.pl +0 -71
- data/dependencies/libvorbis/vq/bookutil.c +0 -717
- data/dependencies/libvorbis/vq/bookutil.h +0 -43
- data/dependencies/libvorbis/vq/build.c +0 -195
- data/dependencies/libvorbis/vq/cascade.c +0 -91
- data/dependencies/libvorbis/vq/distribution.c +0 -248
- data/dependencies/libvorbis/vq/floor_11.vqs +0 -10
- data/dependencies/libvorbis/vq/floor_22.vqs +0 -27
- data/dependencies/libvorbis/vq/floor_44.vqs +0 -83
- data/dependencies/libvorbis/vq/genericdata.c +0 -61
- data/dependencies/libvorbis/vq/huffbuild.c +0 -201
- data/dependencies/libvorbis/vq/latticebuild.c +0 -177
- data/dependencies/libvorbis/vq/latticehint.c +0 -430
- data/dependencies/libvorbis/vq/latticepare.c +0 -595
- data/dependencies/libvorbis/vq/latticetune.c +0 -164
- data/dependencies/libvorbis/vq/localcodebook.h +0 -160
- data/dependencies/libvorbis/vq/lspdata.c +0 -157
- data/dependencies/libvorbis/vq/make_floor_books.pl +0 -108
- data/dependencies/libvorbis/vq/make_residue_books.pl +0 -187
- data/dependencies/libvorbis/vq/metrics.c +0 -295
- data/dependencies/libvorbis/vq/residue_entropy +0 -58
- data/dependencies/libvorbis/vq/residuedata.c +0 -160
- data/dependencies/libvorbis/vq/residuesplit.c +0 -282
- data/dependencies/libvorbis/vq/run.c +0 -216
- data/dependencies/libvorbis/vq/train.c +0 -364
- data/dependencies/libvorbis/vq/vqext.h +0 -34
- data/dependencies/libvorbis/vq/vqgen.c +0 -567
- data/dependencies/libvorbis/vq/vqgen.h +0 -85
- data/dependencies/libvorbis/vq/vqsplit.c +0 -612
- data/dependencies/libvorbis/vq/vqsplit.h +0 -37
- data/dependencies/libvorbis/win32/VS2003/libvorbis/libvorbis.vcproj +0 -467
- data/dependencies/libvorbis/win32/VS2003/libvorbisfile/libvorbisfile.def +0 -47
- data/dependencies/libvorbis/win32/VS2003/libvorbisfile/libvorbisfile.vcproj +0 -147
- data/dependencies/libvorbis/win32/VS2003/vorbisdec/vorbisdec.vcproj +0 -268
- data/dependencies/libvorbis/win32/VS2003/vorbisenc/vorbisenc.vcproj +0 -268
- data/dependencies/libvorbis/win32/VS2005/libvorbis/libvorbis.vcproj +0 -653
- data/dependencies/libvorbis/win32/VS2005/libvorbisfile/libvorbisfile.def +0 -47
- data/dependencies/libvorbis/win32/VS2005/libvorbisfile/libvorbisfile.vcproj +0 -219
- data/dependencies/libvorbis/win32/VS2005/vorbisdec/vorbisdec.vcproj +0 -389
- data/dependencies/libvorbis/win32/VS2005/vorbisenc/vorbisenc.vcproj +0 -390
- data/dependencies/libvorbis/win32/build_vorbis_dynamic.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbis_dynamic_debug.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbis_static.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbis_static_debug.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisenc_dynamic.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisenc_dynamic_debug.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisenc_static.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisenc_static_debug.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisfile_dynamic.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisfile_dynamic_debug.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisfile_static.bat +0 -19
- data/dependencies/libvorbis/win32/build_vorbisfile_static_debug.bat +0 -19
- data/dependencies/libvorbis/win32/vorbis.def +0 -57
- data/dependencies/libvorbis/win32/vorbis.dsw +0 -101
- data/dependencies/libvorbis/win32/vorbis_dynamic.dsp +0 -281
- data/dependencies/libvorbis/win32/vorbis_static.dsp +0 -257
- data/dependencies/libvorbis/win32/vorbisenc.def +0 -13
- data/dependencies/libvorbis/win32/vorbisenc_dynamic.dsp +0 -121
- data/dependencies/libvorbis/win32/vorbisenc_static.dsp +0 -100
- data/dependencies/libvorbis/win32/vorbisfile.def +0 -41
- data/dependencies/libvorbis/win32/vorbisfile_dynamic.dsp +0 -119
- data/dependencies/libvorbis/win32/vorbisfile_static.dsp +0 -100
- data/dependencies/zlib/ChangeLog +0 -855
- data/dependencies/zlib/FAQ +0 -339
- data/dependencies/zlib/INDEX +0 -51
- data/dependencies/zlib/Makefile +0 -154
- data/dependencies/zlib/Makefile.in +0 -154
- data/dependencies/zlib/README +0 -125
- data/dependencies/zlib/adler32.c +0 -149
- data/dependencies/zlib/algorithm.txt +0 -209
- data/dependencies/zlib/amiga/Makefile.pup +0 -66
- data/dependencies/zlib/amiga/Makefile.sas +0 -65
- data/dependencies/zlib/as400/bndsrc +0 -132
- data/dependencies/zlib/as400/compile.clp +0 -123
- data/dependencies/zlib/as400/readme.txt +0 -111
- data/dependencies/zlib/as400/zlib.inc +0 -331
- data/dependencies/zlib/compress.c +0 -79
- data/dependencies/zlib/configure +0 -459
- data/dependencies/zlib/contrib/README.contrib +0 -71
- data/dependencies/zlib/contrib/ada/buffer_demo.adb +0 -106
- data/dependencies/zlib/contrib/ada/mtest.adb +0 -156
- data/dependencies/zlib/contrib/ada/read.adb +0 -156
- data/dependencies/zlib/contrib/ada/readme.txt +0 -65
- data/dependencies/zlib/contrib/ada/test.adb +0 -463
- data/dependencies/zlib/contrib/ada/zlib-streams.adb +0 -225
- data/dependencies/zlib/contrib/ada/zlib-streams.ads +0 -114
- data/dependencies/zlib/contrib/ada/zlib-thin.adb +0 -141
- data/dependencies/zlib/contrib/ada/zlib-thin.ads +0 -450
- data/dependencies/zlib/contrib/ada/zlib.adb +0 -701
- data/dependencies/zlib/contrib/ada/zlib.ads +0 -328
- data/dependencies/zlib/contrib/ada/zlib.gpr +0 -20
- data/dependencies/zlib/contrib/asm586/README.586 +0 -43
- data/dependencies/zlib/contrib/asm586/match.S +0 -364
- data/dependencies/zlib/contrib/asm686/README.686 +0 -34
- data/dependencies/zlib/contrib/asm686/match.S +0 -329
- data/dependencies/zlib/contrib/blast/Makefile +0 -8
- data/dependencies/zlib/contrib/blast/README +0 -4
- data/dependencies/zlib/contrib/blast/blast.c +0 -444
- data/dependencies/zlib/contrib/blast/blast.h +0 -71
- data/dependencies/zlib/contrib/blast/test.pk +0 -0
- data/dependencies/zlib/contrib/blast/test.txt +0 -1
- data/dependencies/zlib/contrib/delphi/ZLib.pas +0 -557
- data/dependencies/zlib/contrib/delphi/ZLibConst.pas +0 -11
- data/dependencies/zlib/contrib/delphi/readme.txt +0 -76
- data/dependencies/zlib/contrib/delphi/zlibd32.mak +0 -93
- data/dependencies/zlib/contrib/dotzlib/DotZLib.build +0 -33
- data/dependencies/zlib/contrib/dotzlib/DotZLib.chm +0 -0
- data/dependencies/zlib/contrib/dotzlib/DotZLib.sln +0 -21
- data/dependencies/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +0 -58
- data/dependencies/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +0 -202
- data/dependencies/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +0 -83
- data/dependencies/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +0 -198
- data/dependencies/zlib/contrib/dotzlib/DotZLib/Deflater.cs +0 -106
- data/dependencies/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +0 -288
- data/dependencies/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +0 -141
- data/dependencies/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +0 -301
- data/dependencies/zlib/contrib/dotzlib/DotZLib/Inflater.cs +0 -105
- data/dependencies/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +0 -274
- data/dependencies/zlib/contrib/dotzlib/LICENSE_1_0.txt +0 -23
- data/dependencies/zlib/contrib/dotzlib/readme.txt +0 -58
- data/dependencies/zlib/contrib/infback9/README +0 -1
- data/dependencies/zlib/contrib/infback9/infback9.c +0 -608
- data/dependencies/zlib/contrib/infback9/infback9.h +0 -37
- data/dependencies/zlib/contrib/infback9/inffix9.h +0 -107
- data/dependencies/zlib/contrib/infback9/inflate9.h +0 -47
- data/dependencies/zlib/contrib/infback9/inftree9.c +0 -323
- data/dependencies/zlib/contrib/infback9/inftree9.h +0 -55
- data/dependencies/zlib/contrib/inflate86/inffas86.c +0 -1157
- data/dependencies/zlib/contrib/inflate86/inffast.S +0 -1368
- data/dependencies/zlib/contrib/iostream/test.cpp +0 -24
- data/dependencies/zlib/contrib/iostream/zfstream.cpp +0 -329
- data/dependencies/zlib/contrib/iostream/zfstream.h +0 -128
- data/dependencies/zlib/contrib/iostream2/zstream.h +0 -307
- data/dependencies/zlib/contrib/iostream2/zstream_test.cpp +0 -25
- data/dependencies/zlib/contrib/iostream3/README +0 -35
- data/dependencies/zlib/contrib/iostream3/TODO +0 -17
- data/dependencies/zlib/contrib/iostream3/test.cc +0 -50
- data/dependencies/zlib/contrib/iostream3/zfstream.cc +0 -479
- data/dependencies/zlib/contrib/iostream3/zfstream.h +0 -466
- data/dependencies/zlib/contrib/masm686/match.asm +0 -413
- data/dependencies/zlib/contrib/masmx64/bld_ml64.bat +0 -2
- data/dependencies/zlib/contrib/masmx64/gvmat64.asm +0 -513
- data/dependencies/zlib/contrib/masmx64/gvmat64.obj +0 -0
- data/dependencies/zlib/contrib/masmx64/inffas8664.c +0 -186
- data/dependencies/zlib/contrib/masmx64/inffasx64.asm +0 -392
- data/dependencies/zlib/contrib/masmx64/inffasx64.obj +0 -0
- data/dependencies/zlib/contrib/masmx64/readme.txt +0 -28
- data/dependencies/zlib/contrib/masmx86/bld_ml32.bat +0 -2
- data/dependencies/zlib/contrib/masmx86/gvmat32.asm +0 -972
- data/dependencies/zlib/contrib/masmx86/gvmat32.obj +0 -0
- data/dependencies/zlib/contrib/masmx86/gvmat32c.c +0 -62
- data/dependencies/zlib/contrib/masmx86/inffas32.asm +0 -1083
- data/dependencies/zlib/contrib/masmx86/inffas32.obj +0 -0
- data/dependencies/zlib/contrib/masmx86/mkasm.bat +0 -3
- data/dependencies/zlib/contrib/masmx86/readme.txt +0 -21
- data/dependencies/zlib/contrib/minizip/ChangeLogUnzip +0 -67
- data/dependencies/zlib/contrib/minizip/Makefile +0 -25
- data/dependencies/zlib/contrib/minizip/crypt.h +0 -132
- data/dependencies/zlib/contrib/minizip/ioapi.c +0 -177
- data/dependencies/zlib/contrib/minizip/ioapi.h +0 -75
- data/dependencies/zlib/contrib/minizip/iowin32.c +0 -270
- data/dependencies/zlib/contrib/minizip/iowin32.h +0 -21
- data/dependencies/zlib/contrib/minizip/miniunz.c +0 -585
- data/dependencies/zlib/contrib/minizip/minizip.c +0 -420
- data/dependencies/zlib/contrib/minizip/mztools.c +0 -281
- data/dependencies/zlib/contrib/minizip/mztools.h +0 -31
- data/dependencies/zlib/contrib/minizip/unzip.c +0 -1598
- data/dependencies/zlib/contrib/minizip/unzip.h +0 -354
- data/dependencies/zlib/contrib/minizip/zip.c +0 -1219
- data/dependencies/zlib/contrib/minizip/zip.h +0 -235
- data/dependencies/zlib/contrib/pascal/example.pas +0 -599
- data/dependencies/zlib/contrib/pascal/readme.txt +0 -76
- data/dependencies/zlib/contrib/pascal/zlibd32.mak +0 -93
- data/dependencies/zlib/contrib/pascal/zlibpas.pas +0 -236
- data/dependencies/zlib/contrib/puff/Makefile +0 -8
- data/dependencies/zlib/contrib/puff/README +0 -63
- data/dependencies/zlib/contrib/puff/puff.c +0 -837
- data/dependencies/zlib/contrib/puff/puff.h +0 -31
- data/dependencies/zlib/contrib/puff/zeros.raw +0 -0
- data/dependencies/zlib/contrib/testzlib/testzlib.c +0 -275
- data/dependencies/zlib/contrib/testzlib/testzlib.txt +0 -10
- data/dependencies/zlib/contrib/untgz/Makefile +0 -14
- data/dependencies/zlib/contrib/untgz/Makefile.msc +0 -17
- data/dependencies/zlib/contrib/untgz/untgz.c +0 -674
- data/dependencies/zlib/contrib/vstudio/readme.txt +0 -73
- data/dependencies/zlib/contrib/vstudio/vc7/miniunz.vcproj +0 -126
- data/dependencies/zlib/contrib/vstudio/vc7/minizip.vcproj +0 -126
- data/dependencies/zlib/contrib/vstudio/vc7/testzlib.vcproj +0 -126
- data/dependencies/zlib/contrib/vstudio/vc7/zlib.rc +0 -32
- data/dependencies/zlib/contrib/vstudio/vc7/zlibstat.vcproj +0 -246
- data/dependencies/zlib/contrib/vstudio/vc7/zlibvc.def +0 -92
- data/dependencies/zlib/contrib/vstudio/vc7/zlibvc.sln +0 -78
- data/dependencies/zlib/contrib/vstudio/vc7/zlibvc.vcproj +0 -445
- data/dependencies/zlib/contrib/vstudio/vc8/miniunz.vcproj +0 -566
- data/dependencies/zlib/contrib/vstudio/vc8/minizip.vcproj +0 -563
- data/dependencies/zlib/contrib/vstudio/vc8/testzlib.vcproj +0 -948
- data/dependencies/zlib/contrib/vstudio/vc8/testzlibdll.vcproj +0 -567
- data/dependencies/zlib/contrib/vstudio/vc8/zlib.rc +0 -32
- data/dependencies/zlib/contrib/vstudio/vc8/zlibstat.vcproj +0 -870
- data/dependencies/zlib/contrib/vstudio/vc8/zlibvc.def +0 -92
- data/dependencies/zlib/contrib/vstudio/vc8/zlibvc.sln +0 -144
- data/dependencies/zlib/contrib/vstudio/vc8/zlibvc.vcproj +0 -1219
- data/dependencies/zlib/crc32.c +0 -423
- data/dependencies/zlib/crc32.h +0 -441
- data/dependencies/zlib/deflate.c +0 -1736
- data/dependencies/zlib/deflate.h +0 -331
- data/dependencies/zlib/example.c +0 -565
- data/dependencies/zlib/examples/README.examples +0 -42
- data/dependencies/zlib/examples/fitblk.c +0 -233
- data/dependencies/zlib/examples/gun.c +0 -693
- data/dependencies/zlib/examples/gzappend.c +0 -500
- data/dependencies/zlib/examples/gzjoin.c +0 -448
- data/dependencies/zlib/examples/gzlog.c +0 -413
- data/dependencies/zlib/examples/gzlog.h +0 -58
- data/dependencies/zlib/examples/zlib_how.html +0 -523
- data/dependencies/zlib/examples/zpipe.c +0 -191
- data/dependencies/zlib/examples/zran.c +0 -404
- data/dependencies/zlib/gzio.c +0 -1026
- data/dependencies/zlib/infback.c +0 -623
- data/dependencies/zlib/inffast.c +0 -318
- data/dependencies/zlib/inffast.h +0 -11
- data/dependencies/zlib/inffixed.h +0 -94
- data/dependencies/zlib/inflate.c +0 -1368
- data/dependencies/zlib/inflate.h +0 -115
- data/dependencies/zlib/inftrees.c +0 -329
- data/dependencies/zlib/inftrees.h +0 -55
- data/dependencies/zlib/make_vms.com +0 -461
- data/dependencies/zlib/minigzip.c +0 -322
- data/dependencies/zlib/msdos/Makefile.bor +0 -109
- data/dependencies/zlib/msdos/Makefile.dj2 +0 -104
- data/dependencies/zlib/msdos/Makefile.emx +0 -69
- data/dependencies/zlib/msdos/Makefile.msc +0 -106
- data/dependencies/zlib/msdos/Makefile.tc +0 -94
- data/dependencies/zlib/old/Makefile.riscos +0 -151
- data/dependencies/zlib/old/README +0 -3
- data/dependencies/zlib/old/descrip.mms +0 -48
- data/dependencies/zlib/old/os2/Makefile.os2 +0 -136
- data/dependencies/zlib/old/os2/zlib.def +0 -51
- data/dependencies/zlib/old/visual-basic.txt +0 -160
- data/dependencies/zlib/old/zlib.html +0 -971
- data/dependencies/zlib/projects/README.projects +0 -41
- data/dependencies/zlib/projects/visualc6/README.txt +0 -73
- data/dependencies/zlib/projects/visualc6/example.dsp +0 -278
- data/dependencies/zlib/projects/visualc6/minigzip.dsp +0 -278
- data/dependencies/zlib/projects/visualc6/zlib.dsp +0 -609
- data/dependencies/zlib/projects/visualc6/zlib.dsw +0 -59
- data/dependencies/zlib/qnx/package.qpg +0 -141
- data/dependencies/zlib/trees.c +0 -1219
- data/dependencies/zlib/trees.h +0 -128
- data/dependencies/zlib/uncompr.c +0 -61
- data/dependencies/zlib/win32/DLL_FAQ.txt +0 -397
- data/dependencies/zlib/win32/Makefile.bor +0 -107
- data/dependencies/zlib/win32/Makefile.emx +0 -69
- data/dependencies/zlib/win32/Makefile.gcc +0 -141
- data/dependencies/zlib/win32/Makefile.msc +0 -126
- data/dependencies/zlib/win32/VisualC.txt +0 -3
- data/dependencies/zlib/win32/zlib.def +0 -60
- data/dependencies/zlib/win32/zlib1.rc +0 -39
- data/dependencies/zlib/zconf.h +0 -332
- data/dependencies/zlib/zconf.in.h +0 -332
- data/dependencies/zlib/zlib.3 +0 -159
- data/dependencies/zlib/zlib.h +0 -1357
- data/dependencies/zlib/zutil.c +0 -318
- data/dependencies/zlib/zutil.h +0 -269
- data/mac/English.lproj/InfoPlist.strings +0 -0
- data/mac/Gosu-Info.plist +0 -26
- data/mac/Gosu.icns +0 -0
- data/mac/Gosu.xcodeproj/jlnr.mode1v3 +0 -1420
- data/mac/Gosu.xcodeproj/jlnr.mode2v3 +0 -1464
- data/mac/Gosu.xcodeproj/jlnr.pbxuser +0 -1407
- data/mac/Gosu.xcodeproj/jlnr.perspectivev3 +0 -1573
- data/mac/Gosu.xcodeproj/project.pbxproj +0 -2758
- data/mac/RubyGosu App-Info.plist +0 -26
- data/windows/Gosu.sln +0 -34
- data/windows/Gosu.vcproj +0 -553
- data/windows/RubyGosu.vcproj +0 -241
@@ -1,1800 +0,0 @@
|
|
1
|
-
/********************************************************************
|
2
|
-
* *
|
3
|
-
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
4
|
-
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
5
|
-
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
6
|
-
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
7
|
-
* *
|
8
|
-
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
9
|
-
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
10
|
-
* *
|
11
|
-
********************************************************************
|
12
|
-
|
13
|
-
function: code raw [Vorbis] packets into framed OggSquish stream and
|
14
|
-
decode Ogg streams back into raw packets
|
15
|
-
last mod: $Id: framing.c 9601 2005-07-23 00:19:14Z giles $
|
16
|
-
|
17
|
-
note: The CRC code is directly derived from public domain code by
|
18
|
-
Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html
|
19
|
-
for details.
|
20
|
-
|
21
|
-
********************************************************************/
|
22
|
-
|
23
|
-
#include <stdlib.h>
|
24
|
-
#include <string.h>
|
25
|
-
#include <ogg/ogg.h>
|
26
|
-
|
27
|
-
/* A complete description of Ogg framing exists in docs/framing.html */
|
28
|
-
|
29
|
-
int ogg_page_version(ogg_page *og){
|
30
|
-
return((int)(og->header[4]));
|
31
|
-
}
|
32
|
-
|
33
|
-
int ogg_page_continued(ogg_page *og){
|
34
|
-
return((int)(og->header[5]&0x01));
|
35
|
-
}
|
36
|
-
|
37
|
-
int ogg_page_bos(ogg_page *og){
|
38
|
-
return((int)(og->header[5]&0x02));
|
39
|
-
}
|
40
|
-
|
41
|
-
int ogg_page_eos(ogg_page *og){
|
42
|
-
return((int)(og->header[5]&0x04));
|
43
|
-
}
|
44
|
-
|
45
|
-
ogg_int64_t ogg_page_granulepos(ogg_page *og){
|
46
|
-
unsigned char *page=og->header;
|
47
|
-
ogg_int64_t granulepos=page[13]&(0xff);
|
48
|
-
granulepos= (granulepos<<8)|(page[12]&0xff);
|
49
|
-
granulepos= (granulepos<<8)|(page[11]&0xff);
|
50
|
-
granulepos= (granulepos<<8)|(page[10]&0xff);
|
51
|
-
granulepos= (granulepos<<8)|(page[9]&0xff);
|
52
|
-
granulepos= (granulepos<<8)|(page[8]&0xff);
|
53
|
-
granulepos= (granulepos<<8)|(page[7]&0xff);
|
54
|
-
granulepos= (granulepos<<8)|(page[6]&0xff);
|
55
|
-
return(granulepos);
|
56
|
-
}
|
57
|
-
|
58
|
-
int ogg_page_serialno(ogg_page *og){
|
59
|
-
return(og->header[14] |
|
60
|
-
(og->header[15]<<8) |
|
61
|
-
(og->header[16]<<16) |
|
62
|
-
(og->header[17]<<24));
|
63
|
-
}
|
64
|
-
|
65
|
-
long ogg_page_pageno(ogg_page *og){
|
66
|
-
return(og->header[18] |
|
67
|
-
(og->header[19]<<8) |
|
68
|
-
(og->header[20]<<16) |
|
69
|
-
(og->header[21]<<24));
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
/* returns the number of packets that are completed on this page (if
|
75
|
-
the leading packet is begun on a previous page, but ends on this
|
76
|
-
page, it's counted */
|
77
|
-
|
78
|
-
/* NOTE:
|
79
|
-
If a page consists of a packet begun on a previous page, and a new
|
80
|
-
packet begun (but not completed) on this page, the return will be:
|
81
|
-
ogg_page_packets(page) ==1,
|
82
|
-
ogg_page_continued(page) !=0
|
83
|
-
|
84
|
-
If a page happens to be a single packet that was begun on a
|
85
|
-
previous page, and spans to the next page (in the case of a three or
|
86
|
-
more page packet), the return will be:
|
87
|
-
ogg_page_packets(page) ==0,
|
88
|
-
ogg_page_continued(page) !=0
|
89
|
-
*/
|
90
|
-
|
91
|
-
int ogg_page_packets(ogg_page *og){
|
92
|
-
int i,n=og->header[26],count=0;
|
93
|
-
for(i=0;i<n;i++)
|
94
|
-
if(og->header[27+i]<255)count++;
|
95
|
-
return(count);
|
96
|
-
}
|
97
|
-
|
98
|
-
|
99
|
-
#if 0
|
100
|
-
/* helper to initialize lookup for direct-table CRC (illustrative; we
|
101
|
-
use the static init below) */
|
102
|
-
|
103
|
-
static ogg_uint32_t _ogg_crc_entry(unsigned long index){
|
104
|
-
int i;
|
105
|
-
unsigned long r;
|
106
|
-
|
107
|
-
r = index << 24;
|
108
|
-
for (i=0; i<8; i++)
|
109
|
-
if (r & 0x80000000UL)
|
110
|
-
r = (r << 1) ^ 0x04c11db7; /* The same as the ethernet generator
|
111
|
-
polynomial, although we use an
|
112
|
-
unreflected alg and an init/final
|
113
|
-
of 0, not 0xffffffff */
|
114
|
-
else
|
115
|
-
r<<=1;
|
116
|
-
return (r & 0xffffffffUL);
|
117
|
-
}
|
118
|
-
#endif
|
119
|
-
|
120
|
-
static const ogg_uint32_t crc_lookup[256]={
|
121
|
-
0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,
|
122
|
-
0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005,
|
123
|
-
0x2608edb8,0x22c9f00f,0x2f8ad6d6,0x2b4bcb61,
|
124
|
-
0x350c9b64,0x31cd86d3,0x3c8ea00a,0x384fbdbd,
|
125
|
-
0x4c11db70,0x48d0c6c7,0x4593e01e,0x4152fda9,
|
126
|
-
0x5f15adac,0x5bd4b01b,0x569796c2,0x52568b75,
|
127
|
-
0x6a1936c8,0x6ed82b7f,0x639b0da6,0x675a1011,
|
128
|
-
0x791d4014,0x7ddc5da3,0x709f7b7a,0x745e66cd,
|
129
|
-
0x9823b6e0,0x9ce2ab57,0x91a18d8e,0x95609039,
|
130
|
-
0x8b27c03c,0x8fe6dd8b,0x82a5fb52,0x8664e6e5,
|
131
|
-
0xbe2b5b58,0xbaea46ef,0xb7a96036,0xb3687d81,
|
132
|
-
0xad2f2d84,0xa9ee3033,0xa4ad16ea,0xa06c0b5d,
|
133
|
-
0xd4326d90,0xd0f37027,0xddb056fe,0xd9714b49,
|
134
|
-
0xc7361b4c,0xc3f706fb,0xceb42022,0xca753d95,
|
135
|
-
0xf23a8028,0xf6fb9d9f,0xfbb8bb46,0xff79a6f1,
|
136
|
-
0xe13ef6f4,0xe5ffeb43,0xe8bccd9a,0xec7dd02d,
|
137
|
-
0x34867077,0x30476dc0,0x3d044b19,0x39c556ae,
|
138
|
-
0x278206ab,0x23431b1c,0x2e003dc5,0x2ac12072,
|
139
|
-
0x128e9dcf,0x164f8078,0x1b0ca6a1,0x1fcdbb16,
|
140
|
-
0x018aeb13,0x054bf6a4,0x0808d07d,0x0cc9cdca,
|
141
|
-
0x7897ab07,0x7c56b6b0,0x71159069,0x75d48dde,
|
142
|
-
0x6b93dddb,0x6f52c06c,0x6211e6b5,0x66d0fb02,
|
143
|
-
0x5e9f46bf,0x5a5e5b08,0x571d7dd1,0x53dc6066,
|
144
|
-
0x4d9b3063,0x495a2dd4,0x44190b0d,0x40d816ba,
|
145
|
-
0xaca5c697,0xa864db20,0xa527fdf9,0xa1e6e04e,
|
146
|
-
0xbfa1b04b,0xbb60adfc,0xb6238b25,0xb2e29692,
|
147
|
-
0x8aad2b2f,0x8e6c3698,0x832f1041,0x87ee0df6,
|
148
|
-
0x99a95df3,0x9d684044,0x902b669d,0x94ea7b2a,
|
149
|
-
0xe0b41de7,0xe4750050,0xe9362689,0xedf73b3e,
|
150
|
-
0xf3b06b3b,0xf771768c,0xfa325055,0xfef34de2,
|
151
|
-
0xc6bcf05f,0xc27dede8,0xcf3ecb31,0xcbffd686,
|
152
|
-
0xd5b88683,0xd1799b34,0xdc3abded,0xd8fba05a,
|
153
|
-
0x690ce0ee,0x6dcdfd59,0x608edb80,0x644fc637,
|
154
|
-
0x7a089632,0x7ec98b85,0x738aad5c,0x774bb0eb,
|
155
|
-
0x4f040d56,0x4bc510e1,0x46863638,0x42472b8f,
|
156
|
-
0x5c007b8a,0x58c1663d,0x558240e4,0x51435d53,
|
157
|
-
0x251d3b9e,0x21dc2629,0x2c9f00f0,0x285e1d47,
|
158
|
-
0x36194d42,0x32d850f5,0x3f9b762c,0x3b5a6b9b,
|
159
|
-
0x0315d626,0x07d4cb91,0x0a97ed48,0x0e56f0ff,
|
160
|
-
0x1011a0fa,0x14d0bd4d,0x19939b94,0x1d528623,
|
161
|
-
0xf12f560e,0xf5ee4bb9,0xf8ad6d60,0xfc6c70d7,
|
162
|
-
0xe22b20d2,0xe6ea3d65,0xeba91bbc,0xef68060b,
|
163
|
-
0xd727bbb6,0xd3e6a601,0xdea580d8,0xda649d6f,
|
164
|
-
0xc423cd6a,0xc0e2d0dd,0xcda1f604,0xc960ebb3,
|
165
|
-
0xbd3e8d7e,0xb9ff90c9,0xb4bcb610,0xb07daba7,
|
166
|
-
0xae3afba2,0xaafbe615,0xa7b8c0cc,0xa379dd7b,
|
167
|
-
0x9b3660c6,0x9ff77d71,0x92b45ba8,0x9675461f,
|
168
|
-
0x8832161a,0x8cf30bad,0x81b02d74,0x857130c3,
|
169
|
-
0x5d8a9099,0x594b8d2e,0x5408abf7,0x50c9b640,
|
170
|
-
0x4e8ee645,0x4a4ffbf2,0x470cdd2b,0x43cdc09c,
|
171
|
-
0x7b827d21,0x7f436096,0x7200464f,0x76c15bf8,
|
172
|
-
0x68860bfd,0x6c47164a,0x61043093,0x65c52d24,
|
173
|
-
0x119b4be9,0x155a565e,0x18197087,0x1cd86d30,
|
174
|
-
0x029f3d35,0x065e2082,0x0b1d065b,0x0fdc1bec,
|
175
|
-
0x3793a651,0x3352bbe6,0x3e119d3f,0x3ad08088,
|
176
|
-
0x2497d08d,0x2056cd3a,0x2d15ebe3,0x29d4f654,
|
177
|
-
0xc5a92679,0xc1683bce,0xcc2b1d17,0xc8ea00a0,
|
178
|
-
0xd6ad50a5,0xd26c4d12,0xdf2f6bcb,0xdbee767c,
|
179
|
-
0xe3a1cbc1,0xe760d676,0xea23f0af,0xeee2ed18,
|
180
|
-
0xf0a5bd1d,0xf464a0aa,0xf9278673,0xfde69bc4,
|
181
|
-
0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0,
|
182
|
-
0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c,
|
183
|
-
0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,
|
184
|
-
0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4};
|
185
|
-
|
186
|
-
/* init the encode/decode logical stream state */
|
187
|
-
|
188
|
-
int ogg_stream_init(ogg_stream_state *os,int serialno){
|
189
|
-
if(os){
|
190
|
-
memset(os,0,sizeof(*os));
|
191
|
-
os->body_storage=16*1024;
|
192
|
-
os->body_data=_ogg_malloc(os->body_storage*sizeof(*os->body_data));
|
193
|
-
|
194
|
-
os->lacing_storage=1024;
|
195
|
-
os->lacing_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->lacing_vals));
|
196
|
-
os->granule_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->granule_vals));
|
197
|
-
|
198
|
-
os->serialno=serialno;
|
199
|
-
|
200
|
-
return(0);
|
201
|
-
}
|
202
|
-
return(-1);
|
203
|
-
}
|
204
|
-
|
205
|
-
/* _clear does not free os, only the non-flat storage within */
|
206
|
-
int ogg_stream_clear(ogg_stream_state *os){
|
207
|
-
if(os){
|
208
|
-
if(os->body_data)_ogg_free(os->body_data);
|
209
|
-
if(os->lacing_vals)_ogg_free(os->lacing_vals);
|
210
|
-
if(os->granule_vals)_ogg_free(os->granule_vals);
|
211
|
-
|
212
|
-
memset(os,0,sizeof(*os));
|
213
|
-
}
|
214
|
-
return(0);
|
215
|
-
}
|
216
|
-
|
217
|
-
int ogg_stream_destroy(ogg_stream_state *os){
|
218
|
-
if(os){
|
219
|
-
ogg_stream_clear(os);
|
220
|
-
_ogg_free(os);
|
221
|
-
}
|
222
|
-
return(0);
|
223
|
-
}
|
224
|
-
|
225
|
-
/* Helpers for ogg_stream_encode; this keeps the structure and
|
226
|
-
what's happening fairly clear */
|
227
|
-
|
228
|
-
static void _os_body_expand(ogg_stream_state *os,int needed){
|
229
|
-
if(os->body_storage<=os->body_fill+needed){
|
230
|
-
os->body_storage+=(needed+1024);
|
231
|
-
os->body_data=_ogg_realloc(os->body_data,os->body_storage*sizeof(*os->body_data));
|
232
|
-
}
|
233
|
-
}
|
234
|
-
|
235
|
-
static void _os_lacing_expand(ogg_stream_state *os,int needed){
|
236
|
-
if(os->lacing_storage<=os->lacing_fill+needed){
|
237
|
-
os->lacing_storage+=(needed+32);
|
238
|
-
os->lacing_vals=_ogg_realloc(os->lacing_vals,os->lacing_storage*sizeof(*os->lacing_vals));
|
239
|
-
os->granule_vals=_ogg_realloc(os->granule_vals,os->lacing_storage*sizeof(*os->granule_vals));
|
240
|
-
}
|
241
|
-
}
|
242
|
-
|
243
|
-
/* checksum the page */
|
244
|
-
/* Direct table CRC; note that this will be faster in the future if we
|
245
|
-
perform the checksum silmultaneously with other copies */
|
246
|
-
|
247
|
-
void ogg_page_checksum_set(ogg_page *og){
|
248
|
-
if(og){
|
249
|
-
ogg_uint32_t crc_reg=0;
|
250
|
-
int i;
|
251
|
-
|
252
|
-
/* safety; needed for API behavior, but not framing code */
|
253
|
-
og->header[22]=0;
|
254
|
-
og->header[23]=0;
|
255
|
-
og->header[24]=0;
|
256
|
-
og->header[25]=0;
|
257
|
-
|
258
|
-
for(i=0;i<og->header_len;i++)
|
259
|
-
crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->header[i]];
|
260
|
-
for(i=0;i<og->body_len;i++)
|
261
|
-
crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->body[i]];
|
262
|
-
|
263
|
-
og->header[22]=(unsigned char)(crc_reg&0xff);
|
264
|
-
og->header[23]=(unsigned char)((crc_reg>>8)&0xff);
|
265
|
-
og->header[24]=(unsigned char)((crc_reg>>16)&0xff);
|
266
|
-
og->header[25]=(unsigned char)((crc_reg>>24)&0xff);
|
267
|
-
}
|
268
|
-
}
|
269
|
-
|
270
|
-
/* submit data to the internal buffer of the framing engine */
|
271
|
-
int ogg_stream_packetin(ogg_stream_state *os,ogg_packet *op){
|
272
|
-
int lacing_vals=op->bytes/255+1,i;
|
273
|
-
|
274
|
-
if(os->body_returned){
|
275
|
-
/* advance packet data according to the body_returned pointer. We
|
276
|
-
had to keep it around to return a pointer into the buffer last
|
277
|
-
call */
|
278
|
-
|
279
|
-
os->body_fill-=os->body_returned;
|
280
|
-
if(os->body_fill)
|
281
|
-
memmove(os->body_data,os->body_data+os->body_returned,
|
282
|
-
os->body_fill);
|
283
|
-
os->body_returned=0;
|
284
|
-
}
|
285
|
-
|
286
|
-
/* make sure we have the buffer storage */
|
287
|
-
_os_body_expand(os,op->bytes);
|
288
|
-
_os_lacing_expand(os,lacing_vals);
|
289
|
-
|
290
|
-
/* Copy in the submitted packet. Yes, the copy is a waste; this is
|
291
|
-
the liability of overly clean abstraction for the time being. It
|
292
|
-
will actually be fairly easy to eliminate the extra copy in the
|
293
|
-
future */
|
294
|
-
|
295
|
-
memcpy(os->body_data+os->body_fill,op->packet,op->bytes);
|
296
|
-
os->body_fill+=op->bytes;
|
297
|
-
|
298
|
-
/* Store lacing vals for this packet */
|
299
|
-
for(i=0;i<lacing_vals-1;i++){
|
300
|
-
os->lacing_vals[os->lacing_fill+i]=255;
|
301
|
-
os->granule_vals[os->lacing_fill+i]=os->granulepos;
|
302
|
-
}
|
303
|
-
os->lacing_vals[os->lacing_fill+i]=(op->bytes)%255;
|
304
|
-
os->granulepos=os->granule_vals[os->lacing_fill+i]=op->granulepos;
|
305
|
-
|
306
|
-
/* flag the first segment as the beginning of the packet */
|
307
|
-
os->lacing_vals[os->lacing_fill]|= 0x100;
|
308
|
-
|
309
|
-
os->lacing_fill+=lacing_vals;
|
310
|
-
|
311
|
-
/* for the sake of completeness */
|
312
|
-
os->packetno++;
|
313
|
-
|
314
|
-
if(op->e_o_s)os->e_o_s=1;
|
315
|
-
|
316
|
-
return(0);
|
317
|
-
}
|
318
|
-
|
319
|
-
/* This will flush remaining packets into a page (returning nonzero),
|
320
|
-
even if there is not enough data to trigger a flush normally
|
321
|
-
(undersized page). If there are no packets or partial packets to
|
322
|
-
flush, ogg_stream_flush returns 0. Note that ogg_stream_flush will
|
323
|
-
try to flush a normal sized page like ogg_stream_pageout; a call to
|
324
|
-
ogg_stream_flush does not guarantee that all packets have flushed.
|
325
|
-
Only a return value of 0 from ogg_stream_flush indicates all packet
|
326
|
-
data is flushed into pages.
|
327
|
-
|
328
|
-
since ogg_stream_flush will flush the last page in a stream even if
|
329
|
-
it's undersized, you almost certainly want to use ogg_stream_pageout
|
330
|
-
(and *not* ogg_stream_flush) unless you specifically need to flush
|
331
|
-
an page regardless of size in the middle of a stream. */
|
332
|
-
|
333
|
-
int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){
|
334
|
-
int i;
|
335
|
-
int vals=0;
|
336
|
-
int maxvals=(os->lacing_fill>255?255:os->lacing_fill);
|
337
|
-
int bytes=0;
|
338
|
-
long acc=0;
|
339
|
-
ogg_int64_t granule_pos=-1;
|
340
|
-
|
341
|
-
if(maxvals==0)return(0);
|
342
|
-
|
343
|
-
/* construct a page */
|
344
|
-
/* decide how many segments to include */
|
345
|
-
|
346
|
-
/* If this is the initial header case, the first page must only include
|
347
|
-
the initial header packet */
|
348
|
-
if(os->b_o_s==0){ /* 'initial header page' case */
|
349
|
-
granule_pos=0;
|
350
|
-
for(vals=0;vals<maxvals;vals++){
|
351
|
-
if((os->lacing_vals[vals]&0x0ff)<255){
|
352
|
-
vals++;
|
353
|
-
break;
|
354
|
-
}
|
355
|
-
}
|
356
|
-
}else{
|
357
|
-
for(vals=0;vals<maxvals;vals++){
|
358
|
-
if(acc>4096)break;
|
359
|
-
acc+=os->lacing_vals[vals]&0x0ff;
|
360
|
-
if((os->lacing_vals[vals]&0xff)<255)
|
361
|
-
granule_pos=os->granule_vals[vals];
|
362
|
-
}
|
363
|
-
}
|
364
|
-
|
365
|
-
/* construct the header in temp storage */
|
366
|
-
memcpy(os->header,"OggS",4);
|
367
|
-
|
368
|
-
/* stream structure version */
|
369
|
-
os->header[4]=0x00;
|
370
|
-
|
371
|
-
/* continued packet flag? */
|
372
|
-
os->header[5]=0x00;
|
373
|
-
if((os->lacing_vals[0]&0x100)==0)os->header[5]|=0x01;
|
374
|
-
/* first page flag? */
|
375
|
-
if(os->b_o_s==0)os->header[5]|=0x02;
|
376
|
-
/* last page flag? */
|
377
|
-
if(os->e_o_s && os->lacing_fill==vals)os->header[5]|=0x04;
|
378
|
-
os->b_o_s=1;
|
379
|
-
|
380
|
-
/* 64 bits of PCM position */
|
381
|
-
for(i=6;i<14;i++){
|
382
|
-
os->header[i]=(unsigned char)(granule_pos&0xff);
|
383
|
-
granule_pos>>=8;
|
384
|
-
}
|
385
|
-
|
386
|
-
/* 32 bits of stream serial number */
|
387
|
-
{
|
388
|
-
long serialno=os->serialno;
|
389
|
-
for(i=14;i<18;i++){
|
390
|
-
os->header[i]=(unsigned char)(serialno&0xff);
|
391
|
-
serialno>>=8;
|
392
|
-
}
|
393
|
-
}
|
394
|
-
|
395
|
-
/* 32 bits of page counter (we have both counter and page header
|
396
|
-
because this val can roll over) */
|
397
|
-
if(os->pageno==-1)os->pageno=0; /* because someone called
|
398
|
-
stream_reset; this would be a
|
399
|
-
strange thing to do in an
|
400
|
-
encode stream, but it has
|
401
|
-
plausible uses */
|
402
|
-
{
|
403
|
-
long pageno=os->pageno++;
|
404
|
-
for(i=18;i<22;i++){
|
405
|
-
os->header[i]=(unsigned char)(pageno&0xff);
|
406
|
-
pageno>>=8;
|
407
|
-
}
|
408
|
-
}
|
409
|
-
|
410
|
-
/* zero for computation; filled in later */
|
411
|
-
os->header[22]=0;
|
412
|
-
os->header[23]=0;
|
413
|
-
os->header[24]=0;
|
414
|
-
os->header[25]=0;
|
415
|
-
|
416
|
-
/* segment table */
|
417
|
-
os->header[26]=(unsigned char)(vals&0xff);
|
418
|
-
for(i=0;i<vals;i++)
|
419
|
-
bytes+=os->header[i+27]=(unsigned char)(os->lacing_vals[i]&0xff);
|
420
|
-
|
421
|
-
/* set pointers in the ogg_page struct */
|
422
|
-
og->header=os->header;
|
423
|
-
og->header_len=os->header_fill=vals+27;
|
424
|
-
og->body=os->body_data+os->body_returned;
|
425
|
-
og->body_len=bytes;
|
426
|
-
|
427
|
-
/* advance the lacing data and set the body_returned pointer */
|
428
|
-
|
429
|
-
os->lacing_fill-=vals;
|
430
|
-
memmove(os->lacing_vals,os->lacing_vals+vals,os->lacing_fill*sizeof(*os->lacing_vals));
|
431
|
-
memmove(os->granule_vals,os->granule_vals+vals,os->lacing_fill*sizeof(*os->granule_vals));
|
432
|
-
os->body_returned+=bytes;
|
433
|
-
|
434
|
-
/* calculate the checksum */
|
435
|
-
|
436
|
-
ogg_page_checksum_set(og);
|
437
|
-
|
438
|
-
/* done */
|
439
|
-
return(1);
|
440
|
-
}
|
441
|
-
|
442
|
-
|
443
|
-
/* This constructs pages from buffered packet segments. The pointers
|
444
|
-
returned are to static buffers; do not free. The returned buffers are
|
445
|
-
good only until the next call (using the same ogg_stream_state) */
|
446
|
-
|
447
|
-
int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og){
|
448
|
-
|
449
|
-
if((os->e_o_s&&os->lacing_fill) || /* 'were done, now flush' case */
|
450
|
-
os->body_fill-os->body_returned > 4096 ||/* 'page nominal size' case */
|
451
|
-
os->lacing_fill>=255 || /* 'segment table full' case */
|
452
|
-
(os->lacing_fill&&!os->b_o_s)){ /* 'initial header page' case */
|
453
|
-
|
454
|
-
return(ogg_stream_flush(os,og));
|
455
|
-
}
|
456
|
-
|
457
|
-
/* not enough data to construct a page and not end of stream */
|
458
|
-
return(0);
|
459
|
-
}
|
460
|
-
|
461
|
-
int ogg_stream_eos(ogg_stream_state *os){
|
462
|
-
return os->e_o_s;
|
463
|
-
}
|
464
|
-
|
465
|
-
/* DECODING PRIMITIVES: packet streaming layer **********************/
|
466
|
-
|
467
|
-
/* This has two layers to place more of the multi-serialno and paging
|
468
|
-
control in the application's hands. First, we expose a data buffer
|
469
|
-
using ogg_sync_buffer(). The app either copies into the
|
470
|
-
buffer, or passes it directly to read(), etc. We then call
|
471
|
-
ogg_sync_wrote() to tell how many bytes we just added.
|
472
|
-
|
473
|
-
Pages are returned (pointers into the buffer in ogg_sync_state)
|
474
|
-
by ogg_sync_pageout(). The page is then submitted to
|
475
|
-
ogg_stream_pagein() along with the appropriate
|
476
|
-
ogg_stream_state* (ie, matching serialno). We then get raw
|
477
|
-
packets out calling ogg_stream_packetout() with a
|
478
|
-
ogg_stream_state. */
|
479
|
-
|
480
|
-
/* initialize the struct to a known state */
|
481
|
-
int ogg_sync_init(ogg_sync_state *oy){
|
482
|
-
if(oy){
|
483
|
-
memset(oy,0,sizeof(*oy));
|
484
|
-
}
|
485
|
-
return(0);
|
486
|
-
}
|
487
|
-
|
488
|
-
/* clear non-flat storage within */
|
489
|
-
int ogg_sync_clear(ogg_sync_state *oy){
|
490
|
-
if(oy){
|
491
|
-
if(oy->data)_ogg_free(oy->data);
|
492
|
-
ogg_sync_init(oy);
|
493
|
-
}
|
494
|
-
return(0);
|
495
|
-
}
|
496
|
-
|
497
|
-
int ogg_sync_destroy(ogg_sync_state *oy){
|
498
|
-
if(oy){
|
499
|
-
ogg_sync_clear(oy);
|
500
|
-
_ogg_free(oy);
|
501
|
-
}
|
502
|
-
return(0);
|
503
|
-
}
|
504
|
-
|
505
|
-
char *ogg_sync_buffer(ogg_sync_state *oy, long size){
|
506
|
-
|
507
|
-
/* first, clear out any space that has been previously returned */
|
508
|
-
if(oy->returned){
|
509
|
-
oy->fill-=oy->returned;
|
510
|
-
if(oy->fill>0)
|
511
|
-
memmove(oy->data,oy->data+oy->returned,oy->fill);
|
512
|
-
oy->returned=0;
|
513
|
-
}
|
514
|
-
|
515
|
-
if(size>oy->storage-oy->fill){
|
516
|
-
/* We need to extend the internal buffer */
|
517
|
-
long newsize=size+oy->fill+4096; /* an extra page to be nice */
|
518
|
-
|
519
|
-
if(oy->data)
|
520
|
-
oy->data=_ogg_realloc(oy->data,newsize);
|
521
|
-
else
|
522
|
-
oy->data=_ogg_malloc(newsize);
|
523
|
-
oy->storage=newsize;
|
524
|
-
}
|
525
|
-
|
526
|
-
/* expose a segment at least as large as requested at the fill mark */
|
527
|
-
return((char *)oy->data+oy->fill);
|
528
|
-
}
|
529
|
-
|
530
|
-
int ogg_sync_wrote(ogg_sync_state *oy, long bytes){
|
531
|
-
if(oy->fill+bytes>oy->storage)return(-1);
|
532
|
-
oy->fill+=bytes;
|
533
|
-
return(0);
|
534
|
-
}
|
535
|
-
|
536
|
-
/* sync the stream. This is meant to be useful for finding page
|
537
|
-
boundaries.
|
538
|
-
|
539
|
-
return values for this:
|
540
|
-
-n) skipped n bytes
|
541
|
-
0) page not ready; more data (no bytes skipped)
|
542
|
-
n) page synced at current location; page length n bytes
|
543
|
-
|
544
|
-
*/
|
545
|
-
|
546
|
-
long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){
|
547
|
-
unsigned char *page=oy->data+oy->returned;
|
548
|
-
unsigned char *next;
|
549
|
-
long bytes=oy->fill-oy->returned;
|
550
|
-
|
551
|
-
if(oy->headerbytes==0){
|
552
|
-
int headerbytes,i;
|
553
|
-
if(bytes<27)return(0); /* not enough for a header */
|
554
|
-
|
555
|
-
/* verify capture pattern */
|
556
|
-
if(memcmp(page,"OggS",4))goto sync_fail;
|
557
|
-
|
558
|
-
headerbytes=page[26]+27;
|
559
|
-
if(bytes<headerbytes)return(0); /* not enough for header + seg table */
|
560
|
-
|
561
|
-
/* count up body length in the segment table */
|
562
|
-
|
563
|
-
for(i=0;i<page[26];i++)
|
564
|
-
oy->bodybytes+=page[27+i];
|
565
|
-
oy->headerbytes=headerbytes;
|
566
|
-
}
|
567
|
-
|
568
|
-
if(oy->bodybytes+oy->headerbytes>bytes)return(0);
|
569
|
-
|
570
|
-
/* The whole test page is buffered. Verify the checksum */
|
571
|
-
{
|
572
|
-
/* Grab the checksum bytes, set the header field to zero */
|
573
|
-
char chksum[4];
|
574
|
-
ogg_page log;
|
575
|
-
|
576
|
-
memcpy(chksum,page+22,4);
|
577
|
-
memset(page+22,0,4);
|
578
|
-
|
579
|
-
/* set up a temp page struct and recompute the checksum */
|
580
|
-
log.header=page;
|
581
|
-
log.header_len=oy->headerbytes;
|
582
|
-
log.body=page+oy->headerbytes;
|
583
|
-
log.body_len=oy->bodybytes;
|
584
|
-
ogg_page_checksum_set(&log);
|
585
|
-
|
586
|
-
/* Compare */
|
587
|
-
if(memcmp(chksum,page+22,4)){
|
588
|
-
/* D'oh. Mismatch! Corrupt page (or miscapture and not a page
|
589
|
-
at all) */
|
590
|
-
/* replace the computed checksum with the one actually read in */
|
591
|
-
memcpy(page+22,chksum,4);
|
592
|
-
|
593
|
-
/* Bad checksum. Lose sync */
|
594
|
-
goto sync_fail;
|
595
|
-
}
|
596
|
-
}
|
597
|
-
|
598
|
-
/* yes, have a whole page all ready to go */
|
599
|
-
{
|
600
|
-
unsigned char *page=oy->data+oy->returned;
|
601
|
-
long bytes;
|
602
|
-
|
603
|
-
if(og){
|
604
|
-
og->header=page;
|
605
|
-
og->header_len=oy->headerbytes;
|
606
|
-
og->body=page+oy->headerbytes;
|
607
|
-
og->body_len=oy->bodybytes;
|
608
|
-
}
|
609
|
-
|
610
|
-
oy->unsynced=0;
|
611
|
-
oy->returned+=(bytes=oy->headerbytes+oy->bodybytes);
|
612
|
-
oy->headerbytes=0;
|
613
|
-
oy->bodybytes=0;
|
614
|
-
return(bytes);
|
615
|
-
}
|
616
|
-
|
617
|
-
sync_fail:
|
618
|
-
|
619
|
-
oy->headerbytes=0;
|
620
|
-
oy->bodybytes=0;
|
621
|
-
|
622
|
-
/* search for possible capture */
|
623
|
-
next=memchr(page+1,'O',bytes-1);
|
624
|
-
if(!next)
|
625
|
-
next=oy->data+oy->fill;
|
626
|
-
|
627
|
-
oy->returned=next-oy->data;
|
628
|
-
return(-(next-page));
|
629
|
-
}
|
630
|
-
|
631
|
-
/* sync the stream and get a page. Keep trying until we find a page.
|
632
|
-
Supress 'sync errors' after reporting the first.
|
633
|
-
|
634
|
-
return values:
|
635
|
-
-1) recapture (hole in data)
|
636
|
-
0) need more data
|
637
|
-
1) page returned
|
638
|
-
|
639
|
-
Returns pointers into buffered data; invalidated by next call to
|
640
|
-
_stream, _clear, _init, or _buffer */
|
641
|
-
|
642
|
-
int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){
|
643
|
-
|
644
|
-
/* all we need to do is verify a page at the head of the stream
|
645
|
-
buffer. If it doesn't verify, we look for the next potential
|
646
|
-
frame */
|
647
|
-
|
648
|
-
for(;;){
|
649
|
-
long ret=ogg_sync_pageseek(oy,og);
|
650
|
-
if(ret>0){
|
651
|
-
/* have a page */
|
652
|
-
return(1);
|
653
|
-
}
|
654
|
-
if(ret==0){
|
655
|
-
/* need more data */
|
656
|
-
return(0);
|
657
|
-
}
|
658
|
-
|
659
|
-
/* head did not start a synced page... skipped some bytes */
|
660
|
-
if(!oy->unsynced){
|
661
|
-
oy->unsynced=1;
|
662
|
-
return(-1);
|
663
|
-
}
|
664
|
-
|
665
|
-
/* loop. keep looking */
|
666
|
-
|
667
|
-
}
|
668
|
-
}
|
669
|
-
|
670
|
-
/* add the incoming page to the stream state; we decompose the page
|
671
|
-
into packet segments here as well. */
|
672
|
-
|
673
|
-
int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
|
674
|
-
unsigned char *header=og->header;
|
675
|
-
unsigned char *body=og->body;
|
676
|
-
long bodysize=og->body_len;
|
677
|
-
int segptr=0;
|
678
|
-
|
679
|
-
int version=ogg_page_version(og);
|
680
|
-
int continued=ogg_page_continued(og);
|
681
|
-
int bos=ogg_page_bos(og);
|
682
|
-
int eos=ogg_page_eos(og);
|
683
|
-
ogg_int64_t granulepos=ogg_page_granulepos(og);
|
684
|
-
int serialno=ogg_page_serialno(og);
|
685
|
-
long pageno=ogg_page_pageno(og);
|
686
|
-
int segments=header[26];
|
687
|
-
|
688
|
-
/* clean up 'returned data' */
|
689
|
-
{
|
690
|
-
long lr=os->lacing_returned;
|
691
|
-
long br=os->body_returned;
|
692
|
-
|
693
|
-
/* body data */
|
694
|
-
if(br){
|
695
|
-
os->body_fill-=br;
|
696
|
-
if(os->body_fill)
|
697
|
-
memmove(os->body_data,os->body_data+br,os->body_fill);
|
698
|
-
os->body_returned=0;
|
699
|
-
}
|
700
|
-
|
701
|
-
if(lr){
|
702
|
-
/* segment table */
|
703
|
-
if(os->lacing_fill-lr){
|
704
|
-
memmove(os->lacing_vals,os->lacing_vals+lr,
|
705
|
-
(os->lacing_fill-lr)*sizeof(*os->lacing_vals));
|
706
|
-
memmove(os->granule_vals,os->granule_vals+lr,
|
707
|
-
(os->lacing_fill-lr)*sizeof(*os->granule_vals));
|
708
|
-
}
|
709
|
-
os->lacing_fill-=lr;
|
710
|
-
os->lacing_packet-=lr;
|
711
|
-
os->lacing_returned=0;
|
712
|
-
}
|
713
|
-
}
|
714
|
-
|
715
|
-
/* check the serial number */
|
716
|
-
if(serialno!=os->serialno)return(-1);
|
717
|
-
if(version>0)return(-1);
|
718
|
-
|
719
|
-
_os_lacing_expand(os,segments+1);
|
720
|
-
|
721
|
-
/* are we in sequence? */
|
722
|
-
if(pageno!=os->pageno){
|
723
|
-
int i;
|
724
|
-
|
725
|
-
/* unroll previous partial packet (if any) */
|
726
|
-
for(i=os->lacing_packet;i<os->lacing_fill;i++)
|
727
|
-
os->body_fill-=os->lacing_vals[i]&0xff;
|
728
|
-
os->lacing_fill=os->lacing_packet;
|
729
|
-
|
730
|
-
/* make a note of dropped data in segment table */
|
731
|
-
if(os->pageno!=-1){
|
732
|
-
os->lacing_vals[os->lacing_fill++]=0x400;
|
733
|
-
os->lacing_packet++;
|
734
|
-
}
|
735
|
-
}
|
736
|
-
|
737
|
-
/* are we a 'continued packet' page? If so, we may need to skip
|
738
|
-
some segments */
|
739
|
-
if(continued){
|
740
|
-
if(os->lacing_fill<1 ||
|
741
|
-
os->lacing_vals[os->lacing_fill-1]==0x400){
|
742
|
-
bos=0;
|
743
|
-
for(;segptr<segments;segptr++){
|
744
|
-
int val=header[27+segptr];
|
745
|
-
body+=val;
|
746
|
-
bodysize-=val;
|
747
|
-
if(val<255){
|
748
|
-
segptr++;
|
749
|
-
break;
|
750
|
-
}
|
751
|
-
}
|
752
|
-
}
|
753
|
-
}
|
754
|
-
|
755
|
-
if(bodysize){
|
756
|
-
_os_body_expand(os,bodysize);
|
757
|
-
memcpy(os->body_data+os->body_fill,body,bodysize);
|
758
|
-
os->body_fill+=bodysize;
|
759
|
-
}
|
760
|
-
|
761
|
-
{
|
762
|
-
int saved=-1;
|
763
|
-
while(segptr<segments){
|
764
|
-
int val=header[27+segptr];
|
765
|
-
os->lacing_vals[os->lacing_fill]=val;
|
766
|
-
os->granule_vals[os->lacing_fill]=-1;
|
767
|
-
|
768
|
-
if(bos){
|
769
|
-
os->lacing_vals[os->lacing_fill]|=0x100;
|
770
|
-
bos=0;
|
771
|
-
}
|
772
|
-
|
773
|
-
if(val<255)saved=os->lacing_fill;
|
774
|
-
|
775
|
-
os->lacing_fill++;
|
776
|
-
segptr++;
|
777
|
-
|
778
|
-
if(val<255)os->lacing_packet=os->lacing_fill;
|
779
|
-
}
|
780
|
-
|
781
|
-
/* set the granulepos on the last granuleval of the last full packet */
|
782
|
-
if(saved!=-1){
|
783
|
-
os->granule_vals[saved]=granulepos;
|
784
|
-
}
|
785
|
-
|
786
|
-
}
|
787
|
-
|
788
|
-
if(eos){
|
789
|
-
os->e_o_s=1;
|
790
|
-
if(os->lacing_fill>0)
|
791
|
-
os->lacing_vals[os->lacing_fill-1]|=0x200;
|
792
|
-
}
|
793
|
-
|
794
|
-
os->pageno=pageno+1;
|
795
|
-
|
796
|
-
return(0);
|
797
|
-
}
|
798
|
-
|
799
|
-
/* clear things to an initial state. Good to call, eg, before seeking */
|
800
|
-
int ogg_sync_reset(ogg_sync_state *oy){
|
801
|
-
oy->fill=0;
|
802
|
-
oy->returned=0;
|
803
|
-
oy->unsynced=0;
|
804
|
-
oy->headerbytes=0;
|
805
|
-
oy->bodybytes=0;
|
806
|
-
return(0);
|
807
|
-
}
|
808
|
-
|
809
|
-
int ogg_stream_reset(ogg_stream_state *os){
|
810
|
-
os->body_fill=0;
|
811
|
-
os->body_returned=0;
|
812
|
-
|
813
|
-
os->lacing_fill=0;
|
814
|
-
os->lacing_packet=0;
|
815
|
-
os->lacing_returned=0;
|
816
|
-
|
817
|
-
os->header_fill=0;
|
818
|
-
|
819
|
-
os->e_o_s=0;
|
820
|
-
os->b_o_s=0;
|
821
|
-
os->pageno=-1;
|
822
|
-
os->packetno=0;
|
823
|
-
os->granulepos=0;
|
824
|
-
|
825
|
-
return(0);
|
826
|
-
}
|
827
|
-
|
828
|
-
int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno){
|
829
|
-
ogg_stream_reset(os);
|
830
|
-
os->serialno=serialno;
|
831
|
-
return(0);
|
832
|
-
}
|
833
|
-
|
834
|
-
static int _packetout(ogg_stream_state *os,ogg_packet *op,int adv){
|
835
|
-
|
836
|
-
/* The last part of decode. We have the stream broken into packet
|
837
|
-
segments. Now we need to group them into packets (or return the
|
838
|
-
out of sync markers) */
|
839
|
-
|
840
|
-
int ptr=os->lacing_returned;
|
841
|
-
|
842
|
-
if(os->lacing_packet<=ptr)return(0);
|
843
|
-
|
844
|
-
if(os->lacing_vals[ptr]&0x400){
|
845
|
-
/* we need to tell the codec there's a gap; it might need to
|
846
|
-
handle previous packet dependencies. */
|
847
|
-
os->lacing_returned++;
|
848
|
-
os->packetno++;
|
849
|
-
return(-1);
|
850
|
-
}
|
851
|
-
|
852
|
-
if(!op && !adv)return(1); /* just using peek as an inexpensive way
|
853
|
-
to ask if there's a whole packet
|
854
|
-
waiting */
|
855
|
-
|
856
|
-
/* Gather the whole packet. We'll have no holes or a partial packet */
|
857
|
-
{
|
858
|
-
int size=os->lacing_vals[ptr]&0xff;
|
859
|
-
int bytes=size;
|
860
|
-
int eos=os->lacing_vals[ptr]&0x200; /* last packet of the stream? */
|
861
|
-
int bos=os->lacing_vals[ptr]&0x100; /* first packet of the stream? */
|
862
|
-
|
863
|
-
while(size==255){
|
864
|
-
int val=os->lacing_vals[++ptr];
|
865
|
-
size=val&0xff;
|
866
|
-
if(val&0x200)eos=0x200;
|
867
|
-
bytes+=size;
|
868
|
-
}
|
869
|
-
|
870
|
-
if(op){
|
871
|
-
op->e_o_s=eos;
|
872
|
-
op->b_o_s=bos;
|
873
|
-
op->packet=os->body_data+os->body_returned;
|
874
|
-
op->packetno=os->packetno;
|
875
|
-
op->granulepos=os->granule_vals[ptr];
|
876
|
-
op->bytes=bytes;
|
877
|
-
}
|
878
|
-
|
879
|
-
if(adv){
|
880
|
-
os->body_returned+=bytes;
|
881
|
-
os->lacing_returned=ptr+1;
|
882
|
-
os->packetno++;
|
883
|
-
}
|
884
|
-
}
|
885
|
-
return(1);
|
886
|
-
}
|
887
|
-
|
888
|
-
int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op){
|
889
|
-
return _packetout(os,op,1);
|
890
|
-
}
|
891
|
-
|
892
|
-
int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op){
|
893
|
-
return _packetout(os,op,0);
|
894
|
-
}
|
895
|
-
|
896
|
-
void ogg_packet_clear(ogg_packet *op) {
|
897
|
-
_ogg_free(op->packet);
|
898
|
-
memset(op, 0, sizeof(*op));
|
899
|
-
}
|
900
|
-
|
901
|
-
#ifdef _V_SELFTEST
|
902
|
-
#include <stdio.h>
|
903
|
-
|
904
|
-
ogg_stream_state os_en, os_de;
|
905
|
-
ogg_sync_state oy;
|
906
|
-
|
907
|
-
void checkpacket(ogg_packet *op,int len, int no, int pos){
|
908
|
-
long j;
|
909
|
-
static int sequence=0;
|
910
|
-
static int lastno=0;
|
911
|
-
|
912
|
-
if(op->bytes!=len){
|
913
|
-
fprintf(stderr,"incorrect packet length!\n");
|
914
|
-
exit(1);
|
915
|
-
}
|
916
|
-
if(op->granulepos!=pos){
|
917
|
-
fprintf(stderr,"incorrect packet position!\n");
|
918
|
-
exit(1);
|
919
|
-
}
|
920
|
-
|
921
|
-
/* packet number just follows sequence/gap; adjust the input number
|
922
|
-
for that */
|
923
|
-
if(no==0){
|
924
|
-
sequence=0;
|
925
|
-
}else{
|
926
|
-
sequence++;
|
927
|
-
if(no>lastno+1)
|
928
|
-
sequence++;
|
929
|
-
}
|
930
|
-
lastno=no;
|
931
|
-
if(op->packetno!=sequence){
|
932
|
-
fprintf(stderr,"incorrect packet sequence %ld != %d\n",
|
933
|
-
(long)(op->packetno),sequence);
|
934
|
-
exit(1);
|
935
|
-
}
|
936
|
-
|
937
|
-
/* Test data */
|
938
|
-
for(j=0;j<op->bytes;j++)
|
939
|
-
if(op->packet[j]!=((j+no)&0xff)){
|
940
|
-
fprintf(stderr,"body data mismatch (1) at pos %ld: %x!=%lx!\n\n",
|
941
|
-
j,op->packet[j],(j+no)&0xff);
|
942
|
-
exit(1);
|
943
|
-
}
|
944
|
-
}
|
945
|
-
|
946
|
-
void check_page(unsigned char *data,const int *header,ogg_page *og){
|
947
|
-
long j;
|
948
|
-
/* Test data */
|
949
|
-
for(j=0;j<og->body_len;j++)
|
950
|
-
if(og->body[j]!=data[j]){
|
951
|
-
fprintf(stderr,"body data mismatch (2) at pos %ld: %x!=%x!\n\n",
|
952
|
-
j,data[j],og->body[j]);
|
953
|
-
exit(1);
|
954
|
-
}
|
955
|
-
|
956
|
-
/* Test header */
|
957
|
-
for(j=0;j<og->header_len;j++){
|
958
|
-
if(og->header[j]!=header[j]){
|
959
|
-
fprintf(stderr,"header content mismatch at pos %ld:\n",j);
|
960
|
-
for(j=0;j<header[26]+27;j++)
|
961
|
-
fprintf(stderr," (%ld)%02x:%02x",j,header[j],og->header[j]);
|
962
|
-
fprintf(stderr,"\n");
|
963
|
-
exit(1);
|
964
|
-
}
|
965
|
-
}
|
966
|
-
if(og->header_len!=header[26]+27){
|
967
|
-
fprintf(stderr,"header length incorrect! (%ld!=%d)\n",
|
968
|
-
og->header_len,header[26]+27);
|
969
|
-
exit(1);
|
970
|
-
}
|
971
|
-
}
|
972
|
-
|
973
|
-
void print_header(ogg_page *og){
|
974
|
-
int j;
|
975
|
-
fprintf(stderr,"\nHEADER:\n");
|
976
|
-
fprintf(stderr," capture: %c %c %c %c version: %d flags: %x\n",
|
977
|
-
og->header[0],og->header[1],og->header[2],og->header[3],
|
978
|
-
(int)og->header[4],(int)og->header[5]);
|
979
|
-
|
980
|
-
fprintf(stderr," granulepos: %d serialno: %d pageno: %ld\n",
|
981
|
-
(og->header[9]<<24)|(og->header[8]<<16)|
|
982
|
-
(og->header[7]<<8)|og->header[6],
|
983
|
-
(og->header[17]<<24)|(og->header[16]<<16)|
|
984
|
-
(og->header[15]<<8)|og->header[14],
|
985
|
-
((long)(og->header[21])<<24)|(og->header[20]<<16)|
|
986
|
-
(og->header[19]<<8)|og->header[18]);
|
987
|
-
|
988
|
-
fprintf(stderr," checksum: %02x:%02x:%02x:%02x\n segments: %d (",
|
989
|
-
(int)og->header[22],(int)og->header[23],
|
990
|
-
(int)og->header[24],(int)og->header[25],
|
991
|
-
(int)og->header[26]);
|
992
|
-
|
993
|
-
for(j=27;j<og->header_len;j++)
|
994
|
-
fprintf(stderr,"%d ",(int)og->header[j]);
|
995
|
-
fprintf(stderr,")\n\n");
|
996
|
-
}
|
997
|
-
|
998
|
-
void copy_page(ogg_page *og){
|
999
|
-
unsigned char *temp=_ogg_malloc(og->header_len);
|
1000
|
-
memcpy(temp,og->header,og->header_len);
|
1001
|
-
og->header=temp;
|
1002
|
-
|
1003
|
-
temp=_ogg_malloc(og->body_len);
|
1004
|
-
memcpy(temp,og->body,og->body_len);
|
1005
|
-
og->body=temp;
|
1006
|
-
}
|
1007
|
-
|
1008
|
-
void free_page(ogg_page *og){
|
1009
|
-
_ogg_free (og->header);
|
1010
|
-
_ogg_free (og->body);
|
1011
|
-
}
|
1012
|
-
|
1013
|
-
void error(void){
|
1014
|
-
fprintf(stderr,"error!\n");
|
1015
|
-
exit(1);
|
1016
|
-
}
|
1017
|
-
|
1018
|
-
/* 17 only */
|
1019
|
-
const int head1_0[] = {0x4f,0x67,0x67,0x53,0,0x06,
|
1020
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1021
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1022
|
-
0x15,0xed,0xec,0x91,
|
1023
|
-
1,
|
1024
|
-
17};
|
1025
|
-
|
1026
|
-
/* 17, 254, 255, 256, 500, 510, 600 byte, pad */
|
1027
|
-
const int head1_1[] = {0x4f,0x67,0x67,0x53,0,0x02,
|
1028
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1029
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1030
|
-
0x59,0x10,0x6c,0x2c,
|
1031
|
-
1,
|
1032
|
-
17};
|
1033
|
-
const int head2_1[] = {0x4f,0x67,0x67,0x53,0,0x04,
|
1034
|
-
0x07,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
|
1035
|
-
0x01,0x02,0x03,0x04,1,0,0,0,
|
1036
|
-
0x89,0x33,0x85,0xce,
|
1037
|
-
13,
|
1038
|
-
254,255,0,255,1,255,245,255,255,0,
|
1039
|
-
255,255,90};
|
1040
|
-
|
1041
|
-
/* nil packets; beginning,middle,end */
|
1042
|
-
const int head1_2[] = {0x4f,0x67,0x67,0x53,0,0x02,
|
1043
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1044
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1045
|
-
0xff,0x7b,0x23,0x17,
|
1046
|
-
1,
|
1047
|
-
0};
|
1048
|
-
const int head2_2[] = {0x4f,0x67,0x67,0x53,0,0x04,
|
1049
|
-
0x07,0x28,0x00,0x00,0x00,0x00,0x00,0x00,
|
1050
|
-
0x01,0x02,0x03,0x04,1,0,0,0,
|
1051
|
-
0x5c,0x3f,0x66,0xcb,
|
1052
|
-
17,
|
1053
|
-
17,254,255,0,0,255,1,0,255,245,255,255,0,
|
1054
|
-
255,255,90,0};
|
1055
|
-
|
1056
|
-
/* large initial packet */
|
1057
|
-
const int head1_3[] = {0x4f,0x67,0x67,0x53,0,0x02,
|
1058
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1059
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1060
|
-
0x01,0x27,0x31,0xaa,
|
1061
|
-
18,
|
1062
|
-
255,255,255,255,255,255,255,255,
|
1063
|
-
255,255,255,255,255,255,255,255,255,10};
|
1064
|
-
|
1065
|
-
const int head2_3[] = {0x4f,0x67,0x67,0x53,0,0x04,
|
1066
|
-
0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
|
1067
|
-
0x01,0x02,0x03,0x04,1,0,0,0,
|
1068
|
-
0x7f,0x4e,0x8a,0xd2,
|
1069
|
-
4,
|
1070
|
-
255,4,255,0};
|
1071
|
-
|
1072
|
-
|
1073
|
-
/* continuing packet test */
|
1074
|
-
const int head1_4[] = {0x4f,0x67,0x67,0x53,0,0x02,
|
1075
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1076
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1077
|
-
0xff,0x7b,0x23,0x17,
|
1078
|
-
1,
|
1079
|
-
0};
|
1080
|
-
|
1081
|
-
const int head2_4[] = {0x4f,0x67,0x67,0x53,0,0x00,
|
1082
|
-
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
1083
|
-
0x01,0x02,0x03,0x04,1,0,0,0,
|
1084
|
-
0x54,0x05,0x51,0xc8,
|
1085
|
-
17,
|
1086
|
-
255,255,255,255,255,255,255,255,
|
1087
|
-
255,255,255,255,255,255,255,255,255};
|
1088
|
-
|
1089
|
-
const int head3_4[] = {0x4f,0x67,0x67,0x53,0,0x05,
|
1090
|
-
0x07,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,
|
1091
|
-
0x01,0x02,0x03,0x04,2,0,0,0,
|
1092
|
-
0xc8,0xc3,0xcb,0xed,
|
1093
|
-
5,
|
1094
|
-
10,255,4,255,0};
|
1095
|
-
|
1096
|
-
|
1097
|
-
/* page with the 255 segment limit */
|
1098
|
-
const int head1_5[] = {0x4f,0x67,0x67,0x53,0,0x02,
|
1099
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1100
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1101
|
-
0xff,0x7b,0x23,0x17,
|
1102
|
-
1,
|
1103
|
-
0};
|
1104
|
-
|
1105
|
-
const int head2_5[] = {0x4f,0x67,0x67,0x53,0,0x00,
|
1106
|
-
0x07,0xfc,0x03,0x00,0x00,0x00,0x00,0x00,
|
1107
|
-
0x01,0x02,0x03,0x04,1,0,0,0,
|
1108
|
-
0xed,0x2a,0x2e,0xa7,
|
1109
|
-
255,
|
1110
|
-
10,10,10,10,10,10,10,10,
|
1111
|
-
10,10,10,10,10,10,10,10,
|
1112
|
-
10,10,10,10,10,10,10,10,
|
1113
|
-
10,10,10,10,10,10,10,10,
|
1114
|
-
10,10,10,10,10,10,10,10,
|
1115
|
-
10,10,10,10,10,10,10,10,
|
1116
|
-
10,10,10,10,10,10,10,10,
|
1117
|
-
10,10,10,10,10,10,10,10,
|
1118
|
-
10,10,10,10,10,10,10,10,
|
1119
|
-
10,10,10,10,10,10,10,10,
|
1120
|
-
10,10,10,10,10,10,10,10,
|
1121
|
-
10,10,10,10,10,10,10,10,
|
1122
|
-
10,10,10,10,10,10,10,10,
|
1123
|
-
10,10,10,10,10,10,10,10,
|
1124
|
-
10,10,10,10,10,10,10,10,
|
1125
|
-
10,10,10,10,10,10,10,10,
|
1126
|
-
10,10,10,10,10,10,10,10,
|
1127
|
-
10,10,10,10,10,10,10,10,
|
1128
|
-
10,10,10,10,10,10,10,10,
|
1129
|
-
10,10,10,10,10,10,10,10,
|
1130
|
-
10,10,10,10,10,10,10,10,
|
1131
|
-
10,10,10,10,10,10,10,10,
|
1132
|
-
10,10,10,10,10,10,10,10,
|
1133
|
-
10,10,10,10,10,10,10,10,
|
1134
|
-
10,10,10,10,10,10,10,10,
|
1135
|
-
10,10,10,10,10,10,10,10,
|
1136
|
-
10,10,10,10,10,10,10,10,
|
1137
|
-
10,10,10,10,10,10,10,10,
|
1138
|
-
10,10,10,10,10,10,10,10,
|
1139
|
-
10,10,10,10,10,10,10,10,
|
1140
|
-
10,10,10,10,10,10,10,10,
|
1141
|
-
10,10,10,10,10,10,10};
|
1142
|
-
|
1143
|
-
const int head3_5[] = {0x4f,0x67,0x67,0x53,0,0x04,
|
1144
|
-
0x07,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
|
1145
|
-
0x01,0x02,0x03,0x04,2,0,0,0,
|
1146
|
-
0x6c,0x3b,0x82,0x3d,
|
1147
|
-
1,
|
1148
|
-
50};
|
1149
|
-
|
1150
|
-
|
1151
|
-
/* packet that overspans over an entire page */
|
1152
|
-
const int head1_6[] = {0x4f,0x67,0x67,0x53,0,0x02,
|
1153
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1154
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1155
|
-
0xff,0x7b,0x23,0x17,
|
1156
|
-
1,
|
1157
|
-
0};
|
1158
|
-
|
1159
|
-
const int head2_6[] = {0x4f,0x67,0x67,0x53,0,0x00,
|
1160
|
-
0x07,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
|
1161
|
-
0x01,0x02,0x03,0x04,1,0,0,0,
|
1162
|
-
0x3c,0xd9,0x4d,0x3f,
|
1163
|
-
17,
|
1164
|
-
100,255,255,255,255,255,255,255,255,
|
1165
|
-
255,255,255,255,255,255,255,255};
|
1166
|
-
|
1167
|
-
const int head3_6[] = {0x4f,0x67,0x67,0x53,0,0x01,
|
1168
|
-
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
1169
|
-
0x01,0x02,0x03,0x04,2,0,0,0,
|
1170
|
-
0x01,0xd2,0xe5,0xe5,
|
1171
|
-
17,
|
1172
|
-
255,255,255,255,255,255,255,255,
|
1173
|
-
255,255,255,255,255,255,255,255,255};
|
1174
|
-
|
1175
|
-
const int head4_6[] = {0x4f,0x67,0x67,0x53,0,0x05,
|
1176
|
-
0x07,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
|
1177
|
-
0x01,0x02,0x03,0x04,3,0,0,0,
|
1178
|
-
0xef,0xdd,0x88,0xde,
|
1179
|
-
7,
|
1180
|
-
255,255,75,255,4,255,0};
|
1181
|
-
|
1182
|
-
/* packet that overspans over an entire page */
|
1183
|
-
const int head1_7[] = {0x4f,0x67,0x67,0x53,0,0x02,
|
1184
|
-
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
1185
|
-
0x01,0x02,0x03,0x04,0,0,0,0,
|
1186
|
-
0xff,0x7b,0x23,0x17,
|
1187
|
-
1,
|
1188
|
-
0};
|
1189
|
-
|
1190
|
-
const int head2_7[] = {0x4f,0x67,0x67,0x53,0,0x00,
|
1191
|
-
0x07,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
|
1192
|
-
0x01,0x02,0x03,0x04,1,0,0,0,
|
1193
|
-
0x3c,0xd9,0x4d,0x3f,
|
1194
|
-
17,
|
1195
|
-
100,255,255,255,255,255,255,255,255,
|
1196
|
-
255,255,255,255,255,255,255,255};
|
1197
|
-
|
1198
|
-
const int head3_7[] = {0x4f,0x67,0x67,0x53,0,0x05,
|
1199
|
-
0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
|
1200
|
-
0x01,0x02,0x03,0x04,2,0,0,0,
|
1201
|
-
0xd4,0xe0,0x60,0xe5,
|
1202
|
-
1,0};
|
1203
|
-
|
1204
|
-
void test_pack(const int *pl, const int **headers, int byteskip,
|
1205
|
-
int pageskip, int packetskip){
|
1206
|
-
unsigned char *data=_ogg_malloc(1024*1024); /* for scripted test cases only */
|
1207
|
-
long inptr=0;
|
1208
|
-
long outptr=0;
|
1209
|
-
long deptr=0;
|
1210
|
-
long depacket=0;
|
1211
|
-
long granule_pos=7,pageno=0;
|
1212
|
-
int i,j,packets,pageout=pageskip;
|
1213
|
-
int eosflag=0;
|
1214
|
-
int bosflag=0;
|
1215
|
-
|
1216
|
-
int byteskipcount=0;
|
1217
|
-
|
1218
|
-
ogg_stream_reset(&os_en);
|
1219
|
-
ogg_stream_reset(&os_de);
|
1220
|
-
ogg_sync_reset(&oy);
|
1221
|
-
|
1222
|
-
for(packets=0;packets<packetskip;packets++)
|
1223
|
-
depacket+=pl[packets];
|
1224
|
-
|
1225
|
-
for(packets=0;;packets++)if(pl[packets]==-1)break;
|
1226
|
-
|
1227
|
-
for(i=0;i<packets;i++){
|
1228
|
-
/* construct a test packet */
|
1229
|
-
ogg_packet op;
|
1230
|
-
int len=pl[i];
|
1231
|
-
|
1232
|
-
op.packet=data+inptr;
|
1233
|
-
op.bytes=len;
|
1234
|
-
op.e_o_s=(pl[i+1]<0?1:0);
|
1235
|
-
op.granulepos=granule_pos;
|
1236
|
-
|
1237
|
-
granule_pos+=1024;
|
1238
|
-
|
1239
|
-
for(j=0;j<len;j++)data[inptr++]=i+j;
|
1240
|
-
|
1241
|
-
/* submit the test packet */
|
1242
|
-
ogg_stream_packetin(&os_en,&op);
|
1243
|
-
|
1244
|
-
/* retrieve any finished pages */
|
1245
|
-
{
|
1246
|
-
ogg_page og;
|
1247
|
-
|
1248
|
-
while(ogg_stream_pageout(&os_en,&og)){
|
1249
|
-
/* We have a page. Check it carefully */
|
1250
|
-
|
1251
|
-
fprintf(stderr,"%ld, ",pageno);
|
1252
|
-
|
1253
|
-
if(headers[pageno]==NULL){
|
1254
|
-
fprintf(stderr,"coded too many pages!\n");
|
1255
|
-
exit(1);
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
check_page(data+outptr,headers[pageno],&og);
|
1259
|
-
|
1260
|
-
outptr+=og.body_len;
|
1261
|
-
pageno++;
|
1262
|
-
if(pageskip){
|
1263
|
-
bosflag=1;
|
1264
|
-
pageskip--;
|
1265
|
-
deptr+=og.body_len;
|
1266
|
-
}
|
1267
|
-
|
1268
|
-
/* have a complete page; submit it to sync/decode */
|
1269
|
-
|
1270
|
-
{
|
1271
|
-
ogg_page og_de;
|
1272
|
-
ogg_packet op_de,op_de2;
|
1273
|
-
char *buf=ogg_sync_buffer(&oy,og.header_len+og.body_len);
|
1274
|
-
char *next=buf;
|
1275
|
-
byteskipcount+=og.header_len;
|
1276
|
-
if(byteskipcount>byteskip){
|
1277
|
-
memcpy(next,og.header,byteskipcount-byteskip);
|
1278
|
-
next+=byteskipcount-byteskip;
|
1279
|
-
byteskipcount=byteskip;
|
1280
|
-
}
|
1281
|
-
|
1282
|
-
byteskipcount+=og.body_len;
|
1283
|
-
if(byteskipcount>byteskip){
|
1284
|
-
memcpy(next,og.body,byteskipcount-byteskip);
|
1285
|
-
next+=byteskipcount-byteskip;
|
1286
|
-
byteskipcount=byteskip;
|
1287
|
-
}
|
1288
|
-
|
1289
|
-
ogg_sync_wrote(&oy,next-buf);
|
1290
|
-
|
1291
|
-
while(1){
|
1292
|
-
int ret=ogg_sync_pageout(&oy,&og_de);
|
1293
|
-
if(ret==0)break;
|
1294
|
-
if(ret<0)continue;
|
1295
|
-
/* got a page. Happy happy. Verify that it's good. */
|
1296
|
-
|
1297
|
-
fprintf(stderr,"(%ld), ",pageout);
|
1298
|
-
|
1299
|
-
check_page(data+deptr,headers[pageout],&og_de);
|
1300
|
-
deptr+=og_de.body_len;
|
1301
|
-
pageout++;
|
1302
|
-
|
1303
|
-
/* submit it to deconstitution */
|
1304
|
-
ogg_stream_pagein(&os_de,&og_de);
|
1305
|
-
|
1306
|
-
/* packets out? */
|
1307
|
-
while(ogg_stream_packetpeek(&os_de,&op_de2)>0){
|
1308
|
-
ogg_stream_packetpeek(&os_de,NULL);
|
1309
|
-
ogg_stream_packetout(&os_de,&op_de); /* just catching them all */
|
1310
|
-
|
1311
|
-
/* verify peek and out match */
|
1312
|
-
if(memcmp(&op_de,&op_de2,sizeof(op_de))){
|
1313
|
-
fprintf(stderr,"packetout != packetpeek! pos=%ld\n",
|
1314
|
-
depacket);
|
1315
|
-
exit(1);
|
1316
|
-
}
|
1317
|
-
|
1318
|
-
/* verify the packet! */
|
1319
|
-
/* check data */
|
1320
|
-
if(memcmp(data+depacket,op_de.packet,op_de.bytes)){
|
1321
|
-
fprintf(stderr,"packet data mismatch in decode! pos=%ld\n",
|
1322
|
-
depacket);
|
1323
|
-
exit(1);
|
1324
|
-
}
|
1325
|
-
/* check bos flag */
|
1326
|
-
if(bosflag==0 && op_de.b_o_s==0){
|
1327
|
-
fprintf(stderr,"b_o_s flag not set on packet!\n");
|
1328
|
-
exit(1);
|
1329
|
-
}
|
1330
|
-
if(bosflag && op_de.b_o_s){
|
1331
|
-
fprintf(stderr,"b_o_s flag incorrectly set on packet!\n");
|
1332
|
-
exit(1);
|
1333
|
-
}
|
1334
|
-
bosflag=1;
|
1335
|
-
depacket+=op_de.bytes;
|
1336
|
-
|
1337
|
-
/* check eos flag */
|
1338
|
-
if(eosflag){
|
1339
|
-
fprintf(stderr,"Multiple decoded packets with eos flag!\n");
|
1340
|
-
exit(1);
|
1341
|
-
}
|
1342
|
-
|
1343
|
-
if(op_de.e_o_s)eosflag=1;
|
1344
|
-
|
1345
|
-
/* check granulepos flag */
|
1346
|
-
if(op_de.granulepos!=-1){
|
1347
|
-
fprintf(stderr," granule:%ld ",(long)op_de.granulepos);
|
1348
|
-
}
|
1349
|
-
}
|
1350
|
-
}
|
1351
|
-
}
|
1352
|
-
}
|
1353
|
-
}
|
1354
|
-
}
|
1355
|
-
_ogg_free(data);
|
1356
|
-
if(headers[pageno]!=NULL){
|
1357
|
-
fprintf(stderr,"did not write last page!\n");
|
1358
|
-
exit(1);
|
1359
|
-
}
|
1360
|
-
if(headers[pageout]!=NULL){
|
1361
|
-
fprintf(stderr,"did not decode last page!\n");
|
1362
|
-
exit(1);
|
1363
|
-
}
|
1364
|
-
if(inptr!=outptr){
|
1365
|
-
fprintf(stderr,"encoded page data incomplete!\n");
|
1366
|
-
exit(1);
|
1367
|
-
}
|
1368
|
-
if(inptr!=deptr){
|
1369
|
-
fprintf(stderr,"decoded page data incomplete!\n");
|
1370
|
-
exit(1);
|
1371
|
-
}
|
1372
|
-
if(inptr!=depacket){
|
1373
|
-
fprintf(stderr,"decoded packet data incomplete!\n");
|
1374
|
-
exit(1);
|
1375
|
-
}
|
1376
|
-
if(!eosflag){
|
1377
|
-
fprintf(stderr,"Never got a packet with EOS set!\n");
|
1378
|
-
exit(1);
|
1379
|
-
}
|
1380
|
-
fprintf(stderr,"ok.\n");
|
1381
|
-
}
|
1382
|
-
|
1383
|
-
int main(void){
|
1384
|
-
|
1385
|
-
ogg_stream_init(&os_en,0x04030201);
|
1386
|
-
ogg_stream_init(&os_de,0x04030201);
|
1387
|
-
ogg_sync_init(&oy);
|
1388
|
-
|
1389
|
-
/* Exercise each code path in the framing code. Also verify that
|
1390
|
-
the checksums are working. */
|
1391
|
-
|
1392
|
-
{
|
1393
|
-
/* 17 only */
|
1394
|
-
const int packets[]={17, -1};
|
1395
|
-
const int *headret[]={head1_0,NULL};
|
1396
|
-
|
1397
|
-
fprintf(stderr,"testing single page encoding... ");
|
1398
|
-
test_pack(packets,headret,0,0,0);
|
1399
|
-
}
|
1400
|
-
|
1401
|
-
{
|
1402
|
-
/* 17, 254, 255, 256, 500, 510, 600 byte, pad */
|
1403
|
-
const int packets[]={17, 254, 255, 256, 500, 510, 600, -1};
|
1404
|
-
const int *headret[]={head1_1,head2_1,NULL};
|
1405
|
-
|
1406
|
-
fprintf(stderr,"testing basic page encoding... ");
|
1407
|
-
test_pack(packets,headret,0,0,0);
|
1408
|
-
}
|
1409
|
-
|
1410
|
-
{
|
1411
|
-
/* nil packets; beginning,middle,end */
|
1412
|
-
const int packets[]={0,17, 254, 255, 0, 256, 0, 500, 510, 600, 0, -1};
|
1413
|
-
const int *headret[]={head1_2,head2_2,NULL};
|
1414
|
-
|
1415
|
-
fprintf(stderr,"testing basic nil packets... ");
|
1416
|
-
test_pack(packets,headret,0,0,0);
|
1417
|
-
}
|
1418
|
-
|
1419
|
-
{
|
1420
|
-
/* large initial packet */
|
1421
|
-
const int packets[]={4345,259,255,-1};
|
1422
|
-
const int *headret[]={head1_3,head2_3,NULL};
|
1423
|
-
|
1424
|
-
fprintf(stderr,"testing initial-packet lacing > 4k... ");
|
1425
|
-
test_pack(packets,headret,0,0,0);
|
1426
|
-
}
|
1427
|
-
|
1428
|
-
{
|
1429
|
-
/* continuing packet test */
|
1430
|
-
const int packets[]={0,4345,259,255,-1};
|
1431
|
-
const int *headret[]={head1_4,head2_4,head3_4,NULL};
|
1432
|
-
|
1433
|
-
fprintf(stderr,"testing single packet page span... ");
|
1434
|
-
test_pack(packets,headret,0,0,0);
|
1435
|
-
}
|
1436
|
-
|
1437
|
-
/* page with the 255 segment limit */
|
1438
|
-
{
|
1439
|
-
|
1440
|
-
const int packets[]={0,10,10,10,10,10,10,10,10,
|
1441
|
-
10,10,10,10,10,10,10,10,
|
1442
|
-
10,10,10,10,10,10,10,10,
|
1443
|
-
10,10,10,10,10,10,10,10,
|
1444
|
-
10,10,10,10,10,10,10,10,
|
1445
|
-
10,10,10,10,10,10,10,10,
|
1446
|
-
10,10,10,10,10,10,10,10,
|
1447
|
-
10,10,10,10,10,10,10,10,
|
1448
|
-
10,10,10,10,10,10,10,10,
|
1449
|
-
10,10,10,10,10,10,10,10,
|
1450
|
-
10,10,10,10,10,10,10,10,
|
1451
|
-
10,10,10,10,10,10,10,10,
|
1452
|
-
10,10,10,10,10,10,10,10,
|
1453
|
-
10,10,10,10,10,10,10,10,
|
1454
|
-
10,10,10,10,10,10,10,10,
|
1455
|
-
10,10,10,10,10,10,10,10,
|
1456
|
-
10,10,10,10,10,10,10,10,
|
1457
|
-
10,10,10,10,10,10,10,10,
|
1458
|
-
10,10,10,10,10,10,10,10,
|
1459
|
-
10,10,10,10,10,10,10,10,
|
1460
|
-
10,10,10,10,10,10,10,10,
|
1461
|
-
10,10,10,10,10,10,10,10,
|
1462
|
-
10,10,10,10,10,10,10,10,
|
1463
|
-
10,10,10,10,10,10,10,10,
|
1464
|
-
10,10,10,10,10,10,10,10,
|
1465
|
-
10,10,10,10,10,10,10,10,
|
1466
|
-
10,10,10,10,10,10,10,10,
|
1467
|
-
10,10,10,10,10,10,10,10,
|
1468
|
-
10,10,10,10,10,10,10,10,
|
1469
|
-
10,10,10,10,10,10,10,10,
|
1470
|
-
10,10,10,10,10,10,10,10,
|
1471
|
-
10,10,10,10,10,10,10,50,-1};
|
1472
|
-
const int *headret[]={head1_5,head2_5,head3_5,NULL};
|
1473
|
-
|
1474
|
-
fprintf(stderr,"testing max packet segments... ");
|
1475
|
-
test_pack(packets,headret,0,0,0);
|
1476
|
-
}
|
1477
|
-
|
1478
|
-
{
|
1479
|
-
/* packet that overspans over an entire page */
|
1480
|
-
const int packets[]={0,100,9000,259,255,-1};
|
1481
|
-
const int *headret[]={head1_6,head2_6,head3_6,head4_6,NULL};
|
1482
|
-
|
1483
|
-
fprintf(stderr,"testing very large packets... ");
|
1484
|
-
test_pack(packets,headret,0,0,0);
|
1485
|
-
}
|
1486
|
-
|
1487
|
-
{
|
1488
|
-
/* test for the libogg 1.1.1 resync in large continuation bug
|
1489
|
-
found by Josh Coalson) */
|
1490
|
-
const int packets[]={0,100,9000,259,255,-1};
|
1491
|
-
const int *headret[]={head1_6,head2_6,head3_6,head4_6,NULL};
|
1492
|
-
|
1493
|
-
fprintf(stderr,"testing continuation resync in very large packets... ");
|
1494
|
-
test_pack(packets,headret,100,2,3);
|
1495
|
-
}
|
1496
|
-
|
1497
|
-
{
|
1498
|
-
/* term only page. why not? */
|
1499
|
-
const int packets[]={0,100,4080,-1};
|
1500
|
-
const int *headret[]={head1_7,head2_7,head3_7,NULL};
|
1501
|
-
|
1502
|
-
fprintf(stderr,"testing zero data page (1 nil packet)... ");
|
1503
|
-
test_pack(packets,headret,0,0,0);
|
1504
|
-
}
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
{
|
1509
|
-
/* build a bunch of pages for testing */
|
1510
|
-
unsigned char *data=_ogg_malloc(1024*1024);
|
1511
|
-
int pl[]={0,100,4079,2956,2057,76,34,912,0,234,1000,1000,1000,300,-1};
|
1512
|
-
int inptr=0,i,j;
|
1513
|
-
ogg_page og[5];
|
1514
|
-
|
1515
|
-
ogg_stream_reset(&os_en);
|
1516
|
-
|
1517
|
-
for(i=0;pl[i]!=-1;i++){
|
1518
|
-
ogg_packet op;
|
1519
|
-
int len=pl[i];
|
1520
|
-
|
1521
|
-
op.packet=data+inptr;
|
1522
|
-
op.bytes=len;
|
1523
|
-
op.e_o_s=(pl[i+1]<0?1:0);
|
1524
|
-
op.granulepos=(i+1)*1000;
|
1525
|
-
|
1526
|
-
for(j=0;j<len;j++)data[inptr++]=i+j;
|
1527
|
-
ogg_stream_packetin(&os_en,&op);
|
1528
|
-
}
|
1529
|
-
|
1530
|
-
_ogg_free(data);
|
1531
|
-
|
1532
|
-
/* retrieve finished pages */
|
1533
|
-
for(i=0;i<5;i++){
|
1534
|
-
if(ogg_stream_pageout(&os_en,&og[i])==0){
|
1535
|
-
fprintf(stderr,"Too few pages output building sync tests!\n");
|
1536
|
-
exit(1);
|
1537
|
-
}
|
1538
|
-
copy_page(&og[i]);
|
1539
|
-
}
|
1540
|
-
|
1541
|
-
/* Test lost pages on pagein/packetout: no rollback */
|
1542
|
-
{
|
1543
|
-
ogg_page temp;
|
1544
|
-
ogg_packet test;
|
1545
|
-
|
1546
|
-
fprintf(stderr,"Testing loss of pages... ");
|
1547
|
-
|
1548
|
-
ogg_sync_reset(&oy);
|
1549
|
-
ogg_stream_reset(&os_de);
|
1550
|
-
for(i=0;i<5;i++){
|
1551
|
-
memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header,
|
1552
|
-
og[i].header_len);
|
1553
|
-
ogg_sync_wrote(&oy,og[i].header_len);
|
1554
|
-
memcpy(ogg_sync_buffer(&oy,og[i].body_len),og[i].body,og[i].body_len);
|
1555
|
-
ogg_sync_wrote(&oy,og[i].body_len);
|
1556
|
-
}
|
1557
|
-
|
1558
|
-
ogg_sync_pageout(&oy,&temp);
|
1559
|
-
ogg_stream_pagein(&os_de,&temp);
|
1560
|
-
ogg_sync_pageout(&oy,&temp);
|
1561
|
-
ogg_stream_pagein(&os_de,&temp);
|
1562
|
-
ogg_sync_pageout(&oy,&temp);
|
1563
|
-
/* skip */
|
1564
|
-
ogg_sync_pageout(&oy,&temp);
|
1565
|
-
ogg_stream_pagein(&os_de,&temp);
|
1566
|
-
|
1567
|
-
/* do we get the expected results/packets? */
|
1568
|
-
|
1569
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1570
|
-
checkpacket(&test,0,0,0);
|
1571
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1572
|
-
checkpacket(&test,100,1,-1);
|
1573
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1574
|
-
checkpacket(&test,4079,2,3000);
|
1575
|
-
if(ogg_stream_packetout(&os_de,&test)!=-1){
|
1576
|
-
fprintf(stderr,"Error: loss of page did not return error\n");
|
1577
|
-
exit(1);
|
1578
|
-
}
|
1579
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1580
|
-
checkpacket(&test,76,5,-1);
|
1581
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1582
|
-
checkpacket(&test,34,6,-1);
|
1583
|
-
fprintf(stderr,"ok.\n");
|
1584
|
-
}
|
1585
|
-
|
1586
|
-
/* Test lost pages on pagein/packetout: rollback with continuation */
|
1587
|
-
{
|
1588
|
-
ogg_page temp;
|
1589
|
-
ogg_packet test;
|
1590
|
-
|
1591
|
-
fprintf(stderr,"Testing loss of pages (rollback required)... ");
|
1592
|
-
|
1593
|
-
ogg_sync_reset(&oy);
|
1594
|
-
ogg_stream_reset(&os_de);
|
1595
|
-
for(i=0;i<5;i++){
|
1596
|
-
memcpy(ogg_sync_buffer(&oy,og[i].header_len),og[i].header,
|
1597
|
-
og[i].header_len);
|
1598
|
-
ogg_sync_wrote(&oy,og[i].header_len);
|
1599
|
-
memcpy(ogg_sync_buffer(&oy,og[i].body_len),og[i].body,og[i].body_len);
|
1600
|
-
ogg_sync_wrote(&oy,og[i].body_len);
|
1601
|
-
}
|
1602
|
-
|
1603
|
-
ogg_sync_pageout(&oy,&temp);
|
1604
|
-
ogg_stream_pagein(&os_de,&temp);
|
1605
|
-
ogg_sync_pageout(&oy,&temp);
|
1606
|
-
ogg_stream_pagein(&os_de,&temp);
|
1607
|
-
ogg_sync_pageout(&oy,&temp);
|
1608
|
-
ogg_stream_pagein(&os_de,&temp);
|
1609
|
-
ogg_sync_pageout(&oy,&temp);
|
1610
|
-
/* skip */
|
1611
|
-
ogg_sync_pageout(&oy,&temp);
|
1612
|
-
ogg_stream_pagein(&os_de,&temp);
|
1613
|
-
|
1614
|
-
/* do we get the expected results/packets? */
|
1615
|
-
|
1616
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1617
|
-
checkpacket(&test,0,0,0);
|
1618
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1619
|
-
checkpacket(&test,100,1,-1);
|
1620
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1621
|
-
checkpacket(&test,4079,2,3000);
|
1622
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1623
|
-
checkpacket(&test,2956,3,4000);
|
1624
|
-
if(ogg_stream_packetout(&os_de,&test)!=-1){
|
1625
|
-
fprintf(stderr,"Error: loss of page did not return error\n");
|
1626
|
-
exit(1);
|
1627
|
-
}
|
1628
|
-
if(ogg_stream_packetout(&os_de,&test)!=1)error();
|
1629
|
-
checkpacket(&test,300,13,14000);
|
1630
|
-
fprintf(stderr,"ok.\n");
|
1631
|
-
}
|
1632
|
-
|
1633
|
-
/* the rest only test sync */
|
1634
|
-
{
|
1635
|
-
ogg_page og_de;
|
1636
|
-
/* Test fractional page inputs: incomplete capture */
|
1637
|
-
fprintf(stderr,"Testing sync on partial inputs... ");
|
1638
|
-
ogg_sync_reset(&oy);
|
1639
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
|
1640
|
-
3);
|
1641
|
-
ogg_sync_wrote(&oy,3);
|
1642
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1643
|
-
|
1644
|
-
/* Test fractional page inputs: incomplete fixed header */
|
1645
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+3,
|
1646
|
-
20);
|
1647
|
-
ogg_sync_wrote(&oy,20);
|
1648
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1649
|
-
|
1650
|
-
/* Test fractional page inputs: incomplete header */
|
1651
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+23,
|
1652
|
-
5);
|
1653
|
-
ogg_sync_wrote(&oy,5);
|
1654
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1655
|
-
|
1656
|
-
/* Test fractional page inputs: incomplete body */
|
1657
|
-
|
1658
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+28,
|
1659
|
-
og[1].header_len-28);
|
1660
|
-
ogg_sync_wrote(&oy,og[1].header_len-28);
|
1661
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1662
|
-
|
1663
|
-
memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,1000);
|
1664
|
-
ogg_sync_wrote(&oy,1000);
|
1665
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1666
|
-
|
1667
|
-
memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body+1000,
|
1668
|
-
og[1].body_len-1000);
|
1669
|
-
ogg_sync_wrote(&oy,og[1].body_len-1000);
|
1670
|
-
if(ogg_sync_pageout(&oy,&og_de)<=0)error();
|
1671
|
-
|
1672
|
-
fprintf(stderr,"ok.\n");
|
1673
|
-
}
|
1674
|
-
|
1675
|
-
/* Test fractional page inputs: page + incomplete capture */
|
1676
|
-
{
|
1677
|
-
ogg_page og_de;
|
1678
|
-
fprintf(stderr,"Testing sync on 1+partial inputs... ");
|
1679
|
-
ogg_sync_reset(&oy);
|
1680
|
-
|
1681
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
|
1682
|
-
og[1].header_len);
|
1683
|
-
ogg_sync_wrote(&oy,og[1].header_len);
|
1684
|
-
|
1685
|
-
memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
|
1686
|
-
og[1].body_len);
|
1687
|
-
ogg_sync_wrote(&oy,og[1].body_len);
|
1688
|
-
|
1689
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
|
1690
|
-
20);
|
1691
|
-
ogg_sync_wrote(&oy,20);
|
1692
|
-
if(ogg_sync_pageout(&oy,&og_de)<=0)error();
|
1693
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1694
|
-
|
1695
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header+20,
|
1696
|
-
og[1].header_len-20);
|
1697
|
-
ogg_sync_wrote(&oy,og[1].header_len-20);
|
1698
|
-
memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
|
1699
|
-
og[1].body_len);
|
1700
|
-
ogg_sync_wrote(&oy,og[1].body_len);
|
1701
|
-
if(ogg_sync_pageout(&oy,&og_de)<=0)error();
|
1702
|
-
|
1703
|
-
fprintf(stderr,"ok.\n");
|
1704
|
-
}
|
1705
|
-
|
1706
|
-
/* Test recapture: garbage + page */
|
1707
|
-
{
|
1708
|
-
ogg_page og_de;
|
1709
|
-
fprintf(stderr,"Testing search for capture... ");
|
1710
|
-
ogg_sync_reset(&oy);
|
1711
|
-
|
1712
|
-
/* 'garbage' */
|
1713
|
-
memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
|
1714
|
-
og[1].body_len);
|
1715
|
-
ogg_sync_wrote(&oy,og[1].body_len);
|
1716
|
-
|
1717
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
|
1718
|
-
og[1].header_len);
|
1719
|
-
ogg_sync_wrote(&oy,og[1].header_len);
|
1720
|
-
|
1721
|
-
memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
|
1722
|
-
og[1].body_len);
|
1723
|
-
ogg_sync_wrote(&oy,og[1].body_len);
|
1724
|
-
|
1725
|
-
memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header,
|
1726
|
-
20);
|
1727
|
-
ogg_sync_wrote(&oy,20);
|
1728
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1729
|
-
if(ogg_sync_pageout(&oy,&og_de)<=0)error();
|
1730
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1731
|
-
|
1732
|
-
memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header+20,
|
1733
|
-
og[2].header_len-20);
|
1734
|
-
ogg_sync_wrote(&oy,og[2].header_len-20);
|
1735
|
-
memcpy(ogg_sync_buffer(&oy,og[2].body_len),og[2].body,
|
1736
|
-
og[2].body_len);
|
1737
|
-
ogg_sync_wrote(&oy,og[2].body_len);
|
1738
|
-
if(ogg_sync_pageout(&oy,&og_de)<=0)error();
|
1739
|
-
|
1740
|
-
fprintf(stderr,"ok.\n");
|
1741
|
-
}
|
1742
|
-
|
1743
|
-
/* Test recapture: page + garbage + page */
|
1744
|
-
{
|
1745
|
-
ogg_page og_de;
|
1746
|
-
fprintf(stderr,"Testing recapture... ");
|
1747
|
-
ogg_sync_reset(&oy);
|
1748
|
-
|
1749
|
-
memcpy(ogg_sync_buffer(&oy,og[1].header_len),og[1].header,
|
1750
|
-
og[1].header_len);
|
1751
|
-
ogg_sync_wrote(&oy,og[1].header_len);
|
1752
|
-
|
1753
|
-
memcpy(ogg_sync_buffer(&oy,og[1].body_len),og[1].body,
|
1754
|
-
og[1].body_len);
|
1755
|
-
ogg_sync_wrote(&oy,og[1].body_len);
|
1756
|
-
|
1757
|
-
memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header,
|
1758
|
-
og[2].header_len);
|
1759
|
-
ogg_sync_wrote(&oy,og[2].header_len);
|
1760
|
-
|
1761
|
-
memcpy(ogg_sync_buffer(&oy,og[2].header_len),og[2].header,
|
1762
|
-
og[2].header_len);
|
1763
|
-
ogg_sync_wrote(&oy,og[2].header_len);
|
1764
|
-
|
1765
|
-
if(ogg_sync_pageout(&oy,&og_de)<=0)error();
|
1766
|
-
|
1767
|
-
memcpy(ogg_sync_buffer(&oy,og[2].body_len),og[2].body,
|
1768
|
-
og[2].body_len-5);
|
1769
|
-
ogg_sync_wrote(&oy,og[2].body_len-5);
|
1770
|
-
|
1771
|
-
memcpy(ogg_sync_buffer(&oy,og[3].header_len),og[3].header,
|
1772
|
-
og[3].header_len);
|
1773
|
-
ogg_sync_wrote(&oy,og[3].header_len);
|
1774
|
-
|
1775
|
-
memcpy(ogg_sync_buffer(&oy,og[3].body_len),og[3].body,
|
1776
|
-
og[3].body_len);
|
1777
|
-
ogg_sync_wrote(&oy,og[3].body_len);
|
1778
|
-
|
1779
|
-
if(ogg_sync_pageout(&oy,&og_de)>0)error();
|
1780
|
-
if(ogg_sync_pageout(&oy,&og_de)<=0)error();
|
1781
|
-
|
1782
|
-
fprintf(stderr,"ok.\n");
|
1783
|
-
}
|
1784
|
-
|
1785
|
-
/* Free page data that was previously copied */
|
1786
|
-
{
|
1787
|
-
for(i=0;i<5;i++){
|
1788
|
-
free_page(&og[i]);
|
1789
|
-
}
|
1790
|
-
}
|
1791
|
-
}
|
1792
|
-
|
1793
|
-
return(0);
|
1794
|
-
}
|
1795
|
-
|
1796
|
-
#endif
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|