Commit 503f0bbe authored by Jack Moffitt's avatar Jack Moffitt

ogginfo commited and integrated into vorbis-tools.

This program courtesy of <idcmp@linuxstuff.org>

It's a start.

svn path=/trunk/vorbis-tools/; revision=1497
parent df140505
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = foreign dist-zip 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 EXTRA_DIST = README AUTHORS COPYING vorbis-tools.spec acinclude.m4
......
...@@ -83,4 +83,4 @@ AC_SUBST(DEBUG) ...@@ -83,4 +83,4 @@ AC_SUBST(DEBUG)
AC_SUBST(PROFILE) AC_SUBST(PROFILE)
AC_SUBST(SOCKET_LIBS) 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)
## 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@"
// 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;
}
...@@ -41,6 +41,7 @@ make DESTDIR=$RPM_BUILD_ROOT install ...@@ -41,6 +41,7 @@ make DESTDIR=$RPM_BUILD_ROOT install
%doc ogg123/ogg123rc-example %doc ogg123/ogg123rc-example
/usr/bin/oggenc /usr/bin/oggenc
/usr/bin/ogg123 /usr/bin/ogg123
/usr/bin/ogginfo
/usr/bin/vorbiscomment /usr/bin/vorbiscomment
/usr/share/man/man1/ogg123.1* /usr/share/man/man1/ogg123.1*
/usr/share/man/man1/oggenc.1* /usr/share/man/man1/oggenc.1*
...@@ -53,6 +54,9 @@ make DESTDIR=$RPM_BUILD_ROOT install ...@@ -53,6 +54,9 @@ make DESTDIR=$RPM_BUILD_ROOT install
%postun %postun
%changelog %changelog
* Sun Jun 17 2001 Jack Moffitt <jack@icecast.org>
- updated for rc1
- added ogginfo
* Mon Jan 22 2001 Jack Moffitt <jack@icecast.org> * Mon Jan 22 2001 Jack Moffitt <jack@icecast.org>
- updated for prebeta4 builds - updated for prebeta4 builds
* Sun Oct 29 2000 Jack Moffitt <jack@icecast.org> * Sun Oct 29 2000 Jack Moffitt <jack@icecast.org>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment