diff --git a/Makefile.am b/Makefile.am index 3e688fc948145edcc1975b994f6586f947c4baba..74f0cf335478db3e10cd7e3e9655bfe3fee46307 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.in b/configure.in index 623e27971985d6b0ac7b66d630d80d6abfd0b1df..e0cb15bcacce8b2617815afae0c3fc02eefa03fd 100644 --- a/configure.in +++ b/configure.in @@ -83,4 +83,4 @@ AC_SUBST(DEBUG) 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) diff --git a/ogginfo/Makefile.am b/ogginfo/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..f8f2b7d8cebaa67ae5bd0fdcb31d56ffd65c6169 --- /dev/null +++ b/ogginfo/Makefile.am @@ -0,0 +1,17 @@ +## 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@" diff --git a/ogginfo/ogginfo.c b/ogginfo/ogginfo.c new file mode 100644 index 0000000000000000000000000000000000000000..f878b221f822ed39ed8130783da76bc8b120db10 --- /dev/null +++ b/ogginfo/ogginfo.c @@ -0,0 +1,73 @@ +// gcc ogginfo.c -o ogginfo -lvorbisfile -lvorbis -Wall + +#include +#include +#include +#include +#include +#include +#include +#include + +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; +} diff --git a/vorbis-tools.spec b/vorbis-tools.spec index 350b71be2ff4c604df81f9e61f1031a506948c3a..5ca4f53afe7cacab0e64444e967def6497cc3260 100644 --- a/vorbis-tools.spec +++ b/vorbis-tools.spec @@ -41,6 +41,7 @@ make DESTDIR=$RPM_BUILD_ROOT install %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 @@ make DESTDIR=$RPM_BUILD_ROOT install %postun %changelog +* Sun Jun 17 2001 Jack Moffitt +- updated for rc1 +- added ogginfo * Mon Jan 22 2001 Jack Moffitt - updated for prebeta4 builds * Sun Oct 29 2000 Jack Moffitt