[Cvs-annodex] commit (annodex): libfishsound/branches/1.0-stable/include/fishsound/fishsound.h libfishsound/branches/1.0-stable/src/examples/fishsound-decenc.c libfishsound/branches/1.0-stable/src/examples/fishsound-decode.c libfishsound/branches/1.0-stable/src/examples/fishsound-encdec.c libfishsound/branches/1.0-stable/src/examples/fishsound-info.c

giles nobody at lists.annodex.net
Sun Oct 22 03:37:27 UTC 2006


Update of /var/local/lib/svn/annodex (new revision 2533)

Modified files:
   libfishsound/branches/1.0-stable/include/fishsound/fishsound.h
   libfishsound/branches/1.0-stable/src/examples/fishsound-decenc.c
   libfishsound/branches/1.0-stable/src/examples/fishsound-decode.c
   libfishsound/branches/1.0-stable/src/examples/fishsound-encdec.c
   libfishsound/branches/1.0-stable/src/examples/fishsound-info.c

Log Message:
Document that the fsinfo argument to fish_sound_new() can be NULL
when mode is FISH_SOUND_DECODE. Make use of this in the examples
since it makes the data flow more clear.

We note that the decenc example has some bogus code.


Modified: libfishsound/branches/1.0-stable/include/fishsound/fishsound.h
===================================================================
--- libfishsound/branches/1.0-stable/include/fishsound/fishsound.h	2006-10-21 06:16:16 UTC (rev 2532)
+++ libfishsound/branches/1.0-stable/include/fishsound/fishsound.h	2006-10-22 03:37:22 UTC (rev 2533)
@@ -439,7 +439,7 @@
 /**
  * Instantiate a new FishSound* handle
  * \param mode FISH_SOUND_DECODE or FISH_SOUND_ENCODE
- * \param fsinfo
+ * \param fsinfo Encoder configuration, may be NULL for FISH_SOUND_DECODE
  * \returns A new FishSound* handle, or NULL on error
  */
 FishSound * fish_sound_new (int mode, FishSoundInfo * fsinfo);

Modified: libfishsound/branches/1.0-stable/src/examples/fishsound-decenc.c
===================================================================
--- libfishsound/branches/1.0-stable/src/examples/fishsound-decenc.c	2006-10-21 06:16:16 UTC (rev 2532)
+++ libfishsound/branches/1.0-stable/src/examples/fishsound-decenc.c	2006-10-22 03:37:22 UTC (rev 2533)
@@ -147,7 +147,7 @@
   oggz_set_read_callback (ed->oggz_in, -1, read_packet, ed);
   ed->serialno = oggz_serialno_new (ed->oggz_out);
 
-  ed->decoder = fish_sound_new (FISH_SOUND_DECODE, &fsinfo);
+  ed->decoder = fish_sound_new (FISH_SOUND_DECODE, NULL);
 
   fish_sound_set_interleave (ed->decoder, interleave);
 
@@ -156,7 +156,7 @@
   ed->format = format;
   ed->begun = 0;
   ed->b_o_s = 1;
-  ed->channels = fsinfo.channels;
+  ed->channels = fsinfo.channels; /* FIXME: fsinfo is unitialized! */
   ed->interleave = interleave;
 
   if (interleave) {

Modified: libfishsound/branches/1.0-stable/src/examples/fishsound-decode.c
===================================================================
--- libfishsound/branches/1.0-stable/src/examples/fishsound-decode.c	2006-10-21 06:16:16 UTC (rev 2532)
+++ libfishsound/branches/1.0-stable/src/examples/fishsound-decode.c	2006-10-22 03:37:22 UTC (rev 2533)
@@ -102,7 +102,7 @@
   infilename = argv[1];
   outfilename = argv[2];
 
-  fsound = fish_sound_new (FISH_SOUND_DECODE, &fsinfo);
+  fsound = fish_sound_new (FISH_SOUND_DECODE, NULL);
 
   fish_sound_set_interleave (fsound, 1);
 

Modified: libfishsound/branches/1.0-stable/src/examples/fishsound-encdec.c
===================================================================
--- libfishsound/branches/1.0-stable/src/examples/fishsound-encdec.c	2006-10-21 06:16:16 UTC (rev 2532)
+++ libfishsound/branches/1.0-stable/src/examples/fishsound-encdec.c	2006-10-22 03:37:22 UTC (rev 2533)
@@ -105,7 +105,7 @@
   fsinfo.format = format;
 
   ed->encoder = fish_sound_new (FISH_SOUND_ENCODE, &fsinfo);
-  ed->decoder = fish_sound_new (FISH_SOUND_DECODE, &fsinfo);
+  ed->decoder = fish_sound_new (FISH_SOUND_DECODE, NULL);
 
   fish_sound_set_interleave (ed->encoder, 1);
   fish_sound_set_interleave (ed->decoder, 1);

Modified: libfishsound/branches/1.0-stable/src/examples/fishsound-info.c
===================================================================
--- libfishsound/branches/1.0-stable/src/examples/fishsound-info.c	2006-10-21 06:16:16 UTC (rev 2532)
+++ libfishsound/branches/1.0-stable/src/examples/fishsound-info.c	2006-10-22 03:37:22 UTC (rev 2533)
@@ -41,7 +41,6 @@
 
 static char * infilename;
 static int begun = 0;
-static FishSoundInfo fsinfo;
 static long actual_frames_decoded = 0;
 
 static void
@@ -106,7 +105,7 @@
 
   infilename = argv[1];
 
-  fsound = fish_sound_new (FISH_SOUND_DECODE, &fsinfo);
+  fsound = fish_sound_new (FISH_SOUND_DECODE, NULL);
   fish_sound_set_interleave (fsound, 1);
   fish_sound_set_decoded_float_ilv (fsound, decoded, NULL);
 


-- 
giles



More information about the cvs-annodex mailing list