summaryrefslogtreecommitdiff
path: root/packages/cdstatus
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@yahoo.com>2005-11-28 21:00:40 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-11-28 21:00:40 +0000
commite63a19bbc2bd8f4718f9f7db3f6bda2cfac89dec (patch)
treeaec1ce789d4349595f80d2ba8719c66714639d80 /packages/cdstatus
parent4fc14624876da16888e39dcb12f22c640946220d (diff)
cdstatus: created; made patch that allow both LE and BE machines to write a proper wav header
Diffstat (limited to 'packages/cdstatus')
-rw-r--r--packages/cdstatus/.mtn2git_empty0
-rw-r--r--packages/cdstatus/cdstatus-0.96.05.bb25
-rw-r--r--packages/cdstatus/cdstatus-0.96.05/.mtn2git_empty0
-rw-r--r--packages/cdstatus/cdstatus-0.96.05/cdstatus.patch131
4 files changed, 156 insertions, 0 deletions
diff --git a/packages/cdstatus/.mtn2git_empty b/packages/cdstatus/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/cdstatus/.mtn2git_empty
diff --git a/packages/cdstatus/cdstatus-0.96.05.bb b/packages/cdstatus/cdstatus-0.96.05.bb
new file mode 100644
index 0000000000..1ae728f836
--- /dev/null
+++ b/packages/cdstatus/cdstatus-0.96.05.bb
@@ -0,0 +1,25 @@
+# cdstatus OE build file
+
+PR="r0"
+LICENSE="GPL"
+HOMEPAGE = "http://cdstatus.sourceforge.net/"
+FILES_${PN} += ${datadir}/cdstatus.cfg
+
+SRC_URI="${SOURCEFORGE_MIRROR}/cdstatus/cdstatus-0.96.05.tar.gz \
+ file://cdstatus.patch;patch=1"
+
+S="${WORKDIR}/cdstatus-0.96.05"
+
+inherit autotools
+
+TARGET_LDFLAGS=""
+
+do_install() {
+ install -d 0755 ${D}/${bindir}
+ install -d 0755 ${D}/${datadir}
+ install -d 0755 ${D}/${mandir}
+ install -m 0755 src/cdstatus ${D}/${bindir}
+ install -m 0644 cdstatus.cfg ${D}/${datadir}
+ install -m 0644 cdstatus.1 ${D}/${mandir}
+
+}
diff --git a/packages/cdstatus/cdstatus-0.96.05/.mtn2git_empty b/packages/cdstatus/cdstatus-0.96.05/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/cdstatus/cdstatus-0.96.05/.mtn2git_empty
diff --git a/packages/cdstatus/cdstatus-0.96.05/cdstatus.patch b/packages/cdstatus/cdstatus-0.96.05/cdstatus.patch
new file mode 100644
index 0000000000..913cd721e0
--- /dev/null
+++ b/packages/cdstatus/cdstatus-0.96.05/cdstatus.patch
@@ -0,0 +1,131 @@
+*** cdstatus-0.96.05/src/cdstatus.c.orig 2005-11-26 16:23:27.000000000 +0100
+--- cdstatus-0.96.05/src/cdstatus.c 2005-11-26 19:06:57.000000000 +0100
+***************
+*** 436,441 ****
+--- 436,501 ----
+ return 0;
+ }
+
++ /* following code copied from
++ http://www.gamedev.net/reference/articles/article2091.asp
++ it has been slightly modified as we did not have a reason to output
++ big endian or float
++ */
++ static short ShortSwap( short s )
++ {
++ unsigned char b1, b2;
++
++ b1 = s & 255;
++ b2 = (s >> 8) & 255;
++
++ return (b1 << 8) + b2;
++ }
++
++ static short ShortNoSwap( short s )
++ {
++ return s;
++ }
++
++ static int LongSwap (int i)
++ {
++ unsigned char b1, b2, b3, b4;
++
++ b1 = i & 255;
++ b2 = ( i >> 8 ) & 255;
++ b3 = ( i>>16 ) & 255;
++ b4 = ( i>>24 ) & 255;
++
++ return ((int)b1 << 24) + ((int)b2 << 16) + ((int)b3 << 8) + b4;
++ }
++
++ static int LongNoSwap( int i )
++ {
++ return i;
++ }
++
++ static short (*LittleShort) ( short s );
++ static int (*LittleLong) ( int i );
++
++ static void InitEndian( void )
++ {
++ char SwapTest[2] = { 1, 0 };
++
++ if( *(short *) SwapTest == 1 )
++ {
++ // little endian
++ //set func pointers to correct funcs
++ LittleShort = ShortNoSwap;
++ LittleLong = LongNoSwap;
++ }
++ else
++ {
++ // big endian
++ LittleShort = ShortSwap;
++ LittleLong = LongSwap;
++ }
++ }
++ /* end of copied code */
++
+ static void writeWavHeader(unsigned int readframes, FILE * audio_out)
+ {
+ long int chunksize;
+***************
+*** 456,478 ****
+
+ wavHeader wHeader;
+
+ /* "RIFF" */
+! wHeader.RIFF_header = 0x46464952;
+
+ chunksize = readframes * CD_FRAMESIZE_RAW;
+! wHeader.total_size = (int32_t)(chunksize + sizeof(wavHeader));
+
+ /* "WAVEfmt " */
+! wHeader.WAVE = 0x45564157;
+! wHeader.fmt = 0x20746D66;
+
+! wHeader.subchunk_size = 16;
+! wHeader.audio_format = 1;
+! wHeader.number_channels = 2;
+! wHeader.sampling_rate = 44100;
+! wHeader.byte_rate = 176400;
+! wHeader.block_align = 4;
+! wHeader.bits_per_sample = 16;
+
+ if(fwrite((const void *) &wHeader, sizeof(wavHeader), (size_t) 1, audio_out)!=1)
+ {
+--- 516,539 ----
+
+ wavHeader wHeader;
+
++ InitEndian();
+ /* "RIFF" */
+! wHeader.RIFF_header = LittleLong(0x46464952);
+
+ chunksize = readframes * CD_FRAMESIZE_RAW;
+! wHeader.total_size = LittleLong((int32_t)(chunksize + sizeof(wavHeader)));
+
+ /* "WAVEfmt " */
+! wHeader.WAVE = LittleLong(0x45564157);
+! wHeader.fmt = LittleLong(0x20746D66);
+
+! wHeader.subchunk_size = LittleLong(16);
+! wHeader.audio_format = LittleShort(1);
+! wHeader.number_channels = LittleShort(2);
+! wHeader.sampling_rate = LittleLong(44100);
+! wHeader.byte_rate = LittleLong(176400);
+! wHeader.block_align = LittleShort(4);
+! wHeader.bits_per_sample = LittleShort(16);
+
+ if(fwrite((const void *) &wHeader, sizeof(wavHeader), (size_t) 1, audio_out)!=1)
+ {
+***************
+*** 492,497 ****
+--- 553,559 ----
+ }
+ exit(EXIT_FAILURE);
+ }
++ chunksize = LittleLong(chunksize);
+ if(fwrite((const void *) &chunksize, sizeof(long int), (size_t) 1, audio_out)!=1)
+ {
+ perror("Error writing wav file chunksize header");