[xiph-cvs] cvs commit: vorbis-tools/ogginfo Makefile.am ogginfo.c

Jack Moffitt jack at xiph.org
Sun Jun 17 19:24:26 PDT 2001



jack        01/06/17 19:24:26

  Modified:    .        Makefile.am configure.in vorbis-tools.spec
  Added:       ogginfo  Makefile.am ogginfo.c
  Log:
  ogginfo commited and integrated into vorbis-tools.
  
  This program courtesy of <idcmp at linuxstuff.org>
  
  It's a start.

Revision  Changes    Path
1.6       +1 -1      vorbis-tools/Makefile.am

Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile.am	2000/11/18 04:30:01	1.5
+++ Makefile.am	2001/06/18 02:24:25	1.6
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign dist-zip
 
-SUBDIRS = oggenc ogg123 vorbiscomment debian
+SUBDIRS = oggenc ogg123 vorbiscomment ogginfo debian
 
 EXTRA_DIST = README AUTHORS COPYING vorbis-tools.spec acinclude.m4
 

1.20      +1 -1      vorbis-tools/configure.in

Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/configure.in,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- configure.in	2001/06/18 00:32:47	1.19
+++ configure.in	2001/06/18 02:24:25	1.20
@@ -83,4 +83,4 @@
 AC_SUBST(PROFILE)
 AC_SUBST(SOCKET_LIBS)
 
-AC_OUTPUT(Makefile oggenc/Makefile oggenc/man/Makefile ogg123/Makefile vorbiscomment/Makefile debian/Makefile)
+AC_OUTPUT(Makefile oggenc/Makefile oggenc/man/Makefile ogg123/Makefile vorbiscomment/Makefile ogginfo/Makefile debian/Makefile)

1.18      +4 -0      vorbis-tools/vorbis-tools.spec

Index: vorbis-tools.spec
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vorbis-tools.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- vorbis-tools.spec	2001/06/18 00:32:47	1.17
+++ vorbis-tools.spec	2001/06/18 02:24:25	1.18
@@ -41,6 +41,7 @@
 %doc ogg123/ogg123rc-example
 /usr/bin/oggenc
 /usr/bin/ogg123
+/usr/bin/ogginfo
 /usr/bin/vorbiscomment
 /usr/share/man/man1/ogg123.1*
 /usr/share/man/man1/oggenc.1*
@@ -53,6 +54,9 @@
 %postun
 
 %changelog
+* Sun Jun 17 2001 Jack Moffitt <jack at icecast.org>
+- updated for rc1
+- added ogginfo
 * Mon Jan 22 2001 Jack Moffitt <jack at icecast.org>
 - updated for prebeta4 builds
 * Sun Oct 29 2000 Jack Moffitt <jack at icecast.org>

1.1                  vorbis-tools/ogginfo/Makefile.am

Index: Makefile.am
===================================================================
## Process this file with automake to produce Makefile.in

AUTOMAKE_OPTIONS = foreign

bin_PROGRAMS = ogginfo

INCLUDES = @OGG_CFLAGS@ @VORBIS_CFLAGS@

ogginfo_LDADD = @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@

ogginfo_SOURCES = ogginfo.c

debug:
        $(MAKE) all CFLAGS="@DEBUG@"

profile:
        $(MAKE) all CFLAGS="@PROFILE@"

1.1                  vorbis-tools/ogginfo/ogginfo.c

Index: ogginfo.c
===================================================================
// gcc ogginfo.c -o ogginfo -lvorbisfile -lvorbis -Wall

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
#include <ao/ao.h>

void doinfo(char *);

int main(int ac,char **av)
{
  int i;

  if ( ac < 2 ) {
    fprintf(stderr,"Usage: %s [filename1.ogg] ... [filenameN.ogg]\n",av[0]);
    return(0);
  }

  for(i=1;i!=ac;i++) {
    doinfo(av[i]);
  }
  return(0);
  
}

void doinfo(char *filename)
{
  FILE *fp;
  OggVorbis_File vf;
  int rc,i;
  vorbis_comment *vc;
  double playtime;
  long playmin,playsec;

  memset(&vf,0,sizeof(OggVorbis_File));
  
  fp = fopen(filename,"r");
  if (!fp) {
    fprintf(stderr,"Unable to open \"%s\": %s\n",
            filename,
            strerror(errno));
  }

  rc = ov_open(fp,&vf,NULL,0);

  if (rc < 0) {
    fprintf(stderr,"Unable to understand \"%s\", errorcode=%d\n",
            filename,rc);
    return;
  }
  
  printf("filename=%s\n",filename);
  vc = ov_comment(&vf,-1);

  for (i=0; i < vc->comments; i++) {
    printf("%s\n",vc->user_comments[i]);
  }

  playtime = ov_time_total(&vf,-1);

  playmin = (long)playtime / (long)60;
  playsec = (long)playtime - (playmin*60);
  printf("length=%f\n",playtime);
  printf("playtime=%ld:%02ld\n",playmin,playsec);

  ov_clear(&vf);

  return;
}

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list