[cvs-annodex] commit (/annodex): libfishsound/branches/1.0-stable/src/examples/fishsound-info.c

conrad nobody at lists.annodex.net
Tue Aug 9 15:45:25 EST 2005


Update of /annodex (new revision 1424)

Modified files:
   libfishsound/branches/1.0-stable/src/examples/fishsound-info.c

Log Message:
libfishsound-stable: display duration in frames in fishsound-info


Modified: libfishsound/branches/1.0-stable/src/examples/fishsound-info.c
===================================================================
--- libfishsound/branches/1.0-stable/src/examples/fishsound-info.c	2005-08-09 03:25:43 UTC (rev 1423)
+++ libfishsound/branches/1.0-stable/src/examples/fishsound-info.c	2005-08-09 05:45:23 UTC (rev 1424)
@@ -42,6 +42,7 @@
 static char * infilename;
 static int begun = 0;
 static FishSoundInfo fsinfo;
+static long actual_frames_decoded = 0;
 
 static void
 read_comments (FishSound * fsound)
@@ -70,6 +71,8 @@
     begun = 1;
   }
 
+  actual_frames_decoded += frames;
+
   return 0;
 }
 
@@ -78,9 +81,13 @@
 {
   FishSound * fsound = (FishSound *)user_data;
 
+  if (op->e_o_s) {
+    fish_sound_prepare_truncation (fsound, op->e_o_s, op->granulepos);
+  }
+
   fish_sound_decode (fsound, op->packet, op->bytes);
 
-  return 0;
+  return OGGZ_CONTINUE;
 }
 
 int
@@ -93,7 +100,7 @@
   if (argc < 2) {
     printf ("usage: %s infilename\n", argv[0]);
     printf ("*** FishSound example program. ***\n");
-    printf ("Read comments from an Ogg Speex or Ogg Vorbis file.\n");
+    printf ("Display information about an Ogg Speex or Ogg Vorbis file.\n");
     exit (1);
   }
 
@@ -114,6 +121,9 @@
 
   oggz_close (oggz);
 
+  printf ("%ld frames decoded\n", actual_frames_decoded);
+  printf ("%ld frames reported\n", fish_sound_get_frameno (fsound));
+
   fish_sound_delete (fsound);
   
   exit (0);


-- 
conrad



More information about the cvs-annodex mailing list