├── po ├── hu.po ├── remove-potcdate.sin ├── quot.sed ├── boldquot.sed ├── insert-header.sin ├── remove-potcdate.sed ├── POTFILES.in ├── insert-header.sed ├── en@quot.header ├── en@boldquot.header ├── ChangeLog ├── Rules-quot ├── Makevars └── Makevars.template ├── win32 ├── tools.opt ├── config.h ├── Makefile.am ├── VS2005 │ ├── copy_libs_here.cmd │ └── vorbis-tools.sln ├── VS2013 │ ├── copy_libs_here.cmd │ ├── vcut │ │ └── vcut.vcxproj.filters │ ├── oggdec │ │ └── oggdec.vcxproj.filters │ ├── ogginfo │ │ └── ogginfo.vcxproj.filters │ ├── vorbiscomment │ │ └── vorbiscomment.vcxproj.filters │ ├── vorbis-tools.sln │ └── oggenc │ │ └── oggenc.vcxproj.filters ├── tools.dsp ├── tools.dsw └── VS2003 │ └── vorbis-tools.sln ├── include ├── Makefile.am ├── i18n.h ├── base64.h ├── utf8.h └── picture.h ├── oggenc ├── man │ └── Makefile.am ├── lyrics.h ├── platform.h ├── Makefile.am ├── flac.h ├── audio.h ├── skeleton.h ├── resample.h └── encode.h ├── tests ├── Makefile.am └── test-enc-dec ├── .travis.yml ├── autogen.sh ├── vorbiscomment ├── vceditaux.h ├── Makefile.am ├── vcedit.h └── vorbiscomment.1 ├── ogg123 ├── ogg123rc-example ├── remote.h ├── vorbis_comments.h ├── cmdline_options.h ├── compat.h ├── cfgfile_options.h ├── audio.h ├── Makefile.am ├── transport.c ├── ogg123.h ├── format.c ├── transport.h ├── callbacks.h ├── vgfilter.h ├── playlist.h ├── status.h ├── format.h ├── audio.c └── vgfilter.c ├── m4 ├── xsize.m4 ├── Makefile.am ├── signed.m4 ├── wchar_t.m4 ├── codeset.m4 ├── glibc2.m4 ├── inttypes.m4 ├── glibc21.m4 ├── inttypes-h.m4 ├── intldir.m4 ├── stdint_h.m4 ├── inttypes_h.m4 ├── isc-posix.m4 ├── wint_t.m4 ├── intmax.m4 ├── uintmax_t.m4 ├── inttypes-pri.m4 ├── longdouble.m4 ├── nls.m4 ├── lcmessage.m4 ├── printf-posix.m4 ├── ulonglong.m4 ├── pkg.m4 ├── visibility.m4 ├── ChangeLog ├── intdiv0.m4 ├── size_max.m4 ├── progtest.m4 ├── intlmacosx.m4 └── longlong.m4 ├── Makefile.am ├── AUTHORS ├── share ├── Makefile.am ├── makemap.c ├── charmaps.h ├── charset.h ├── base64.c └── charsetmap.h ├── vcut ├── Makefile.am ├── vcut.1 └── vcut.h ├── oggdec ├── Makefile.am └── oggdec.1 ├── .gitignore ├── ogginfo ├── codec_invalid.c ├── codec_other.c ├── Makefile.am ├── ogginfo.1 └── private.h ├── .gitlab-ci.yml ├── HACKING ├── README └── file-replace.pl /po/hu.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiph/vorbis-tools/HEAD/po/hu.po -------------------------------------------------------------------------------- /win32/tools.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiph/vorbis-tools/HEAD/win32/tools.opt -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | EXTRA_DIST = utf8.h getopt.h gettext.h i18n.h base64.h picture.h 4 | -------------------------------------------------------------------------------- /oggenc/man/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | mans = oggenc.1 4 | 5 | mandir = @MANDIR@ 6 | dist_man_MANS = $(mans) 7 | -------------------------------------------------------------------------------- /win32/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 1 3 | 4 | #define PACKAGE "vorbis-tools" 5 | #define VERSION "1.4.3" 6 | 7 | #endif /* CONFIG_H */ 8 | -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | TEST_ENV = @TEST_ENV@ 2 | LOG_COMPILER=$(LIBTOOL) --mode=execute $(TEST_ENV) 3 | 4 | TESTS = test-enc-dec 5 | 6 | EXTRA_DIST = $(TESTS) 7 | 8 | clean-local: 9 | $(RM) 1.ogg zeros.raw 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | addons: 4 | apt: 5 | packages: 6 | - libogg-dev 7 | - libvorbis-dev 8 | 9 | script: 10 | - ./autogen.sh 11 | - ./configure 12 | - make -j2 V=1 check 13 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to set up the build system: configure, makefiles, etc. 3 | set -e 4 | 5 | srcdir=`dirname $0` 6 | test -n "$srcdir" && cd "$srcdir" 7 | 8 | echo "Updating build configuration files for vorbis-tools, please wait...." 9 | 10 | autoreconf -isf 11 | -------------------------------------------------------------------------------- /vorbiscomment/vceditaux.h: -------------------------------------------------------------------------------- 1 | typedef struct vcedit_page_buffer { 2 | char *data; 3 | size_t data_len; 4 | } vcedit_page_buffer; 5 | 6 | typedef struct vcedit_buffer_chain { 7 | struct vcedit_buffer_chain *next; 8 | struct vcedit_page_buffer buffer; 9 | } vcedit_buffer_chain; 10 | -------------------------------------------------------------------------------- /win32/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | EXTRA_DIST = oggenc.dsp oggenc_dynamic.dsp ogginfo.dsp tools.dsp tools.dsw\ 4 | tools.opt vcut.dsp vorbiscomment.dsp 5 | 6 | debug: 7 | $(MAKE) all CFLAGS="@DEBUG@" 8 | 9 | profile: 10 | $(MAKE) all CFLAGS="@PROFILE@" 11 | -------------------------------------------------------------------------------- /include/i18n.h: -------------------------------------------------------------------------------- 1 | #ifndef VORBIS_TOOLS_I18N_H 2 | #define VORBIS_TOOLS_I18N_H 3 | 4 | #ifdef ENABLE_NLS 5 | #include 6 | #define _(X) gettext(X) 7 | #else 8 | #define _(X) (X) 9 | #define textdomain(X) 10 | #define bindtextdomain(X, Y) 11 | #endif 12 | #ifdef gettext_noop 13 | #define N_(X) gettext_noop(X) 14 | #else 15 | #define N_(X) (X) 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ogg123/ogg123rc-example: -------------------------------------------------------------------------------- 1 | # Copy this to ~/.ogg123rc and edit as necessary. These are all the 2 | # default options except for default device, which is a reasonable 3 | # default for many people. To see a full list of available options, 4 | # type: 5 | # 6 | # $ ogg123 -c 7 | 8 | default_device=oss 9 | shuffle=n 10 | verbose=1 11 | outbuffer=0 12 | outprebuffer=0 13 | inbuffer=10000 14 | inprebuffer=10 15 | #save_stream= 16 | delay=1 17 | -------------------------------------------------------------------------------- /m4/xsize.m4: -------------------------------------------------------------------------------- 1 | # xsize.m4 serial 3 2 | dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | AC_DEFUN([gl_XSIZE], 8 | [ 9 | dnl Prerequisites of lib/xsize.h. 10 | AC_REQUIRE([gl_SIZE_MAX]) 11 | AC_REQUIRE([AC_C_INLINE]) 12 | AC_CHECK_HEADERS(stdint.h) 13 | ]) 14 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AUTOMAKE_OPTIONS = foreign dist-zip 4 | 5 | SUBDIRS = po include share win32 @OPT_SUBDIRS@ tests 6 | DIST_SUBDIRS = po include share win32 ogg123 oggenc oggdec ogginfo \ 7 | vcut vorbiscomment m4 tests 8 | 9 | EXTRA_DIST = config.rpath README AUTHORS COPYING CHANGES 10 | 11 | debug: 12 | $(MAKE) all CFLAGS="@DEBUG@" 13 | 14 | profile: 15 | $(MAKE) all CFLAGS="@PROFILE@" 16 | 17 | ACLOCAL_AMFLAGS = -I m4 18 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | oggenc: 2 | Michael Smith 3 | 4 | oggdec: 5 | Michael Smith 6 | 7 | ogg123: 8 | Kenneth Arnold 9 | Stan Seibert 10 | Segher Boessenkool 11 | 12 | ogginfo: 13 | Michael Smith 14 | 15 | vcut: 16 | Michael Smith 17 | Michael Gold 18 | 19 | vorbiscomment: 20 | Michael Smith 21 | 22 | and the rest of the Xiph.Org Foundation and its contributors. -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /share/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_CPPFLAGS = -I$(top_srcdir)/include 4 | 5 | noinst_LIBRARIES = libutf8.a libgetopt.a libbase64.a libpicture.a 6 | 7 | libutf8_a_SOURCES = charset.c charset.h iconvert.c utf8.c 8 | 9 | libgetopt_a_SOURCES = getopt.c getopt1.c 10 | 11 | libbase64_a_SOURCES = base64.c 12 | 13 | libpicture_a_SOURCES = picture.c 14 | 15 | EXTRA_DIST = charmaps.h makemap.c charset_test.c charsetmap.h 16 | 17 | debug: 18 | $(MAKE) all CFLAGS="@DEBUG@" 19 | 20 | profile: 21 | $(MAKE) all CFLAGS="@PROFILE@" 22 | -------------------------------------------------------------------------------- /vcut/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | mans = vcut.1 4 | vcutsources = vcut.c vcut.h 5 | 6 | datadir = @datadir@ 7 | localedir = $(datadir)/locale 8 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 9 | 10 | bin_PROGRAMS = vcut 11 | mandir = @MANDIR@ 12 | man_MANS = $(mans) 13 | 14 | AM_CPPFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@ 15 | 16 | vcut_LDADD = @VORBIS_LIBS@ @OGG_LIBS@ @I18N_LIBS@ 17 | 18 | vcut_SOURCES = $(vcutsources) 19 | EXTRA_vcut_SOURCES = $(man_MANS) 20 | 21 | debug: 22 | $(MAKE) all CFLAGS="@DEBUG@" 23 | 24 | profile: 25 | $(MAKE) all CFLAGS="@PROFILE@" 26 | -------------------------------------------------------------------------------- /m4/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = build-to-host.m4 host-cpu-c-abi.m4 intlmacosx.m4 intl.m4 intldir.m4 inttypes-h.m4 lock.m4 visibility.m4 \ 2 | codeset.m4 \ 3 | gettext.m4 \ 4 | glibc21.m4 \ 5 | glibc2.m4 \ 6 | iconv.m4 \ 7 | intdiv0.m4 \ 8 | intmax.m4 \ 9 | inttypes_h.m4 \ 10 | inttypes.m4 \ 11 | inttypes-pri.m4 \ 12 | isc-posix.m4 \ 13 | lcmessage.m4 \ 14 | lib-ld.m4 \ 15 | lib-link.m4 \ 16 | lib-prefix.m4 \ 17 | longdouble.m4 \ 18 | longlong.m4 \ 19 | nls.m4 \ 20 | po.m4 \ 21 | printf-posix.m4 \ 22 | progtest.m4 \ 23 | signed.m4 \ 24 | size_max.m4 \ 25 | stdint_h.m4 \ 26 | uintmax_t.m4 \ 27 | ulonglong.m4 \ 28 | wchar_t.m4 \ 29 | wint_t.m4 \ 30 | xsize.m4 31 | -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | # Sed script that converts quotations, by replacing ASCII quotation marks 2 | # with Unicode quotation marks. 3 | # 4 | # Copyright (C) 2001 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | # This file is offered as-is, without any warranty. 9 | # 10 | # Written by Bruno Haible , 2001. 11 | # 12 | s/"\([^"]*\)"/“\1”/g 13 | s/`\([^`']*\)'/‘\1’/g 14 | s/ '\([^`']*\)' / ‘\1’ /g 15 | s/ '\([^`']*\)'$/ ‘\1’/g 16 | s/^'\([^`']*\)' /‘\1’ /g 17 | s/“”/""/g 18 | -------------------------------------------------------------------------------- /m4/signed.m4: -------------------------------------------------------------------------------- 1 | # signed.m4 serial 1 (gettext-0.10.40) 2 | dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([bh_C_SIGNED], 10 | [ 11 | AC_CACHE_CHECK([for signed], bh_cv_c_signed, 12 | [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) 13 | if test $bh_cv_c_signed = no; then 14 | AC_DEFINE(signed, , 15 | [Define to empty if the C compiler doesn't support this keyword.]) 16 | fi 17 | ]) 18 | -------------------------------------------------------------------------------- /oggenc/lyrics.h: -------------------------------------------------------------------------------- 1 | #ifndef __LYRICS_H 2 | #define __LYRICS_H 3 | 4 | #include 5 | #ifdef HAVE_KATE 6 | #include 7 | #endif 8 | 9 | typedef struct oe_lyrics_item { 10 | char *text; 11 | size_t len; 12 | double t0; 13 | double t1; 14 | #ifdef HAVE_KATE 15 | kate_motion *km; 16 | #endif 17 | } oe_lyrics_item; 18 | 19 | typedef struct oe_lyrics { 20 | size_t count; 21 | oe_lyrics_item *lyrics; 22 | int karaoke; 23 | } oe_lyrics; 24 | 25 | extern oe_lyrics *load_lyrics(const char *filename); 26 | extern void free_lyrics(oe_lyrics *lyrics); 27 | extern const oe_lyrics_item *get_lyrics(const oe_lyrics *lyrics, double t, size_t *idx); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /vcut/vcut.1: -------------------------------------------------------------------------------- 1 | .\" Process this file with 2 | .\" groff -man -Tascii vcut.1 3 | .\" 4 | .TH VCUT 1 "2003 September 1" "Xiph.Org Foundation" "Vorbis Tools" 5 | 6 | .SH NAME 7 | vcut \- cuts Ogg Vorbis files 8 | 9 | .SH SYNOPSIS 10 | .B vcut 11 | .I infile.ogg 12 | .I outfile1.ogg 13 | .I outfile2.ogg 14 | .I [ cutpoint | +cutpoint] 15 | 16 | .SH DESCRIPTION 17 | .B vcut 18 | reads an Ogg Vorbis audio file and splits it at the given cutpoint, which is a 19 | sample number. If the cutpoint is prefixed with '+', the cutpoint is an 20 | integer number of seconds. 21 | 22 | .SH AUTHORS 23 | 24 | .TP 25 | Program Author: 26 | Michael Smith 27 | 28 | .TP 29 | Manpage Author: 30 | Christoper L Cheney 31 | -------------------------------------------------------------------------------- /oggdec/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | mans = oggdec.1 4 | oggdecsources = oggdec.c 5 | 6 | datadir = @datadir@ 7 | localedir = $(datadir)/locale 8 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 9 | 10 | bin_PROGRAMS = oggdec 11 | 12 | AM_CPPFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@ 13 | 14 | oggdec_LDADD = @LIBICONV@ @SHARE_LIBS@ @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @I18N_LIBS@ 15 | oggdec_DEPENDENCIES = @SHARE_LIBS@ 16 | 17 | oggdec_SOURCES = $(oggdecsources) 18 | 19 | man_MANS = $(mans) 20 | mandir = @MANDIR@ 21 | 22 | EXTRA_oggdec_SOURCES = $(man_MANS) 23 | 24 | debug: 25 | $(MAKE) all CFLAGS="@DEBUG@" 26 | 27 | profile: 28 | $(MAKE) all CFLAGS="@PROFILE@" 29 | 30 | 31 | -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | # Sed script that converts quotations, by replacing ASCII quotation marks 2 | # with Unicode quotation marks and highlighting the quotations in bold face. 3 | # 4 | # Copyright (C) 2001 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | # This file is offered as-is, without any warranty. 9 | # 10 | # Written by Bruno Haible , 2001. 11 | # 12 | s/"\([^"]*\)"/“\1”/g 13 | s/`\([^`']*\)'/‘\1’/g 14 | s/ '\([^`']*\)' / ‘\1’ /g 15 | s/ '\([^`']*\)'$/ ‘\1’/g 16 | s/^'\([^`']*\)' /‘\1’ /g 17 | s/“”/""/g 18 | s/“/“/g 19 | s/”/”/g 20 | s/‘/‘/g 21 | s/’/’/g 22 | -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | *.o 4 | .deps 5 | .libs 6 | *~ 7 | .*.swp 8 | vorbis-tools-*.zip 9 | vorbis-tools-*.tar.gz 10 | compile 11 | configure 12 | config.rpath 13 | config.log 14 | config.guess 15 | config.sub 16 | config.status 17 | config.h 18 | config.h.in 19 | depcomp 20 | ltmain.sh 21 | mkinstalldirs 22 | ABOUT-NLS 23 | stamp-h1 24 | autom4te.cache 25 | libtool 26 | missing 27 | aclocal.m4 28 | install-sh 29 | .project 30 | m4/libtool.m4 31 | m4/ltoptions.m4 32 | m4/ltsugar.m4 33 | m4/ltversion.m4 34 | m4/lt~obsolete.m4 35 | ogg123/ogg123 36 | oggdec/oggdec 37 | oggenc/oggenc 38 | ogginfo/ogginfo 39 | po/POTFILES 40 | po/stamp-po 41 | po/*.gmo 42 | share/libgetopt.a 43 | share/libutf8.a 44 | share/libbase64.a 45 | share/libpicture.a 46 | vcut/vcut 47 | vorbiscomment/vorbiscomment 48 | -------------------------------------------------------------------------------- /ogginfo/codec_invalid.c: -------------------------------------------------------------------------------- 1 | /* Ogginfo 2 | * 3 | * A tool to describe ogg file contents and metadata. 4 | * 5 | * This file handles invalid streams. 6 | * 7 | * Copyright 2002-2005 Michael Smith 8 | * Copyright 2020 Philipp Schafft 9 | * Licensed under the GNU GPL, distributed with this program. 10 | */ 11 | 12 | #ifdef HAVE_CONFIG_H 13 | #include 14 | #endif 15 | 16 | #include 17 | 18 | #include "private.h" 19 | 20 | static void process_invalid(stream_processor *stream, ogg_page *page) 21 | { 22 | /* This is for invalid streams. */ 23 | } 24 | 25 | void invalid_start(stream_processor *stream) 26 | { 27 | stream->process_end = NULL; 28 | stream->type = "invalid"; 29 | stream->process_page = process_invalid; 30 | } 31 | -------------------------------------------------------------------------------- /m4/wchar_t.m4: -------------------------------------------------------------------------------- 1 | # wchar_t.m4 serial 1 (gettext-0.12) 2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wchar_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WCHAR_T], 12 | [ 13 | AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, 14 | [AC_TRY_COMPILE([#include 15 | wchar_t foo = (wchar_t)'\0';], , 16 | gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) 17 | if test $gt_cv_c_wchar_t = yes; then 18 | AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /vorbiscomment/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | mans = vorbiscomment.1 4 | vorbiscommentsources = vcedit.c vcedit.h vcomment.c vceditaux.h 5 | 6 | datadir = @datadir@ 7 | localedir = $(datadir)/locale 8 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 9 | 10 | bin_PROGRAMS = vorbiscomment 11 | mandir = @MANDIR@ 12 | man_MANS = $(mans) 13 | 14 | AM_CPPFLAGS = @SHARE_CFLAGS@ @I18N_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ 15 | 16 | vorbiscomment_LDADD = @SHARE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @LIBICONV@ @I18N_LIBS@ 17 | vorbiscomment_DEPENDENCIES = @SHARE_LIBS@ 18 | 19 | vorbiscomment_SOURCES = $(vorbiscommentsources) 20 | 21 | EXTRA_vorbiscomment_SOURCES = $(man_MANS) 22 | 23 | debug: 24 | $(MAKE) all CFLAGS="@DEBUG@" 25 | 26 | profile: 27 | $(MAKE) all CFLAGS="@PROFILE@" 28 | -------------------------------------------------------------------------------- /po/remove-potcdate.sed: -------------------------------------------------------------------------------- 1 | # Sed script that removes the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # Copyright (C) 2002 Free Software Foundation, Inc. 5 | # Copying and distribution of this file, with or without modification, 6 | # are permitted in any medium without royalty provided the copyright 7 | # notice and this notice are preserved. This file is offered as-is, 8 | # without any warranty. 9 | # 10 | # The distinction between the first and the following occurrences of the 11 | # pattern is achieved by looking at the hold space. 12 | /^"POT-Creation-Date: .*"$/{ 13 | x 14 | # Test if the hold space is empty. 15 | s/P/P/ 16 | ta 17 | # Yes it was empty. First occurrence. Remove the line. 18 | g 19 | d 20 | bb 21 | :a 22 | # The hold space was nonempty. Following occurrences. Do nothing. 23 | x 24 | :b 25 | } 26 | -------------------------------------------------------------------------------- /m4/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial 2 (gettext-0.16) 2 | dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([AM_LANGINFO_CODESET], 10 | [ 11 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 12 | [AC_TRY_LINK([#include ], 13 | [char* cs = nl_langinfo(CODESET); return !cs;], 14 | am_cv_langinfo_codeset=yes, 15 | am_cv_langinfo_codeset=no) 16 | ]) 17 | if test $am_cv_langinfo_codeset = yes; then 18 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 19 | [Define if you have and nl_langinfo(CODESET).]) 20 | fi 21 | ]) 22 | -------------------------------------------------------------------------------- /win32/VS2005/copy_libs_here.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | SET VORBIS_DIR=..\..\..\libvorbis\win32\VS2005 3 | SET VORBIS_DEBUG=%VORBIS_DIR%\debug 4 | SET VORBIS_RELEASE=%VORBIS_DIR%\release 5 | 6 | SET OGG_DIR=..\..\..\libogg\win32\VS2005\ 7 | SET OGG_DEBUG=%OGG_DIR%\debug 8 | SET OGG_RELEASE=%OGG_DIR%\release 9 | 10 | SET FLAC_DEBUG=..\..\..\flac\obj\debug\lib 11 | SET FLAC_RELEASE=..\..\..\flac\obj\release\lib 12 | 13 | 14 | COPY %VORBIS_DEBUG%\libvorbis.dll debug\ 15 | COPY %VORBIS_RELEASE%\libvorbis.dll release\ 16 | 17 | COPY %VORBIS_DEBUG%\libvorbisfile.dll debug\ 18 | COPY %VORBIS_RELEASE%\libvorbisfile.dll release\ 19 | 20 | COPY %OGG_DEBUG%\libogg.dll debug\ 21 | COPY %OGG_RELEASE%\libogg.dll release\ 22 | 23 | COPY %FLAC_DEBUG%\libFLAC_dynamic.dll debug\ 24 | COPY %FLAC_RELEASE%\libFLAC_dynamic.dll release\ 25 | 26 | PAUSE 27 | -------------------------------------------------------------------------------- /tests/test-enc-dec: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | export PATH=../oggenc:../oggdec:../ogginfo:../vorbiscomment:../vcut:../ogg123:$PATH 6 | 7 | retval=0 8 | 9 | testfile=1.ogg 10 | 11 | head -c 500000 /dev/zero | ${VALGRIND} oggenc -Q -r -o $testfile - 12 | echo success: oggenc generated $testfile 13 | ${VALGRIND} oggdec -o zeros.raw $testfile 14 | echo success: oggdec decoded $testfile to zeros.raw 15 | ${VALGRIND} vorbiscomment -t name=test -w $testfile 16 | echo success: vorbiscomment added comment to $testfile 17 | ${VALGRIND} ogginfo $testfile 18 | echo success: ogginfo showed metadata of $testfile 19 | 20 | if ${VALGRIND} vorbiscomment -l $testfile | grep -q name=test; then 21 | echo success: found inserted comment in $testfile 22 | else 23 | echo error: did not find inserted comment in $testfile 24 | retval=1 25 | fi 26 | 27 | exit $retval 28 | -------------------------------------------------------------------------------- /m4/glibc2.m4: -------------------------------------------------------------------------------- 1 | # glibc2.m4 serial 1 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.0 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gt_GLIBC2], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, 13 | ac_cv_gnu_library_2, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ >= 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2=yes, 24 | ac_cv_gnu_library_2=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC2) 28 | GLIBC2="$ac_cv_gnu_library_2" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /win32/VS2013/copy_libs_here.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | MKDIR Release\ Debug\ 4 | 5 | SET VORBIS_DIR=..\..\..\vorbis\win32\VS2010 6 | SET VORBIS_DEBUG=%VORBIS_DIR%\Win32\Debug 7 | SET VORBIS_RELEASE=%VORBIS_DIR%\Win32\Release 8 | 9 | SET OGG_DIR=..\..\..\ogg\win32\VS2015 10 | SET OGG_DEBUG=%OGG_DIR%\Win32\Debug 11 | SET OGG_RELEASE=%OGG_DIR%\Win32\Release 12 | 13 | SET FLAC_DEBUG=..\..\..\flac\objs\debug\lib 14 | SET FLAC_RELEASE=..\..\..\flac\objs\release\lib 15 | 16 | 17 | COPY /Y %VORBIS_DEBUG%\libvorbis.dll Debug\ 18 | COPY /Y %VORBIS_RELEASE%\libvorbis.dll Release\ 19 | 20 | COPY /Y %VORBIS_DEBUG%\libvorbisfile.dll Debug\ 21 | COPY /Y %VORBIS_RELEASE%\libvorbisfile.dll Release\ 22 | 23 | COPY /Y %OGG_DEBUG%\libogg.dll Debug\ 24 | COPY /Y %OGG_RELEASE%\libogg.dll Release\ 25 | 26 | COPY /Y %FLAC_DEBUG%\libFLAC_dynamic.dll Debug\ 27 | COPY /Y %FLAC_RELEASE%\libFLAC_dynamic.dll Release\ 28 | 29 | PAUSE 30 | -------------------------------------------------------------------------------- /m4/inttypes.m4: -------------------------------------------------------------------------------- 1 | # inttypes.m4 serial 1 (gettext-0.11.4) 2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H if exists and doesn't clash with 10 | # . 11 | 12 | AC_DEFUN([gt_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, 15 | [ 16 | AC_TRY_COMPILE( 17 | [#include 18 | #include ], 19 | [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) 20 | ]) 21 | if test $gt_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, 23 | [Define if exists and doesn't clash with .]) 24 | fi 25 | ]) 26 | -------------------------------------------------------------------------------- /m4/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 3 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.1 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gl_GLIBC21], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 13 | ac_cv_gnu_library_2_1, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2_1=yes, 24 | ac_cv_gnu_library_2_1=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC21) 28 | GLIBC21="$ac_cv_gnu_library_2_1" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /m4/inttypes-h.m4: -------------------------------------------------------------------------------- 1 | # inttypes-h.m4 serial 1 (gettext-0.15) 2 | dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H if exists and doesn't clash with 10 | # . 11 | 12 | AC_DEFUN([gl_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, 15 | [ 16 | AC_TRY_COMPILE( 17 | [#include 18 | #include ], 19 | [], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no) 20 | ]) 21 | if test $gl_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, 23 | [Define if exists and doesn't clash with .]) 24 | fi 25 | ]) 26 | -------------------------------------------------------------------------------- /oggenc/platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __PLATFORM_H 2 | #define __PLATFORM_H 3 | 4 | #include 5 | 6 | #ifdef HAVE_ALLOCA_H 7 | #include 8 | #endif 9 | 10 | #ifdef __OS2__ 11 | #define INCL_DOS 12 | #define INCL_NOPMAPI 13 | #include 14 | #endif 15 | 16 | #if defined(_WIN32) || defined(__OS2__) 17 | #include 18 | 19 | void setbinmode(FILE *); 20 | 21 | #define DEFAULT_NAMEFMT_REMOVE "/\\:<>|" 22 | #define DEFAULT_NAMEFMT_REPLACE "" 23 | 24 | #else /* Unix, mostly */ 25 | 26 | #define setbinmode(x) {} 27 | #define DEFAULT_NAMEFMT_REMOVE "/" 28 | #define DEFAULT_NAMEFMT_REPLACE "" 29 | 30 | #endif 31 | 32 | #ifdef _WIN32 33 | 34 | extern FILE *oggenc_fopen(char *fn, char *mode, int isutf8); 35 | extern void get_args_from_ucs16(int *argc, char ***argv); 36 | 37 | #else 38 | 39 | #define oggenc_fopen(x,y,z) fopen(x,y) 40 | #define get_args_from_ucs16(x,y) { } 41 | 42 | #endif 43 | 44 | #endif /* __PLATFORM_H */ 45 | -------------------------------------------------------------------------------- /m4/intldir.m4: -------------------------------------------------------------------------------- 1 | # intldir.m4 serial 1 (gettext-0.16) 2 | dnl Copyright (C) 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | AC_PREREQ(2.52) 17 | 18 | dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. 19 | AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) 20 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # files to translate 2 | 3 | 4 | # ogg123 5 | 6 | ogg123/audio.c 7 | ogg123/buffer.c 8 | ogg123/callbacks.c 9 | ogg123/cfgfile_options.c 10 | ogg123/cmdline_options.c 11 | ogg123/file_transport.c 12 | ogg123/format.c 13 | ogg123/http_transport.c 14 | ogg123/ogg123.c 15 | ogg123/oggvorbis_format.c 16 | ogg123/playlist.c 17 | ogg123/speex_format.c 18 | ogg123/status.c 19 | ogg123/transport.c 20 | ogg123/vorbis_comments.c 21 | 22 | # oggdec 23 | 24 | oggdec/oggdec.c 25 | 26 | 27 | # oggenc 28 | 29 | oggenc/audio.c 30 | oggenc/encode.c 31 | oggenc/lyrics.c 32 | oggenc/oggenc.c 33 | oggenc/platform.c 34 | oggenc/resample.c 35 | 36 | # ogginfo 37 | 38 | ogginfo/ogginfo2.c 39 | 40 | 41 | # shared 42 | 43 | share/charset.c 44 | share/charset_test.c 45 | share/getopt.c 46 | share/getopt1.c 47 | share/iconvert.c 48 | share/makemap.c 49 | share/utf8.c 50 | 51 | 52 | #vcut 53 | 54 | vcut/vcut.c 55 | 56 | 57 | # vorbiscomment 58 | 59 | vorbiscomment/vcedit.c 60 | vorbiscomment/vcomment.c 61 | -------------------------------------------------------------------------------- /m4/stdint_h.m4: -------------------------------------------------------------------------------- 1 | # stdint_h.m4 serial 6 2 | dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_STDINT_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_STDINT_H], 13 | [ 14 | AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | gl_cv_header_stdint_h=yes, 20 | gl_cv_header_stdint_h=no)]) 21 | if test $gl_cv_header_stdint_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /m4/inttypes_h.m4: -------------------------------------------------------------------------------- 1 | # inttypes_h.m4 serial 7 2 | dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | gl_cv_header_inttypes_h=yes, 20 | gl_cv_header_inttypes_h=no)]) 21 | if test $gl_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /m4/isc-posix.m4: -------------------------------------------------------------------------------- 1 | # isc-posix.m4 serial 2 (gettext-0.11.2) 2 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. 8 | 9 | # This test replaces the one in autoconf. 10 | # Currently this macro should have the same name as the autoconf macro 11 | # because gettext's gettext.m4 (distributed in the automake package) 12 | # still uses it. Otherwise, the use in gettext.m4 makes autoheader 13 | # give these diagnostics: 14 | # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX 15 | # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX 16 | 17 | undefine([AC_ISC_POSIX]) 18 | 19 | AC_DEFUN([AC_ISC_POSIX], 20 | [ 21 | dnl This test replaces the obsolescent AC_ISC_POSIX kludge. 22 | AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) 23 | ] 24 | ) 25 | -------------------------------------------------------------------------------- /oggenc/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | if HAVE_LIBFLAC 3 | flac_sources = flac.c flac.h easyflac.c easyflac.h 4 | else 5 | flac_sources = 6 | endif 7 | 8 | if HAVE_KATE 9 | kate_sources = lyrics.c lyrics.h 10 | else 11 | kate_sources = 12 | endif 13 | 14 | SUBDIRS = man 15 | 16 | datadir = @datadir@ 17 | localedir = $(datadir)/locale 18 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 19 | 20 | bin_PROGRAMS = oggenc 21 | 22 | AM_CPPFLAGS = @SHARE_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @KATE_CFLAGS@ @I18N_CFLAGS@ 23 | 24 | oggenc_LDADD = @SHARE_LIBS@ \ 25 | @VORBISENC_LIBS@ @VORBIS_LIBS@ @KATE_LIBS@ @OGG_LIBS@ \ 26 | @LIBICONV@ @I18N_LIBS@ @FLAC_LIBS@ -lm 27 | 28 | oggenc_DEPENDENCIES = @SHARE_LIBS@ 29 | 30 | oggenc_SOURCES = $(flac_sources) $(kate_sources) \ 31 | oggenc.c audio.c encode.c platform.c resample.c skeleton.c \ 32 | audio.h encode.h platform.h resample.h skeleton.h 33 | 34 | 35 | debug: 36 | $(MAKE) all CFLAGS="@DEBUG@" 37 | 38 | profile: 39 | $(MAKE) all CFLAGS="@PROFILE@" 40 | -------------------------------------------------------------------------------- /m4/wint_t.m4: -------------------------------------------------------------------------------- 1 | # wint_t.m4 serial 2 (gettext-0.17) 2 | dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wint_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WINT_T], 12 | [ 13 | AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, 14 | [AC_TRY_COMPILE([ 15 | /* Tru64 with Desktop Toolkit C has a bug: must be included before 16 | . 17 | BSD/OS 4.0.1 has a bug: , and must be included 18 | before . */ 19 | #include 20 | #include 21 | #include 22 | #include 23 | wint_t foo = (wchar_t)'\0';], , 24 | gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) 25 | if test $gt_cv_c_wint_t = yes; then 26 | AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /ogginfo/codec_other.c: -------------------------------------------------------------------------------- 1 | /* Ogginfo 2 | * 3 | * A tool to describe ogg file contents and metadata. 4 | * 5 | * This file handles codecs we have no specific handling for. 6 | * 7 | * Copyright 2002-2005 Michael Smith 8 | * Copyright 2020 Philipp Schafft 9 | * Licensed under the GNU GPL, distributed with this program. 10 | */ 11 | 12 | #ifdef HAVE_CONFIG_H 13 | #include 14 | #endif 15 | 16 | #include 17 | 18 | #include "private.h" 19 | 20 | static void process_other(stream_processor *stream, ogg_page *page) 21 | { 22 | ogg_packet packet; 23 | 24 | ogg_stream_pagein(&stream->os, page); 25 | 26 | while (ogg_stream_packetout(&stream->os, &packet) > 0) { 27 | /* Should we do anything here? Currently, we don't */ 28 | } 29 | } 30 | 31 | void other_start(stream_processor *stream, const char *type) 32 | { 33 | if (type) { 34 | stream->type = type; 35 | } else { 36 | stream->type = "unknown"; 37 | } 38 | stream->process_page = process_other; 39 | stream->process_end = NULL; 40 | } 41 | -------------------------------------------------------------------------------- /po/insert-header.sed: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # Copyright (C) 2001 Free Software Foundation, Inc. 4 | # This file is free software; the Free Software Foundation 5 | # gives unlimited permission to copy and/or distribute it, 6 | # with or without modifications, as long as this notice is preserved. 7 | # This file is offered as-is, without any warranty. 8 | # 9 | # Written by Bruno Haible , 2001. 10 | # 11 | # At each occurrence of a line starting with "msgid ", we execute the following 12 | # commands. At the first occurrence, insert the file. At the following 13 | # occurrences, do nothing. The distinction between the first and the following 14 | # occurrences is achieved by looking at the hold space. 15 | /^msgid /{ 16 | x 17 | # Test if the hold space is empty. 18 | s/m/m/ 19 | ta 20 | # Yes it was empty. First occurrence. Read the file. 21 | r HEADER 22 | # Output the file's contents by reading the next line. But don't lose the 23 | # current line while doing this. 24 | g 25 | N 26 | bb 27 | :a 28 | # The hold space was nonempty. Following occurrences. Do nothing. 29 | x 30 | :b 31 | } 32 | -------------------------------------------------------------------------------- /include/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 Philipp Schafft 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef __BASE64_H__ 20 | #define __BASE64_H__ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #include 27 | 28 | // returns 0 on success. 29 | int base64_decode(const char *in, void **out, size_t *len); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /m4/intmax.m4: -------------------------------------------------------------------------------- 1 | # intmax.m4 serial 3 (gettext-0.16) 2 | dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the system has the 'intmax_t' type, but don't attempt to 9 | dnl find a replacement if it is lacking. 10 | 11 | AC_DEFUN([gt_TYPE_INTMAX_T], 12 | [ 13 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 14 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 15 | AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, 16 | [AC_TRY_COMPILE([ 17 | #include 18 | #include 19 | #if HAVE_STDINT_H_WITH_UINTMAX 20 | #include 21 | #endif 22 | #if HAVE_INTTYPES_H_WITH_UINTMAX 23 | #include 24 | #endif 25 | ], [intmax_t x = -1; 26 | return !x;], 27 | gt_cv_c_intmax_t=yes, 28 | gt_cv_c_intmax_t=no)]) 29 | if test $gt_cv_c_intmax_t = yes; then 30 | AC_DEFINE(HAVE_INTMAX_T, 1, 31 | [Define if you have the 'intmax_t' type in or .]) 32 | fi 33 | ]) 34 | -------------------------------------------------------------------------------- /include/utf8.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Convert a string between UTF-8 and the locale's charset. 4 | * Invalid bytes are replaced by '#', and characters that are 5 | * not available in the target encoding are replaced by '?'. 6 | * 7 | * If the locale's charset is not set explicitly then it is 8 | * obtained using nl_langinfo(CODESET), where available, the 9 | * environment variable CHARSET, or assumed to be US-ASCII. 10 | * 11 | * Return value of conversion functions: 12 | * 13 | * -1 : memory allocation failed 14 | * 0 : data was converted exactly 15 | * 1 : valid data was converted approximately (using '?') 16 | * 2 : input was invalid (but still converted, using '#') 17 | * 3 : unknown encoding (but still converted, using '?') 18 | */ 19 | 20 | #ifndef __UTF8_H 21 | #define __UTF8_H 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | void convert_set_charset(const char *charset); 28 | void convert_free_charset(void); 29 | 30 | int utf8_encode(const char *from, char **to); 31 | int utf8_decode(const char *from, char **to); 32 | int utf8_validate(const char *from); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif /* __UTF8_H */ 39 | -------------------------------------------------------------------------------- /ogg123/remote.h: -------------------------------------------------------------------------------- 1 | /* remote.h by Richard van Paasen */ 2 | 3 | /******************************************************************** 4 | * * 5 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 6 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 7 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 8 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 9 | * * 10 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2010 * 11 | * by Kenneth C. Arnold AND OTHER CONTRIBUTORS * 12 | * http://www.xiph.org/ * 13 | * * 14 | ******************************************************************** 15 | 16 | last mod: $Id$ 17 | 18 | ********************************************************************/ 19 | 20 | void remote_mainloop(void); 21 | int remote_playloop(void); 22 | void remote_time(double current, double total); 23 | -------------------------------------------------------------------------------- /win32/VS2013/vcut/vcut.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /ogginfo/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | mans = ogginfo.1 4 | ogginfosources = \ 5 | ogginfo2.c \ 6 | metadata.c \ 7 | theora.c \ 8 | codec_vorbis.c \ 9 | codec_theora.c \ 10 | codec_kate.c \ 11 | codec_opus.c \ 12 | codec_speex.c \ 13 | codec_flac.c \ 14 | codec_skeleton.c \ 15 | codec_other.c \ 16 | codec_invalid.c 17 | 18 | noinst_HEADERS = \ 19 | private.h \ 20 | theora.h 21 | 22 | datadir = @datadir@ 23 | localedir = $(datadir)/locale 24 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 25 | 26 | bin_PROGRAMS = ogginfo 27 | mandir = @MANDIR@ 28 | man_MANS = $(mans) 29 | 30 | AM_CPPFLAGS = @SHARE_CFLAGS@ @OGG_CFLAGS@ @VORBIS_CFLAGS@ @KATE_CFLAGS@ @I18N_CFLAGS@ 31 | 32 | ogginfo_LDADD = @SHARE_LIBS@ @VORBIS_LIBS@ @KATE_LIBS@ @OGG_LIBS@ @LIBICONV@ @I18N_LIBS@ \ 33 | $(top_builddir)/share/libpicture.a $(top_builddir)/share/libbase64.a 34 | ogginfo_DEPENDENCIES = @SHARE_LIBS@ \ 35 | $(top_builddir)/share/libpicture.a $(top_builddir)/share/libbase64.a 36 | 37 | ogginfo_SOURCES = $(ogginfosources) 38 | EXTRA_ogginfo_SOURCES = $(man_MANS) 39 | 40 | debug: 41 | $(MAKE) all CFLAGS="@DEBUG@" 42 | 43 | profile: 44 | $(MAKE) all CFLAGS="@PROFILE@" 45 | -------------------------------------------------------------------------------- /m4/uintmax_t.m4: -------------------------------------------------------------------------------- 1 | # uintmax_t.m4 serial 10 2 | dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | AC_PREREQ(2.13) 10 | 11 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' 12 | # if it is not already defined in or . 13 | 14 | AC_DEFUN([gl_AC_TYPE_UINTMAX_T], 15 | [ 16 | AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) 17 | AC_REQUIRE([gl_AC_HEADER_STDINT_H]) 18 | if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then 19 | AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) 20 | test $ac_cv_type_unsigned_long_long_int = yes \ 21 | && ac_type='unsigned long long' \ 22 | || ac_type='unsigned long' 23 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, 24 | [Define to unsigned long or unsigned long long 25 | if and don't define.]) 26 | else 27 | AC_DEFINE(HAVE_UINTMAX_T, 1, 28 | [Define if you have the 'uintmax_t' type in or .]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /ogg123/vorbis_comments.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2003 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | 19 | #ifndef __VORBIS_COMMENTS_H__ 20 | #define __VORBIS_COMMENTS_H__ 21 | 22 | #include "format.h" 23 | 24 | 25 | void print_vorbis_comment (const char *comment, decoder_callbacks_t *cb, 26 | void *callback_arg); 27 | 28 | #endif /* __VORBIS_COMMENTS_H__ */ 29 | -------------------------------------------------------------------------------- /m4/inttypes-pri.m4: -------------------------------------------------------------------------------- 1 | # inttypes-pri.m4 serial 4 (gettext-0.16) 2 | dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_PREREQ(2.52) 10 | 11 | # Define PRI_MACROS_BROKEN if exists and defines the PRI* 12 | # macros to non-string values. This is the case on AIX 4.3.3. 13 | 14 | AC_DEFUN([gt_INTTYPES_PRI], 15 | [ 16 | AC_CHECK_HEADERS([inttypes.h]) 17 | if test $ac_cv_header_inttypes_h = yes; then 18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], 19 | gt_cv_inttypes_pri_broken, 20 | [ 21 | AC_TRY_COMPILE([#include 22 | #ifdef PRId32 23 | char *p = PRId32; 24 | #endif 25 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) 26 | ]) 27 | fi 28 | if test "$gt_cv_inttypes_pri_broken" = yes; then 29 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, 30 | [Define if exists and defines unusable PRI* macros.]) 31 | PRI_MACROS_BROKEN=1 32 | else 33 | PRI_MACROS_BROKEN=0 34 | fi 35 | AC_SUBST([PRI_MACROS_BROKEN]) 36 | ]) 37 | -------------------------------------------------------------------------------- /win32/VS2013/oggdec/oggdec.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | -------------------------------------------------------------------------------- /m4/longdouble.m4: -------------------------------------------------------------------------------- 1 | # longdouble.m4 serial 2 (gettext-0.15) 2 | dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the compiler supports the 'long double' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf 12 | dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics. 13 | 14 | AC_DEFUN([gt_TYPE_LONGDOUBLE], 15 | [ 16 | AC_CACHE_CHECK([for long double], gt_cv_c_long_double, 17 | [if test "$GCC" = yes; then 18 | gt_cv_c_long_double=yes 19 | else 20 | AC_TRY_COMPILE([ 21 | /* The Stardent Vistra knows sizeof(long double), but does not support it. */ 22 | long double foo = 0.0; 23 | /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ 24 | int array [2*(sizeof(long double) >= sizeof(double)) - 1]; 25 | ], , 26 | gt_cv_c_long_double=yes, gt_cv_c_long_double=no) 27 | fi]) 28 | if test $gt_cv_c_long_double = yes; then 29 | AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) 30 | fi 31 | ]) 32 | -------------------------------------------------------------------------------- /m4/nls.m4: -------------------------------------------------------------------------------- 1 | # nls.m4 2 | # serial 6 (gettext-0.20.2) 3 | dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2024 Free 4 | dnl Software Foundation, Inc. 5 | dnl This file is free software; the Free Software Foundation 6 | dnl gives unlimited permission to copy and/or distribute it, 7 | dnl with or without modifications, as long as this notice is preserved. 8 | dnl 9 | dnl This file can be used in projects which are not available under 10 | dnl the GNU General Public License or the GNU Lesser General Public 11 | dnl License but which still want to provide support for the GNU gettext 12 | dnl functionality. 13 | dnl Please note that the actual code of the GNU gettext library is covered 14 | dnl by the GNU Lesser General Public License, and the rest of the GNU 15 | dnl gettext package is covered by the GNU General Public License. 16 | dnl They are *not* in the public domain. 17 | 18 | dnl Authors: 19 | dnl Ulrich Drepper , 1995-2000. 20 | dnl Bruno Haible , 2000-2003. 21 | 22 | AC_PREREQ([2.50]) 23 | 24 | AC_DEFUN([AM_NLS], 25 | [ 26 | AC_MSG_CHECKING([whether NLS is requested]) 27 | dnl Default is enabled NLS 28 | AC_ARG_ENABLE([nls], 29 | [ --disable-nls do not use Native Language Support], 30 | USE_NLS=$enableval, USE_NLS=yes) 31 | AC_MSG_RESULT([$USE_NLS]) 32 | AC_SUBST([USE_NLS]) 33 | ]) 34 | -------------------------------------------------------------------------------- /ogg123/cmdline_options.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __CMDLINE_OPTIONS_H__ 19 | #define __CMDLINE_OPTIONS_H__ 20 | 21 | #include "ogg123.h" 22 | #include "cfgfile_options.h" 23 | #include "audio.h" 24 | 25 | int parse_cmdline_options (int argc, char **argv, 26 | ogg123_options_t *ogg123_opts, 27 | file_option_t *file_opts); 28 | void cmdline_usage (void); 29 | 30 | 31 | #endif /* __CMDLINE_OPTIONS_H__ */ 32 | -------------------------------------------------------------------------------- /m4/lcmessage.m4: -------------------------------------------------------------------------------- 1 | # lcmessage.m4 serial 4 (gettext-0.14.2) 2 | dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Authors: 17 | dnl Ulrich Drepper , 1995. 18 | 19 | # Check whether LC_MESSAGES is available in . 20 | 21 | AC_DEFUN([gt_LC_MESSAGES], 22 | [ 23 | AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, 24 | [AC_TRY_LINK([#include ], [return LC_MESSAGES], 25 | gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) 26 | if test $gt_cv_val_LC_MESSAGES = yes; then 27 | AC_DEFINE(HAVE_LC_MESSAGES, 1, 28 | [Define if your file defines LC_MESSAGES.]) 29 | fi 30 | ]) 31 | -------------------------------------------------------------------------------- /oggenc/flac.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __FLAC_H 3 | #define __FLAC_H 4 | 5 | #include "encode.h" 6 | #include "audio.h" 7 | #include 8 | #include 9 | #if !defined(FLAC_API_VERSION_CURRENT) || (FLAC_API_VERSION_CURRENT < 8) 10 | #define NEED_EASYFLAC 1 11 | #endif 12 | #if NEED_EASYFLAC 13 | #include 14 | #include "easyflac.h" 15 | #endif 16 | 17 | typedef struct { 18 | #if NEED_EASYFLAC 19 | EasyFLAC__StreamDecoder *decoder; 20 | #else 21 | FLAC__StreamDecoder *decoder; 22 | #endif 23 | short channels; 24 | int rate; 25 | long totalsamples; /* per channel, of course */ 26 | 27 | FLAC__StreamMetadata *comments; 28 | 29 | FILE *in; /* Cache the FILE pointer so the FLAC read callback can use it */ 30 | int eos; /* End of stream read */ 31 | 32 | 33 | /* Buffer for decoded audio */ 34 | float **buf; /* channels by buf_len array */ 35 | int buf_len; 36 | int buf_start; /* Offset to start of audio data */ 37 | int buf_fill; /* Number of bytes of audio data in buffer */ 38 | 39 | /* Buffer for input data we already read in the id phase */ 40 | unsigned char *oldbuf; 41 | int oldbuf_len; 42 | int oldbuf_start; 43 | } flacfile; 44 | 45 | 46 | int flac_id(unsigned char *buf, int len); 47 | int oggflac_id(unsigned char *buf, int len); 48 | int flac_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen); 49 | void flac_close(void *); 50 | 51 | long flac_read(void *, float **buffer, int samples); 52 | 53 | #endif /* __FLAC_H */ 54 | 55 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | default: 2 | tags: 3 | - docker 4 | # Image from https://hub.docker.com/_/gcc/ based on Debian 5 | image: gcc 6 | 7 | .autotools: 8 | stage: build 9 | before_script: 10 | - apt-get update && 11 | apt-get install -y libogg-dev libvorbis-dev 12 | libao-dev libflac-dev libspeex-dev libkate-dev liboggkate-dev 13 | gettext zip ${INSTALL_COMPILER} ${INSTALL_EXTRA} 14 | script: 15 | - ./autogen.sh 16 | - ./configure ${CONFIG_FLAGS} || cat config.log 17 | - make 18 | - make check 19 | variables: 20 | INSTALL_COMPILER: gcc 21 | 22 | autotools-gcc: 23 | extends: .autotools 24 | script: 25 | - ./autogen.sh 26 | - ./configure ${CONFIG_FLAGS} || cat config.log 27 | - make 28 | - make distcheck 29 | artifacts: 30 | paths: 31 | - vorbis-tools-*.tar.gz 32 | - vorbis-tools-*.zip 33 | expire_in: 2 week 34 | 35 | autotools-gcc-builddir: 36 | extends: .autotools 37 | script: 38 | - ./autogen.sh 39 | - mkdir build 40 | - (cd build && ../configure ${CONFIG_FLAGS}) || cat config.log 41 | - (cd build && make) 42 | - (cd build && make check) 43 | 44 | autotools-clang: 45 | extends: .autotools 46 | script: 47 | - ./autogen.sh 48 | - ./configure ${CONFIG_FLAGS} || cat config.log 49 | - make 50 | - make distcheck 51 | variables: 52 | INSTALL_COMPILER: clang 53 | CC: clang 54 | 55 | autotools-enable-gcc-sanitizers: 56 | extends: .autotools 57 | variables: 58 | INSTALL_EXTRA: libtool 59 | CONFIG_FLAGS: --enable-gcc-sanitizers 60 | -------------------------------------------------------------------------------- /ogg123/compat.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __COMPAT_H__ 19 | #define __COMPAT_H__ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | #ifdef __sun 26 | #include 27 | #endif 28 | 29 | /* SunOS 4 does on_exit() and everything else does atexit() */ 30 | #ifdef HAVE_ATEXIT 31 | #define ATEXIT(x) (atexit(x)) 32 | #else 33 | #ifdef HAVE_ON_EXIT 34 | #define ATEXIT(x) (on_exit( (void (*)(int, void*))(x) , NULL) 35 | #else 36 | #define ATEXIT(x) 37 | #warning "Neither atexit() nor on_exit() is present. Bad things may happen when the application terminates." 38 | #endif 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /m4/printf-posix.m4: -------------------------------------------------------------------------------- 1 | # printf-posix.m4 serial 3 (gettext-0.17) 2 | dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether the printf() function supports POSIX/XSI format strings with 9 | dnl positions. 10 | 11 | AC_DEFUN([gt_PRINTF_POSIX], 12 | [ 13 | AC_REQUIRE([AC_PROG_CC]) 14 | AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], 15 | gt_cv_func_printf_posix, 16 | [ 17 | AC_TRY_RUN([ 18 | #include 19 | #include 20 | /* The string "%2$d %1$d", with dollar characters protected from the shell's 21 | dollar expansion (possibly an autoconf bug). */ 22 | static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; 23 | static char buf[100]; 24 | int main () 25 | { 26 | sprintf (buf, format, 33, 55); 27 | return (strcmp (buf, "55 33") != 0); 28 | }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, 29 | [ 30 | AC_EGREP_CPP(notposix, [ 31 | #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ 32 | notposix 33 | #endif 34 | ], gt_cv_func_printf_posix="guessing no", 35 | gt_cv_func_printf_posix="guessing yes") 36 | ]) 37 | ]) 38 | case $gt_cv_func_printf_posix in 39 | *yes) 40 | AC_DEFINE(HAVE_POSIX_PRINTF, 1, 41 | [Define if your printf() function supports format strings with positions.]) 42 | ;; 43 | esac 44 | ]) 45 | -------------------------------------------------------------------------------- /win32/VS2013/ogginfo/ogginfo.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | -------------------------------------------------------------------------------- /win32/VS2013/vorbiscomment/vorbiscomment.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | %% A header that gets inserted into message catalogs named en@quot.po. 2 | %% 3 | %% Copyright (C) 2001 Free Software Foundation, Inc. 4 | %% This file is free software; the Free Software Foundation 5 | %% gives unlimited permission to copy and/or distribute it, 6 | %% with or without modifications, as long as this notice is preserved. 7 | %% This file is offered as-is, without any warranty. 8 | %% 9 | %% Written by Bruno Haible , 2001. 10 | %% 11 | # All this catalog "translates" are quotation characters. 12 | # The msgids must be ASCII and therefore cannot contain real quotation 13 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 14 | # and double quote (0x22). These substitutes look strange; see 15 | # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 16 | # 17 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 18 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 19 | # It also translates pairs of apostrophe (0x27) to 20 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 21 | # and pairs of quotation mark (0x22) to 22 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 23 | # 24 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 25 | # When output to an ISO-8859-1 terminal, the single quotation marks are 26 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 27 | # grave/acute accent (by libiconv), and the double quotation marks are 28 | # transliterated to 0x22. 29 | # When output to an ASCII terminal, the single quotation marks are 30 | # transliterated to apostrophes, and the double quotation marks are 31 | # transliterated to 0x22. 32 | # 33 | -------------------------------------------------------------------------------- /ogginfo/ogginfo.1: -------------------------------------------------------------------------------- 1 | .\" Process this file with 2 | .\" groff -man -Tascii ogginfo.1 3 | .\" 4 | .TH ogginfo 1 "July 10, 2002" "Xiph.Org Foundation" "Vorbis Tools" 5 | 6 | .SH NAME 7 | ogginfo \- gives information about Ogg files, and does extensive validity checking 8 | 9 | .SH SYNOPSIS 10 | .B ogginfo 11 | [ 12 | .B -q 13 | ] [ 14 | .B -v 15 | ] [ 16 | .B -h 17 | ] 18 | .I file1.ogg 19 | .B ... 20 | .I fileN.ogg 21 | 22 | .SH DESCRIPTION 23 | .B ogginfo 24 | reads one or more Ogg files and prints information about stream contents 25 | (including chained and/or multiplexed streams) to standard output. It will 26 | detect (but not correct) a wide range of common defects, with many 27 | additional checks specifically for Ogg Vorbis streams. 28 | 29 | For all stream types 30 | .B ogginfo 31 | will print the filename being processed, the stream serial numbers, and various 32 | common error conditions. 33 | 34 | For 35 | .B Vorbis 36 | streams, information including the version used for encoding, the sample rate 37 | and number of channels, the bitrate and playback length, and the contents of 38 | the comment header are printed. 39 | 40 | Similarly, for 41 | .B Theora 42 | streams, basic information about the video is provided, including frame rate, aspect ratio, bitrate, length, and the comment header. 43 | 44 | .SH OPTIONS 45 | .IP -h 46 | Show a help and usage message. 47 | .IP -q 48 | Quiet mode. This may be specified multiple times. Doing so once will remove 49 | the detailed informative messages, twice will remove warnings as well. 50 | .IP -v 51 | Verbose mode. At the current time, this does not do anything. 52 | 53 | .SH AUTHORS 54 | .br 55 | Michael Smith 56 | 57 | .SH "SEE ALSO" 58 | 59 | .PP 60 | \fBvorbiscomment\fR(1), \fBogg123\fR(1), \fBoggdec\fR(1), \fBoggenc\fR(1) 61 | -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | %% A header that gets inserted into message catalogs named en@boldquot.po. 2 | %% 3 | %% Copyright (C) 2001 Free Software Foundation, Inc. 4 | %% This file is free software; the Free Software Foundation 5 | %% gives unlimited permission to copy and/or distribute it, 6 | %% with or without modifications, as long as this notice is preserved. 7 | %% This file is offered as-is, without any warranty. 8 | %% 9 | %% Written by Bruno Haible , 2001. 10 | %% 11 | # All this catalog "translates" are quotation characters. 12 | # The msgids must be ASCII and therefore cannot contain real quotation 13 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 14 | # and double quote (0x22). These substitutes look strange; see 15 | # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 16 | # 17 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 18 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 19 | # It also translates pairs of apostrophe (0x27) to 20 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 21 | # and pairs of quotation mark (0x22) to 22 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 23 | # 24 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 25 | # When output to an ISO-8859-1 terminal, the single quotation marks are 26 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 27 | # grave/acute accent (by libiconv), and the double quotation marks are 28 | # transliterated to 0x22. 29 | # When output to an ASCII terminal, the single quotation marks are 30 | # transliterated to apostrophes, and the double quotation marks are 31 | # transliterated to 0x22. 32 | # 33 | # This catalog furthermore displays the text between the quotation marks in 34 | # bold face, assuming the VT100/XTerm escape sequences. 35 | # 36 | -------------------------------------------------------------------------------- /HACKING: -------------------------------------------------------------------------------- 1 | Note that these instructions are *not* necessary for distribution 2 | tarballs; they have separate configure/build instructions. 3 | 4 | Building this package from Subversion is mainly intended for developers. 5 | General users should obtain official distribution packages; both source 6 | and binary distributions are available at 7 | http://www.vorbis.com/. 8 | 9 | ----- 10 | 11 | These are *brief* instructions on how to build this package from Subversion. 12 | Yes, there are details left out. 13 | 14 | There are generally four steps necessary when building from Subversion (i.e., 15 | a developer's copy): 16 | 17 | 1. svn checkout of the sources, or svn update. General subversion usage 18 | documentation is at http://svnbook.red-bean.com/. Information on the 19 | Xiph.Org Subversion repository can be found at http://xiph.org/svn/ 20 | 21 | 2. [re-]generate files such as "configure" and "Makefile.in" with the 22 | GNU autoconf/automake tools. Run the "autogen.sh" script to 23 | perform this step. 24 | 25 | *** IF YOU ARE NOT BUILDING WITH GNU MAKE *AND* GCC: you must set 26 | the AUTOMAKE_FLAGS environment variable to "--include-deps" 27 | before running autogen.sh. For example: 28 | 29 | csh% setenv AUTOMAKE_FLAGS --include-deps 30 | csh% ./autogen.sh 31 | or 32 | sh% AUTOMAKE_FLAGS=--include-deps ./autogen.sh 33 | 34 | 3. Run configure. There are several options available; see 35 | "./configure --help" for more information. 36 | 37 | 4. Run "make" to build the source. 38 | 39 | In general, steps 2 and 3 need to be re-run every time any of the 40 | following files are modified (either manually or by a cvs update): 41 | 42 | configure.in 43 | acinclude.m4 44 | 45 | Running "make clean" after running steps 2 and 3 is generally also 46 | advisable before running step 4. It isn't *always* necessary, but 47 | unless you understand the workings of autoconf/automake, it's safest 48 | to just do it. 49 | -------------------------------------------------------------------------------- /win32/tools.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="tools" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Generic Project" 0x010a 6 | 7 | CFG=tools - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "tools.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "tools.mak" CFG="tools - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "tools - Win32 Release" (based on "Win32 (x86) Generic Project") 21 | !MESSAGE "tools - Win32 Debug" (based on "Win32 (x86) Generic Project") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | MTL=midl.exe 29 | 30 | !IF "$(CFG)" == "tools - Win32 Release" 31 | 32 | # PROP BASE Use_MFC 0 33 | # PROP BASE Use_Debug_Libraries 0 34 | # PROP BASE Output_Dir "Release" 35 | # PROP BASE Intermediate_Dir "Release" 36 | # PROP BASE Target_Dir "" 37 | # PROP Use_MFC 0 38 | # PROP Use_Debug_Libraries 0 39 | # PROP Output_Dir "Release" 40 | # PROP Intermediate_Dir "Release" 41 | # PROP Target_Dir "" 42 | 43 | !ELSEIF "$(CFG)" == "tools - Win32 Debug" 44 | 45 | # PROP BASE Use_MFC 0 46 | # PROP BASE Use_Debug_Libraries 1 47 | # PROP BASE Output_Dir "Debug" 48 | # PROP BASE Intermediate_Dir "Debug" 49 | # PROP BASE Target_Dir "" 50 | # PROP Use_MFC 0 51 | # PROP Use_Debug_Libraries 1 52 | # PROP Output_Dir "Debug" 53 | # PROP Intermediate_Dir "Debug" 54 | # PROP Target_Dir "" 55 | 56 | !ENDIF 57 | 58 | # Begin Target 59 | 60 | # Name "tools - Win32 Release" 61 | # Name "tools - Win32 Debug" 62 | # End Target 63 | # End Project 64 | -------------------------------------------------------------------------------- /m4/ulonglong.m4: -------------------------------------------------------------------------------- 1 | # ulonglong.m4 serial 6 2 | dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. 10 | # This fixes a bug in Autoconf 2.60, but can be removed once we 11 | # assume 2.61 everywhere. 12 | 13 | # Note: If the type 'unsigned long long int' exists but is only 32 bits 14 | # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT 15 | # will not be defined. In this case you can treat 'unsigned long long int' 16 | # like 'unsigned long int'. 17 | 18 | AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], 19 | [ 20 | AC_CACHE_CHECK([for unsigned long long int], 21 | [ac_cv_type_unsigned_long_long_int], 22 | [AC_LINK_IFELSE( 23 | [AC_LANG_PROGRAM( 24 | [[unsigned long long int ull = 18446744073709551615ULL; 25 | typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 26 | ? 1 : -1)]; 27 | int i = 63;]], 28 | [[unsigned long long int ullmax = 18446744073709551615ull; 29 | return (ull << 63 | ull >> 63 | ull << i | ull >> i 30 | | ullmax / ull | ullmax % ull);]])], 31 | [ac_cv_type_unsigned_long_long_int=yes], 32 | [ac_cv_type_unsigned_long_long_int=no])]) 33 | if test $ac_cv_type_unsigned_long_long_int = yes; then 34 | AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, 35 | [Define to 1 if the system has the type `unsigned long long int'.]) 36 | fi 37 | ]) 38 | 39 | # This macro is obsolescent and should go away soon. 40 | AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], 41 | [ 42 | AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) 43 | ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int 44 | if test $ac_cv_type_unsigned_long_long = yes; then 45 | AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, 46 | [Define if you have the 'unsigned long long' type.]) 47 | fi 48 | ]) 49 | -------------------------------------------------------------------------------- /po/ChangeLog: -------------------------------------------------------------------------------- 1 | 2025-06-15 gettextize 2 | 3 | * Makefile.in.in: Upgrade to gettext-0.23.1. 4 | * boldquot.sed: New file, from gettext-0.23.1. 5 | * en@boldquot.header: New file, from gettext-0.23.1. 6 | * en@quot.header: New file, from gettext-0.23.1. 7 | * insert-header.sed: New file, from gettext-0.23.1. 8 | * quot.sed: New file, from gettext-0.23.1. 9 | * remove-potcdate.sed: Upgrade to gettext-0.23.1. 10 | * Rules-quot: New file, from gettext-0.23.1. 11 | 12 | 2008-11-06 gettextize 13 | 14 | * Makefile.in.in: Upgrade to gettext-0.17. 15 | * Rules-quot: New file, from gettext-0.17. 16 | * boldquot.sed: New file, from gettext-0.17. 17 | * en@boldquot.header: New file, from gettext-0.17. 18 | * en@quot.header: New file, from gettext-0.17. 19 | * quot.sed: New file, from gettext-0.17. 20 | 21 | 2007-12-30 gettextize 22 | 23 | * Makefile.in.in: Upgrade to gettext-0.16.1. 24 | * Rules-quot: New file, from gettext-0.16.1. 25 | * boldquot.sed: New file, from gettext-0.16.1. 26 | * en@boldquot.header: New file, from gettext-0.16.1. 27 | * en@quot.header: New file, from gettext-0.16.1. 28 | * quot.sed: New file, from gettext-0.16.1. 29 | 30 | 2006-12-18 gettextize 31 | 32 | * Makefile.in.in: Upgrade to gettext-0.15. 33 | * Rules-quot: New file, from gettext-0.15. 34 | * boldquot.sed: New file, from gettext-0.15. 35 | * en@boldquot.header: New file, from gettext-0.15. 36 | * en@quot.header: New file, from gettext-0.15. 37 | * quot.sed: New file, from gettext-0.15. 38 | 39 | 2005-06-18 gettextize 40 | 41 | * Makefile.in.in: Upgrade to gettext-0.14.3. 42 | * boldquot.sed: New file, from gettext-0.14.3. 43 | * en@boldquot.header: New file, from gettext-0.14.3. 44 | * en@quot.header: New file, from gettext-0.14.3. 45 | * insert-header.sin: New file, from gettext-0.14.3. 46 | * quot.sed: New file, from gettext-0.14.3. 47 | * remove-potcdate.sin: New file, from gettext-0.14.3. 48 | * Rules-quot: New file, from gettext-0.14.3. 49 | 50 | -------------------------------------------------------------------------------- /ogg123/cfgfile_options.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __CFGFILE_OPTIONS_H__ 19 | #define __CFGFILE_OPTIONS_H__ 20 | 21 | #include 22 | 23 | typedef enum { 24 | opt_type_none = 0, 25 | opt_type_bool, 26 | opt_type_char, 27 | opt_type_string, 28 | opt_type_int, 29 | opt_type_float, 30 | opt_type_double 31 | } file_option_type_t; 32 | 33 | typedef enum { 34 | parse_ok = 0, 35 | parse_syserr, 36 | parse_keynotfound, 37 | parse_nokey, 38 | parse_badvalue, 39 | parse_badtype 40 | } parse_code_t; 41 | 42 | typedef struct file_option_t { 43 | char found; 44 | const char *name; 45 | const char *desc; 46 | file_option_type_t type; 47 | void *ptr; 48 | void *dfl; 49 | } file_option_t; 50 | 51 | void file_options_init (file_option_t opts[]); 52 | void file_options_describe (file_option_t opts[], FILE *outfile); 53 | 54 | parse_code_t parse_line (file_option_t opts[], char *line); 55 | parse_code_t parse_config_file (file_option_t opts[], const char *filename); 56 | const char *parse_error_string (parse_code_t pcode); 57 | void parse_std_configs (file_option_t opts[]); 58 | 59 | #endif /* __OPTIONS_H__ */ 60 | -------------------------------------------------------------------------------- /oggenc/audio.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __AUDIO_H 3 | #define __AUDIO_H 4 | 5 | #include "encode.h" 6 | #include 7 | 8 | int setup_resample(oe_enc_opt *opt); 9 | void clear_resample(oe_enc_opt *opt); 10 | void setup_downmix(oe_enc_opt *opt); 11 | void clear_downmix(oe_enc_opt *opt); 12 | void setup_scaler(oe_enc_opt *opt, float scale); 13 | void clear_scaler(oe_enc_opt *opt); 14 | 15 | typedef struct 16 | { 17 | int (*id_func)(unsigned char *buf, int len); /* Returns true if can load file */ 18 | int id_data_len; /* Amount of data needed to id whether this can load the file */ 19 | int (*open_func)(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen); 20 | void (*close_func)(void *); 21 | char *format; 22 | char *description; 23 | } input_format; 24 | 25 | 26 | typedef struct { 27 | short format; 28 | short channels; 29 | int samplerate; 30 | int bytespersec; 31 | short align; 32 | short samplesize; 33 | unsigned int mask; 34 | } wav_fmt; 35 | 36 | typedef struct { 37 | short channels; 38 | short samplesize; 39 | long totalsamples; 40 | long samplesread; 41 | FILE *f; 42 | short bigendian; 43 | int *channel_permute; 44 | } wavfile; 45 | 46 | typedef struct { 47 | short channels; 48 | int totalframes; 49 | short samplesize; 50 | int rate; 51 | int offset; 52 | int blocksize; 53 | } aiff_fmt; 54 | 55 | typedef wavfile aifffile; /* They're the same */ 56 | 57 | input_format *open_audio_file(FILE *in, oe_enc_opt *opt); 58 | 59 | int raw_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen); 60 | int wav_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen); 61 | int aiff_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen); 62 | int wav_id(unsigned char *buf, int len); 63 | int aiff_id(unsigned char *buf, int len); 64 | void wav_close(void *); 65 | void raw_close(void *); 66 | 67 | long wav_read(void *, float **buffer, int samples); 68 | long wav_ieee_read(void *, float **buffer, int samples); 69 | long raw_read_stereo(void *, float **buffer, int samples); 70 | 71 | #endif /* __AUDIO_H */ 72 | 73 | -------------------------------------------------------------------------------- /ogg123/audio.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | /* ogg123's audio playback functions */ 19 | 20 | #ifndef __AUDIO_H__ 21 | #define __AUDIO_H__ 22 | 23 | #include 24 | 25 | 26 | typedef struct audio_format_t { 27 | int big_endian; 28 | int word_size; 29 | int signed_sample; 30 | int rate; 31 | int channels; 32 | char *matrix; 33 | } audio_format_t; 34 | 35 | 36 | /* For facilitating output to multiple devices */ 37 | typedef struct audio_device_t { 38 | int driver_id; 39 | ao_device *device; 40 | ao_option *options; 41 | char *filename; 42 | struct audio_device_t *next_device; 43 | } audio_device_t; 44 | 45 | 46 | int audio_format_equal (audio_format_t *a, audio_format_t *b); 47 | audio_device_t *append_audio_device(audio_device_t *devices_list, 48 | int driver_id, 49 | ao_option *options, char *filename); 50 | void audio_devices_print_info(audio_device_t *d); 51 | int audio_devices_write(audio_device_t *d, void *ptr, int nbytes); 52 | int add_ao_option(ao_option **op_h, const char *optstring); 53 | void close_audio_devices (audio_device_t *devices); 54 | void free_audio_devices (audio_device_t *devices); 55 | void ao_onexit (void *arg); 56 | 57 | #endif /* __AUDIO_H__ */ 58 | -------------------------------------------------------------------------------- /vorbiscomment/vcedit.h: -------------------------------------------------------------------------------- 1 | /* This program is licensed under the GNU Library General Public License, version 2, 2 | * a copy of which is included with this program (with filename LICENSE.LGPL). 3 | * 4 | * (c) 2000-2001 Michael Smith 5 | * (c) 2020 Philipp Schafft 6 | * 7 | * VCEdit header. 8 | * 9 | * last modified: $ID:$ 10 | */ 11 | 12 | #ifndef __VCEDIT_H 13 | #define __VCEDIT_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | typedef size_t (*vcedit_read_func)(void *, size_t, size_t, void *); 24 | typedef size_t (*vcedit_write_func)(const void *, size_t, size_t, void *); 25 | 26 | typedef struct { 27 | long *streams; 28 | size_t streams_len; 29 | } vcedit_serial_nos; 30 | 31 | typedef struct { 32 | ogg_sync_state *oy; 33 | ogg_stream_state *os; 34 | 35 | vorbis_comment *vc; 36 | vorbis_info *vi; 37 | 38 | vcedit_read_func read; 39 | vcedit_write_func write; 40 | 41 | void *in; 42 | int serial; 43 | vcedit_serial_nos serials; 44 | unsigned char *mainbuf; 45 | unsigned char *bookbuf; 46 | int mainlen; 47 | int booklen; 48 | char *lasterror; 49 | char *vendor; 50 | int prevW; 51 | int extrapage; 52 | int eosin; 53 | struct vcedit_buffer_chain *sidebuf; 54 | } vcedit_state; 55 | 56 | extern vcedit_state * vcedit_new_state(void); 57 | extern void vcedit_clear(vcedit_state *state); 58 | extern vorbis_comment * vcedit_comments(vcedit_state *state); 59 | extern int vcedit_open(vcedit_state *state, FILE *in); 60 | extern int vcedit_open_callbacks(vcedit_state *state, void *in, 61 | vcedit_read_func read_func, vcedit_write_func write_func); 62 | extern int vcedit_write(vcedit_state *state, void *out); 63 | extern const char * vcedit_error(vcedit_state *state); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* __VCEDIT_H */ 70 | 71 | -------------------------------------------------------------------------------- /m4/pkg.m4: -------------------------------------------------------------------------------- 1 | 2 | dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) 3 | dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page 4 | dnl also defines GSTUFF_PKG_ERRORS on error 5 | AC_DEFUN([PKG_CHECK_MODULES], [ 6 | succeeded=no 7 | 8 | if test -z "$PKG_CONFIG"; then 9 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) 10 | fi 11 | 12 | if test "$PKG_CONFIG" = "no" ; then 13 | echo "*** The pkg-config script could not be found. Make sure it is" 14 | echo "*** in your path, or set the PKG_CONFIG environment variable" 15 | echo "*** to the full path to pkg-config." 16 | echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." 17 | else 18 | PKG_CONFIG_MIN_VERSION=0.9.0 19 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then 20 | AC_MSG_CHECKING(for $2) 21 | 22 | if $PKG_CONFIG --exists "$2" ; then 23 | AC_MSG_RESULT(yes) 24 | succeeded=yes 25 | 26 | AC_MSG_CHECKING($1_CFLAGS) 27 | $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` 28 | AC_MSG_RESULT($$1_CFLAGS) 29 | 30 | AC_MSG_CHECKING($1_LIBS) 31 | $1_LIBS=`$PKG_CONFIG --libs "$2"` 32 | AC_MSG_RESULT($$1_LIBS) 33 | else 34 | $1_CFLAGS="" 35 | $1_LIBS="" 36 | ## If we have a custom action on failure, don't print errors, but 37 | ## do set a variable so people can do so. 38 | $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 39 | ifelse([$4], ,echo $$1_PKG_ERRORS,) 40 | fi 41 | 42 | AC_SUBST($1_CFLAGS) 43 | AC_SUBST($1_LIBS) 44 | else 45 | echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." 46 | echo "*** See http://www.freedesktop.org/software/pkgconfig" 47 | fi 48 | fi 49 | 50 | if test $succeeded = yes; then 51 | ifelse([$3], , :, [$3]) 52 | else 53 | ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) 54 | fi 55 | ]) 56 | 57 | 58 | -------------------------------------------------------------------------------- /ogg123/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | if HAVE_LIBFLAC 3 | flac_sources = flac_format.c easyflac.c easyflac.h 4 | else 5 | flac_sources = 6 | endif 7 | if HAVE_LIBSPEEX 8 | speex_sources = speex_format.c 9 | else 10 | speex_sources = 11 | endif 12 | if HAVE_LIBOPUSFILE 13 | opus_sources = opus_format.c 14 | else 15 | opus_sources = 16 | endif 17 | 18 | if HAVE_OV_READ_FILTER 19 | vgfilter_sources = vgfilter.c vgfilter.h 20 | else 21 | vgfilter_sources = 22 | endif 23 | 24 | datadir = @datadir@ 25 | localedir = $(datadir)/locale 26 | DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@ 27 | 28 | docdir = $(datadir)/doc/$(PACKAGE) 29 | mandir = @MANDIR@ 30 | 31 | bin_PROGRAMS = ogg123 32 | 33 | AM_CPPFLAGS = @OGG_CFLAGS@ @VORBIS_CFLAGS@ @OPUSFILE_CFLAGS@ @AO_CFLAGS@ @CURL_CFLAGS@ \ 34 | @PTHREAD_CFLAGS@ @SHARE_CFLAGS@ @I18N_CFLAGS@ 35 | 36 | ogg123_LDADD = @SHARE_LIBS@ $(top_builddir)/share/libpicture.a $(top_builddir)/share/libbase64.a \ 37 | @VORBISFILE_LIBS@ @VORBIS_LIBS@ @OGG_LIBS@ @AO_LIBS@ \ 38 | @SOCKET_LIBS@ @LIBICONV@ @CURL_LIBS@ @PTHREAD_CFLAGS@ \ 39 | @PTHREAD_LIBS@ @I18N_LIBS@ @FLAC_LIBS@ @SPEEX_LIBS@ @OPUSFILE_LIBS@ \ 40 | -lm 41 | 42 | ogg123_DEPENDENCIES = @SHARE_LIBS@ $(top_builddir)/share/libpicture.a $(top_builddir)/share/libbase64.a 43 | ogg123_SOURCES = audio.c buffer.c callbacks.c \ 44 | cfgfile_options.c cmdline_options.c \ 45 | file_transport.c format.c http_transport.c \ 46 | ogg123.c oggvorbis_format.c playlist.c \ 47 | status.c remote.c transport.c vorbis_comments.c \ 48 | audio.h buffer.h callbacks.h compat.h \ 49 | cfgfile_options.h cmdline_options.h \ 50 | format.h ogg123.h playlist.h status.h \ 51 | transport.h remote.h vorbis_comments.h \ 52 | $(flac_sources) $(speex_sources) $(opus_sources) \ 53 | $(vgfilter_sources) 54 | 55 | man_MANS = ogg123.1 56 | doc_DATA = ogg123rc-example 57 | 58 | EXTRA_ogg123_SOURCES = \ 59 | $(man_MANS) $(doc_DATA) 60 | 61 | debug: 62 | $(MAKE) all CFLAGS="@DEBUG@" 63 | 64 | profile: 65 | $(MAKE) all CFLAGS="@PROFILE@" 66 | -------------------------------------------------------------------------------- /ogginfo/private.h: -------------------------------------------------------------------------------- 1 | /* Ogginfo 2 | * 3 | * A tool to describe ogg file contents and metadata. 4 | * 5 | * This file is a common header for the code files. 6 | * 7 | * Copyright 2002-2005 Michael Smith 8 | * Copyright 2020 Philipp Schafft 9 | * Licensed under the GNU GPL, distributed with this program. 10 | */ 11 | 12 | #ifndef __VORBIS_TOOLS__PRIVATE_H__ 13 | #define __VORBIS_TOOLS__PRIVATE_H__ 14 | 15 | #include "picture.h" 16 | 17 | typedef struct _stream_processor { 18 | void (*process_page)(struct _stream_processor *, ogg_page *); 19 | void (*process_end)(struct _stream_processor *); 20 | int isillegal; 21 | int constraint_violated; 22 | int shownillegal; 23 | int isnew; 24 | long seqno; 25 | int lostseq; 26 | 27 | int start; 28 | int end; 29 | 30 | int num; 31 | const char *type; 32 | 33 | ogg_uint32_t serial; /* must be 32 bit unsigned */ 34 | ogg_stream_state os; 35 | void *data; 36 | } stream_processor; 37 | 38 | extern int printlots; 39 | 40 | static inline ogg_uint16_t read_u16le(const unsigned char *in) 41 | { 42 | return in[0] | (in[1] << 8); 43 | } 44 | 45 | static inline ogg_uint32_t read_u32le(const unsigned char *in) 46 | { 47 | return in[0] | (in[1] << 8) | (in[2] << 16) | (in[3] << 24); 48 | } 49 | 50 | void info(const char *format, ...); 51 | void warn(const char *format, ...); 52 | void error(const char *format, ...); 53 | 54 | void print_summary(stream_processor *stream, size_t bytes, double time); 55 | int handle_vorbis_comments(stream_processor *stream, const unsigned char *in, size_t length, size_t *end); 56 | void check_xiph_comment(stream_processor *stream, int i, const char *comment, int comment_length); 57 | void check_flac_picture(flac_picture_t *picture, const char *prefix); 58 | 59 | void vorbis_start(stream_processor *stream); 60 | void theora_start(stream_processor *stream); 61 | void kate_start(stream_processor *stream); 62 | void opus_start(stream_processor *stream); 63 | void speex_start(stream_processor *stream); 64 | void flac_start(stream_processor *stream); 65 | void skeleton_start(stream_processor *stream); 66 | void other_start(stream_processor *stream, const char *type); 67 | void invalid_start(stream_processor *stream); 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /share/makemap.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Edmund Grimley Evans 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | #include 21 | #endif 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | int main(int argc, char *argv[]) 28 | { 29 | iconv_t cd; 30 | const char *ib; 31 | char *ob; 32 | size_t ibl, obl, k; 33 | unsigned char c, buf[4]; 34 | int i, wc; 35 | 36 | if (argc != 2) { 37 | printf("Usage: %s ENCODING\n", argv[0]); 38 | printf("Output a charset map for the 8-bit ENCODING.\n"); 39 | return 1; 40 | } 41 | 42 | cd = iconv_open("UCS-4", argv[1]); 43 | if (cd == (iconv_t)(-1)) { 44 | perror("iconv_open"); 45 | return 1; 46 | } 47 | 48 | for (i = 0; i < 256; i++) { 49 | c = i; 50 | ib = &c; 51 | ibl = 1; 52 | ob = buf; 53 | obl = 4; 54 | k = iconv(cd, &ib, &ibl, &ob, &obl); 55 | if (!k && !ibl && !obl) { 56 | wc = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3]; 57 | if (wc >= 0xffff) { 58 | printf("Dodgy value.\n"); 59 | return 1; 60 | } 61 | } 62 | else if (k == (size_t)(-1) && errno == EILSEQ) 63 | wc = 0xffff; 64 | else { 65 | printf("Non-standard iconv.\n"); 66 | return 1; 67 | } 68 | 69 | if (i % 8 == 0) 70 | printf(" "); 71 | printf("0x%04x", wc); 72 | if (i == 255) 73 | printf("\n"); 74 | else if (i % 8 == 7) 75 | printf(",\n"); 76 | else 77 | printf(", "); 78 | } 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /m4/visibility.m4: -------------------------------------------------------------------------------- 1 | # visibility.m4 serial 1 (gettext-0.15) 2 | dnl Copyright (C) 2005 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | dnl Tests whether the compiler supports the command-line option 10 | dnl -fvisibility=hidden and the function and variable attributes 11 | dnl __attribute__((__visibility__("hidden"))) and 12 | dnl __attribute__((__visibility__("default"))). 13 | dnl Does *not* test for __visibility__("protected") - which has tricky 14 | dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on 15 | dnl MacOS X. 16 | dnl Does *not* test for __visibility__("internal") - which has processor 17 | dnl dependent semantics. 18 | dnl Does *not* test for #pragma GCC visibility push(hidden) - which is 19 | dnl "really only recommended for legacy code". 20 | dnl Set the variable CFLAG_VISIBILITY. 21 | dnl Defines and sets the variable HAVE_VISIBILITY. 22 | 23 | AC_DEFUN([gl_VISIBILITY], 24 | [ 25 | AC_REQUIRE([AC_PROG_CC]) 26 | CFLAG_VISIBILITY= 27 | HAVE_VISIBILITY=0 28 | if test -n "$GCC"; then 29 | AC_MSG_CHECKING([for simple visibility declarations]) 30 | AC_CACHE_VAL(gl_cv_cc_visibility, [ 31 | gl_save_CFLAGS="$CFLAGS" 32 | CFLAGS="$CFLAGS -fvisibility=hidden" 33 | AC_TRY_COMPILE( 34 | [extern __attribute__((__visibility__("hidden"))) int hiddenvar; 35 | extern __attribute__((__visibility__("default"))) int exportedvar; 36 | extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); 37 | extern __attribute__((__visibility__("default"))) int exportedfunc (void);], 38 | [], 39 | gl_cv_cc_visibility=yes, 40 | gl_cv_cc_visibility=no) 41 | CFLAGS="$gl_save_CFLAGS"]) 42 | AC_MSG_RESULT([$gl_cv_cc_visibility]) 43 | if test $gl_cv_cc_visibility = yes; then 44 | CFLAG_VISIBILITY="-fvisibility=hidden" 45 | HAVE_VISIBILITY=1 46 | fi 47 | fi 48 | AC_SUBST([CFLAG_VISIBILITY]) 49 | AC_SUBST([HAVE_VISIBILITY]) 50 | AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], 51 | [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) 52 | ]) 53 | -------------------------------------------------------------------------------- /ogg123/transport.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifdef HAVE_CONFIG_H 19 | #include 20 | #endif 21 | 22 | #include 23 | #include 24 | 25 | #include "transport.h" 26 | #include "i18n.h" 27 | 28 | extern transport_t file_transport; 29 | #ifdef HAVE_CURL 30 | extern transport_t http_transport; 31 | #endif 32 | 33 | static const transport_t *transports[] = { 34 | #ifdef HAVE_CURL 35 | &http_transport, 36 | #endif 37 | &file_transport, 38 | NULL 39 | }; 40 | 41 | 42 | const transport_t *get_transport_by_name (const char *name) 43 | { 44 | int i = 0; 45 | 46 | while (transports[i] != NULL && strcmp(name, transports[i]->name) != 0) 47 | i++; 48 | 49 | return transports[i]; 50 | } 51 | 52 | 53 | const transport_t *select_transport (const char *source) 54 | { 55 | int i = 0; 56 | 57 | while (transports[i] != NULL && !transports[i]->can_transport(source)) 58 | i++; 59 | 60 | return transports[i]; 61 | } 62 | 63 | 64 | data_source_stats_t *malloc_data_source_stats (data_source_stats_t *to_copy) 65 | { 66 | data_source_stats_t *new_stats; 67 | 68 | new_stats = malloc(sizeof(data_source_stats_t)); 69 | 70 | if (new_stats == NULL) { 71 | fprintf(stderr, _("ERROR: Could not allocate memory in malloc_data_source_stats()\n")); 72 | exit(1); 73 | } 74 | 75 | *new_stats = *to_copy; /* Copy the data */ 76 | 77 | return new_stats; 78 | } 79 | -------------------------------------------------------------------------------- /ogg123/ogg123.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __OGG123_H__ 19 | #define __OGG123_H__ 20 | 21 | #include 22 | #include "audio.h" 23 | #include "playlist.h" 24 | 25 | typedef struct ogg123_options_t { 26 | int verbosity; /* Verbose output if > 1, quiet if 0 */ 27 | 28 | int shuffle; /* Should we shuffle playing? */ 29 | int repeat; /* Repeat playlist indefinitely? */ 30 | ogg_int64_t delay; /* delay (in millisecs) for skip to next song */ 31 | int nth; /* Play every nth chunk */ 32 | int ntimes; /* Play every chunk n times */ 33 | double seekoff; /* Offset to seek to */ 34 | double endpos; /* Position in file to play to (greater than seekpos) */ 35 | int seekmode; /* DECODER_SEEK_[NONE | START | CUR */ 36 | 37 | long buffer_size; /* Size of audio buffer */ 38 | float prebuffer; /* Percent of buffer to fill before playing */ 39 | long input_buffer_size; /* Size of input audio buffer */ 40 | float input_prebuffer; 41 | 42 | char *default_device; /* Name of default driver to use */ 43 | 44 | audio_device_t *devices; /* Audio devices to use */ 45 | 46 | double status_freq; /* Number of status updates per second */ 47 | 48 | int remote; /* Remotely controlled */ 49 | 50 | playlist_t *playlist; /* List of files to play */ 51 | 52 | } ogg123_options_t; 53 | 54 | typedef struct signal_request_t { 55 | int cancel; 56 | int skipfile; 57 | int exit; 58 | int pause; 59 | ogg_int64_t last_ctrl_c; 60 | } signal_request_t; 61 | 62 | #endif /* __OGG123_H__ */ 63 | -------------------------------------------------------------------------------- /include/picture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 Philipp Schafft 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef __PICTURE_H__ 20 | #define __PICTURE_H__ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #include 27 | 28 | typedef enum { 29 | FLAC_PICTURE_INVALID = -1, 30 | FLAC_PICTURE_OTHER = 0, 31 | FLAC_PICTURE_FILE_ICON = 1, 32 | FLAC_PICTURE_OTHER_FILE_ICON = 2, 33 | FLAC_PICTURE_COVER_FRONT = 3, 34 | FLAC_PICTURE_COVER_BACK = 4, 35 | FLAC_PICTURE_LEAFLET_PAGE = 5, 36 | FLAC_PICTURE_MEDIA = 6, 37 | FLAC_PICTURE_LEAD = 7, 38 | FLAC_PICTURE_ARTIST = 8, 39 | FLAC_PICTURE_CONDUCTOR = 9, 40 | FLAC_PICTURE_BAND = 10, 41 | FLAC_PICTURE_COMPOSER = 11, 42 | FLAC_PICTURE_LYRICIST = 12, 43 | FLAC_PICTURE_RECORDING_LOCATION = 13, 44 | FLAC_PICTURE_DURING_RECORDING = 14, 45 | FLAC_PICTURE_DURING_PREFORMANCE = 15, 46 | FLAC_PICTURE_SCREEN_CAPTURE = 16, 47 | FLAC_PICTURE_A_BRIGHT_COLOURED_FISH = 17, 48 | FLAC_PICTURE_ILLUSTRATION = 18, 49 | FLAC_PICTURE_BAND_LOGOTYPE = 19, 50 | FLAC_PICTURE_PUBLISHER_LOGOTYPE = 20 51 | } flac_picture_type; 52 | 53 | typedef struct { 54 | flac_picture_type type; 55 | const char *media_type; 56 | const char *description; 57 | unsigned int width; 58 | unsigned int height; 59 | unsigned int depth; 60 | unsigned int colors; 61 | const void *binary; 62 | size_t binary_length; 63 | const char *uri; 64 | void *private_data; 65 | size_t private_data_length; 66 | } flac_picture_t; 67 | 68 | const char * flac_picture_type_string(flac_picture_type type); 69 | 70 | flac_picture_t * flac_picture_parse_from_base64(const char *str); 71 | flac_picture_t * flac_picture_parse_from_blob(const void *in, size_t len); 72 | 73 | void flac_picture_free(flac_picture_t *picture); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /ogg123/format.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifdef HAVE_CONFIG_H 19 | #include "config.h" 20 | #endif 21 | 22 | #include 23 | #include 24 | 25 | #include "transport.h" 26 | #include "format.h" 27 | #include "i18n.h" 28 | 29 | extern format_t oggvorbis_format; 30 | extern format_t speex_format; 31 | 32 | #ifdef HAVE_LIBFLAC 33 | extern format_t flac_format; 34 | extern format_t oggflac_format; 35 | #endif 36 | 37 | #ifdef HAVE_LIBSPEEX 38 | extern format_t speex_format; 39 | #endif 40 | 41 | #ifdef HAVE_LIBOPUSFILE 42 | extern format_t opus_format; 43 | #endif 44 | 45 | 46 | format_t *formats[] = { 47 | #ifdef HAVE_LIBFLAC 48 | &flac_format, 49 | &oggflac_format, 50 | #endif 51 | #ifdef HAVE_LIBSPEEX 52 | &speex_format, 53 | #endif 54 | #ifdef HAVE_LIBOPUSFILE 55 | &opus_format, 56 | #endif 57 | &oggvorbis_format, 58 | NULL }; 59 | 60 | 61 | format_t *get_format_by_name (char *name) 62 | { 63 | int i = 0; 64 | 65 | while (formats[i] != NULL && strcmp(name, formats[i]->name) != 0) 66 | i++; 67 | 68 | return formats[i]; 69 | } 70 | 71 | 72 | format_t *select_format (data_source_t *source) 73 | { 74 | int i = 0; 75 | 76 | while (formats[i] != NULL && !formats[i]->can_decode(source)) 77 | i++; 78 | 79 | return formats[i]; 80 | } 81 | 82 | 83 | decoder_stats_t *malloc_decoder_stats (decoder_stats_t *to_copy) 84 | { 85 | decoder_stats_t *new_stats; 86 | 87 | new_stats = malloc(sizeof(decoder_stats_t)); 88 | 89 | if (new_stats == NULL) { 90 | fprintf(stderr, _("ERROR: Could not allocate memory in malloc_decoder_stats()\n")); 91 | exit(1); 92 | } 93 | 94 | *new_stats = *to_copy; /* Copy the data */ 95 | 96 | return new_stats; 97 | } 98 | -------------------------------------------------------------------------------- /ogg123/transport.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __TRANSPORT_H__ 19 | #define __TRANSPORT_H__ 20 | 21 | #include 22 | #include 23 | #include "ogg/os_types.h" 24 | #include "buffer.h" 25 | #include "ogg123.h" 26 | 27 | typedef struct data_source_stats_t { 28 | ogg_int64_t bytes_read; 29 | int input_buffer_used; /* flag to show if this data_source uses an 30 | input buffer. Ignore the contents of 31 | input_buffer and transfer rate if it is 32 | false. */ 33 | long transfer_rate; 34 | buffer_stats_t input_buffer; 35 | } data_source_stats_t; 36 | 37 | struct transport_t; 38 | 39 | typedef struct data_source_t { 40 | char *source_string; 41 | struct transport_t *transport; 42 | void *private; 43 | } data_source_t; 44 | 45 | typedef struct transport_t { 46 | const char *name; 47 | int (* can_transport)(const char *source_string); 48 | data_source_t* (* open) (const char *source_string, ogg123_options_t *ogg123_opts); 49 | int (* peek) (data_source_t *source, void *ptr, size_t size, size_t nmemb); 50 | int (* read) (data_source_t *source, void *ptr, size_t size, size_t nmemb); 51 | int (* seek) (data_source_t *source, long offset, int whence); 52 | data_source_stats_t * (* statistics) (data_source_t *source); 53 | long (* tell) (data_source_t *source); 54 | void (* close) (data_source_t *source); 55 | } transport_t; 56 | 57 | const transport_t *get_transport_by_name (const char *name); 58 | const transport_t *select_transport (const char *source); 59 | 60 | data_source_stats_t *malloc_data_source_stats (data_source_stats_t *to_copy); 61 | 62 | #endif /* __TRANSPORT_H__ */ 63 | -------------------------------------------------------------------------------- /m4/ChangeLog: -------------------------------------------------------------------------------- 1 | 2025-06-15 gettextize 2 | 3 | * build-to-host.m4: New file, from gettext-0.23.1. 4 | * gettext.m4: Upgrade to gettext-0.23.1. 5 | * host-cpu-c-abi.m4: New file, from gettext-0.23.1. 6 | * iconv.m4: Upgrade to gettext-0.23.1. 7 | * intlmacosx.m4: Upgrade to gettext-0.23.1. 8 | * lib-ld.m4: Upgrade to gettext-0.23.1. 9 | * lib-link.m4: Upgrade to gettext-0.23.1. 10 | * lib-prefix.m4: Upgrade to gettext-0.23.1. 11 | * nls.m4: Upgrade to gettext-0.23.1. 12 | * po.m4: Upgrade to gettext-0.23.1. 13 | * progtest.m4: Upgrade to gettext-0.23.1. 14 | * Makefile.am (EXTRA_DIST): Add the new files. 15 | 16 | 2008-11-06 gettextize 17 | 18 | * gettext.m4: Upgrade to gettext-0.17. 19 | * iconv.m4: Upgrade to gettext-0.17. 20 | * lib-link.m4: Upgrade to gettext-0.17. 21 | * po.m4: Upgrade to gettext-0.17. 22 | * intdiv0.m4: Upgrade to gettext-0.17. 23 | * intl.m4: Upgrade to gettext-0.17. 24 | * intlmacosx.m4: New file, from gettext-0.17. 25 | * lock.m4: Upgrade to gettext-0.17. 26 | * longlong.m4: Upgrade to gettext-0.17. 27 | * printf-posix.m4: Upgrade to gettext-0.17. 28 | * size_max.m4: Upgrade to gettext-0.17. 29 | * uintmax_t.m4: Upgrade to gettext-0.17. 30 | * wint_t.m4: Upgrade to gettext-0.17. 31 | * Makefile.am (EXTRA_DIST): Add the new files. 32 | 33 | 2007-12-30 gettextize 34 | 35 | * gettext.m4: Upgrade to gettext-0.16.1. 36 | * lib-link.m4: Upgrade to gettext-0.16.1. 37 | * codeset.m4: Upgrade to gettext-0.16.1. 38 | * intl.m4: New file, from gettext-0.16.1. 39 | * intldir.m4: New file, from gettext-0.16.1. 40 | * intmax.m4: Upgrade to gettext-0.16.1. 41 | * inttypes_h.m4: Upgrade to gettext-0.16.1. 42 | * inttypes-pri.m4: Upgrade to gettext-0.16.1. 43 | * lock.m4: Upgrade to gettext-0.16.1. 44 | * longlong.m4: Upgrade to gettext-0.16.1. 45 | * size_max.m4: Upgrade to gettext-0.16.1. 46 | * stdint_h.m4: Upgrade to gettext-0.16.1. 47 | * ulonglong.m4: Upgrade to gettext-0.16.1. 48 | * Makefile.am (EXTRA_DIST): Add the new files. 49 | 50 | 2006-12-18 gettextize 51 | 52 | * gettext.m4: Upgrade to gettext-0.15. 53 | * inttypes-h.m4: New file, from gettext-0.15. 54 | * inttypes-pri.m4: Upgrade to gettext-0.15. 55 | * lib-link.m4: Upgrade to gettext-0.15. 56 | * lib-prefix.m4: Upgrade to gettext-0.15. 57 | * lock.m4: New file, from gettext-0.15. 58 | * longdouble.m4: Upgrade to gettext-0.15. 59 | * nls.m4: Upgrade to gettext-0.15. 60 | * po.m4: Upgrade to gettext-0.15. 61 | * size_max.m4: Upgrade to gettext-0.15. 62 | * visibility.m4: New file, from gettext-0.15. 63 | * Makefile.am (EXTRA_DIST): Add the new files. 64 | 65 | -------------------------------------------------------------------------------- /m4/intdiv0.m4: -------------------------------------------------------------------------------- 1 | # intdiv0.m4 serial 2 (gettext-0.17) 2 | dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([gt_INTDIV0], 10 | [ 11 | AC_REQUIRE([AC_PROG_CC])dnl 12 | AC_REQUIRE([AC_CANONICAL_HOST])dnl 13 | 14 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], 15 | gt_cv_int_divbyzero_sigfpe, 16 | [ 17 | gt_cv_int_divbyzero_sigfpe= 18 | changequote(,)dnl 19 | case "$host_os" in 20 | macos* | darwin[6-9]* | darwin[1-9][0-9]*) 21 | # On MacOS X 10.2 or newer, just assume the same as when cross- 22 | # compiling. If we were to perform the real test, 1 Crash Report 23 | # dialog window would pop up. 24 | case "$host_cpu" in 25 | i[34567]86 | x86_64) 26 | gt_cv_int_divbyzero_sigfpe="guessing yes" ;; 27 | esac 28 | ;; 29 | esac 30 | changequote([,])dnl 31 | if test -z "$gt_cv_int_divbyzero_sigfpe"; then 32 | AC_TRY_RUN([ 33 | #include 34 | #include 35 | 36 | static void 37 | sigfpe_handler (int sig) 38 | { 39 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ 40 | exit (sig != SIGFPE); 41 | } 42 | 43 | int x = 1; 44 | int y = 0; 45 | int z; 46 | int nan; 47 | 48 | int main () 49 | { 50 | signal (SIGFPE, sigfpe_handler); 51 | /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ 52 | #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) 53 | signal (SIGTRAP, sigfpe_handler); 54 | #endif 55 | /* Linux/SPARC yields signal SIGILL. */ 56 | #if defined (__sparc__) && defined (__linux__) 57 | signal (SIGILL, sigfpe_handler); 58 | #endif 59 | 60 | z = x / y; 61 | nan = y / y; 62 | exit (1); 63 | } 64 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, 65 | [ 66 | # Guess based on the CPU. 67 | changequote(,)dnl 68 | case "$host_cpu" in 69 | alpha* | i[34567]86 | x86_64 | m68k | s390*) 70 | gt_cv_int_divbyzero_sigfpe="guessing yes";; 71 | *) 72 | gt_cv_int_divbyzero_sigfpe="guessing no";; 73 | esac 74 | changequote([,])dnl 75 | ]) 76 | fi 77 | ]) 78 | case "$gt_cv_int_divbyzero_sigfpe" in 79 | *yes) value=1;; 80 | *) value=0;; 81 | esac 82 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, 83 | [Define if integer division by zero raises signal SIGFPE.]) 84 | ]) 85 | -------------------------------------------------------------------------------- /ogg123/callbacks.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __CALLBACKS_H__ 19 | #define __CALLBACKS_H__ 20 | 21 | #include "audio.h" 22 | #include "buffer.h" 23 | #include "status.h" 24 | #include "format.h" 25 | #include "transport.h" 26 | 27 | 28 | /* Audio callbacks */ 29 | 30 | typedef struct audio_play_arg_t { 31 | stat_format_t *stat_format; 32 | audio_device_t *devices; 33 | } audio_play_arg_t; 34 | 35 | typedef struct audio_reopen_arg_t { 36 | audio_device_t *devices; 37 | audio_format_t *format; 38 | } audio_reopen_arg_t; 39 | 40 | int audio_play_callback (void *ptr, int nbytes, int eos, void *arg); 41 | void audio_reopen_action (buf_t *buf, void *arg); 42 | 43 | audio_reopen_arg_t *new_audio_reopen_arg (audio_device_t *devices, 44 | audio_format_t *fmt); 45 | 46 | 47 | /* Statisitics callbacks */ 48 | 49 | typedef struct print_statistics_arg_t { 50 | stat_format_t *stat_format; 51 | data_source_stats_t *data_source_statistics; 52 | decoder_stats_t *decoder_statistics; 53 | } print_statistics_arg_t; 54 | 55 | void print_statistics_action (buf_t *buf, void *arg); 56 | print_statistics_arg_t *new_print_statistics_arg ( 57 | stat_format_t *stat_format, 58 | data_source_stats_t *data_source_statistics, 59 | decoder_stats_t *decoder_statistics); 60 | 61 | 62 | /* Decoder callbacks */ 63 | void decoder_error_callback (void *arg, int severity, char *message, ...); 64 | void decoder_metadata_callback (void *arg, int verbosity, char *message, ...); 65 | 66 | void decoder_buffered_error_callback (void *arg, int severity, 67 | char *message, ...); 68 | void decoder_buffered_metadata_callback (void *arg, int verbosity, 69 | char *message, ...); 70 | 71 | 72 | #endif /* __CALLBACKS_H__ */ 73 | -------------------------------------------------------------------------------- /ogg123/vgfilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * vgfilter.h (c) 2007,2008 William Poetra Yoga Hadisoeseno 3 | * based on: 4 | * vgplay.h 1.0 (c) 2003 John Morton 5 | */ 6 | 7 | /* vgplay.h 1.0 (c) 2003 John Morton 8 | * 9 | * Portions of this file are (C) COPYRIGHT 1994-2002 by 10 | * the XIPHOPHORUS Company http://www.xiph.org/ 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions 14 | * are met: 15 | * 16 | * - Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in the 21 | * documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * - Neither the name of the Xiph.org Foundation nor the names of its 25 | * contributors may be used to endorse or promote products derived 26 | * from this software without specific prior written permission. 27 | * 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 35 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 36 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 38 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 39 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 40 | * OF THE POSSIBILITY OF SUCH DAMAGE. 41 | * 42 | ********************************************************************** 43 | * 44 | * vgfilter - a filter for ov_read_filter to enable replay gain. 45 | * 46 | */ 47 | 48 | 49 | #ifndef __VGPLAY_H 50 | #define __VGPLAY_H 51 | 52 | /* Default pre-amp in dB */ 53 | #define VG_PREAMP_DB 0.0 54 | 55 | typedef struct { 56 | float scale_factor; /* The scale factor */ 57 | float max_scale; /* The maximum scale factor before clipping occurs */ 58 | } vgain_state; 59 | 60 | 61 | /* Initializes the ReplayGain the vgain_state structure for a track. */ 62 | extern void vg_init(vgain_state *vg_state, vorbis_comment *vc); 63 | 64 | /* The filter where VorbisGain is applied */ 65 | extern void vg_filter(float **pcm, long channels, long samples, void *filter_param); 66 | 67 | #endif /* __VGPLAY_H */ 68 | -------------------------------------------------------------------------------- /po/Rules-quot: -------------------------------------------------------------------------------- 1 | # Special Makefile rules for English message catalogs with quotation marks. 2 | # 3 | # Copyright (C) 2001-2024 Free Software Foundation, Inc. 4 | # This file is free software; the Free Software Foundation 5 | # gives unlimited permission to copy and/or distribute it, 6 | # with or without modifications, as long as this notice is preserved. 7 | # This file is offered as-is, without any warranty. 8 | # 9 | # Written by Bruno Haible , 2001. 10 | 11 | DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sed Rules-quot 12 | 13 | .SUFFIXES: .insert-header .po-update-en 14 | 15 | en@quot.po-create: 16 | $(MAKE) en@quot.po-update 17 | en@boldquot.po-create: 18 | $(MAKE) en@boldquot.po-update 19 | 20 | en@quot.po-update: en@quot.po-update-en 21 | en@boldquot.po-update: en@boldquot.po-update-en 22 | 23 | .insert-header.po-update-en: 24 | @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 25 | if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 26 | tmpdir=`pwd`; \ 27 | echo "$$lang:"; \ 28 | ll=`echo $$lang | sed -e 's/@.*//'`; \ 29 | LC_ALL=C; export LC_ALL; \ 30 | cd $(srcdir); \ 31 | if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ 32 | | $(SED) -f $$tmpdir/$$lang.insert-header | $(SED) -e '/^%%/d' \ 33 | | $(MSGCONV) -t UTF-8 | \ 34 | { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ 35 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ 36 | $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ 37 | ;; \ 38 | *) \ 39 | $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ 40 | ;; \ 41 | esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ 42 | ; then \ 43 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 44 | rm -f $$tmpdir/$$lang.new.po; \ 45 | else \ 46 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 47 | :; \ 48 | else \ 49 | echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 50 | exit 1; \ 51 | fi; \ 52 | fi; \ 53 | else \ 54 | echo "creation of $$lang.po failed!" 1>&2; \ 55 | rm -f $$tmpdir/$$lang.new.po; \ 56 | fi 57 | 58 | en@quot.insert-header: insert-header.sed 59 | sed -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sed > en@quot.insert-header 60 | 61 | en@boldquot.insert-header: insert-header.sed 62 | sed -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sed > en@boldquot.insert-header 63 | 64 | mostlyclean: mostlyclean-quot 65 | mostlyclean-quot: 66 | rm -f *.insert-header 67 | -------------------------------------------------------------------------------- /ogg123/playlist.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2002 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __PLAYLIST_H__ 19 | #define __PLAYLIST_H__ 20 | 21 | typedef struct playlist_element_t { 22 | char *filename; 23 | struct playlist_element_t *next; 24 | } playlist_element_t; 25 | 26 | /* Actual playlist structure */ 27 | typedef struct playlist_t { 28 | 29 | /* Linked list with empty head node */ 30 | playlist_element_t *head; 31 | 32 | /* Keep track of this for speedy appends */ 33 | playlist_element_t *last; 34 | } playlist_t; 35 | 36 | playlist_t *playlist_create(); 37 | void playlist_destroy(playlist_t *list); 38 | 39 | /* All of the playlist_append_* functions return 40 | 1 if append was successful 41 | 0 if failure (either directory could not be accessed or playlist on disk 42 | could not be opened) 43 | */ 44 | 45 | 46 | /* Add this filename to the playlist. Filename will be strdup()'ed. Note 47 | that this function will never fail. */ 48 | int playlist_append_file(playlist_t *list, char *filename); 49 | 50 | /* Recursively adds files from the directory and subdirectories */ 51 | int playlist_append_directory(playlist_t *list, char *dirname); 52 | 53 | /* Opens a file containing filenames, one per line, and adds them to the 54 | playlist */ 55 | int playlist_append_from_file(playlist_t *list, char *playlist_filename); 56 | 57 | /* Return the number of items in the playlist */ 58 | int playlist_length(playlist_t *list); 59 | 60 | /* Convert the playlist to an array of strings. Strings are deep copied. 61 | Size will be set to the number of elements in the array. */ 62 | char **playlist_to_array(playlist_t *list, int *size); 63 | 64 | /* Deallocate array and all contained strings created by playlist_to_array. */ 65 | void playlist_array_destroy(char **array, int size); 66 | 67 | 68 | #endif /* __PLAYLIST_H__ */ 69 | -------------------------------------------------------------------------------- /ogg123/status.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __STATUS_H__ 19 | #define __STATUS_H__ 20 | 21 | #include 22 | #include "buffer.h" 23 | #include "transport.h" 24 | #include "format.h" 25 | 26 | typedef struct { 27 | int verbosity; 28 | char enabled; 29 | const char *formatstr; 30 | enum { 31 | stat_noarg = 0, 32 | stat_intarg, 33 | stat_stringarg, 34 | stat_floatarg, 35 | stat_doublearg 36 | } type; 37 | union { 38 | int intarg; 39 | char *stringarg; 40 | float floatarg; 41 | double doublearg; 42 | } arg; 43 | } stat_format_t; 44 | 45 | 46 | /* Status options: 47 | * stats[0] - currently playing file / stream 48 | * stats[1] - current playback time 49 | * stats[2] - remaining playback time 50 | * stats[3] - total playback time 51 | * stats[4] - instantaneous bitrate 52 | * stats[5] - average bitrate (not yet implemented) 53 | * stats[6] - input buffer fill % 54 | * stats[7] - input buffer state 55 | * stats[8] - output buffer fill % 56 | * stats[9] - output buffer state 57 | * stats[10] - Null format string to mark end of array 58 | */ 59 | stat_format_t *stat_format_create (); 60 | void stat_format_cleanup (stat_format_t *stats); 61 | 62 | void status_init (int verbosity); 63 | void status_deinit (); 64 | void status_reset_output_lock (); 65 | void status_clear_line (); 66 | void status_print_statistics (stat_format_t *stats, 67 | buffer_stats_t *audio_statistics, 68 | data_source_stats_t *data_source_statistics, 69 | decoder_stats_t *decoder_statistics); 70 | void status_message (int verbosity, const char *fmt, ...); 71 | void vstatus_message (int verbosity, const char *fmt, va_list ap); 72 | void status_error (const char *fmt, ...); 73 | void vstatus_error (const char *fmt, va_list); 74 | 75 | #endif /* __STATUS_H__ */ 76 | -------------------------------------------------------------------------------- /share/charmaps.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * If you need to generate more maps, use makemap.c on a system 4 | * with a decent iconv. 5 | */ 6 | 7 | static const unsigned short mapping_iso_8859_2[256] = { 8 | 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 9 | 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, 10 | 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 11 | 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 12 | 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 13 | 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 14 | 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 15 | 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, 16 | 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 17 | 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 18 | 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 19 | 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, 20 | 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 21 | 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 22 | 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 23 | 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, 24 | 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 25 | 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 26 | 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 27 | 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 28 | 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, 29 | 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, 30 | 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, 31 | 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, 32 | 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, 33 | 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, 34 | 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, 35 | 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, 36 | 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, 37 | 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, 38 | 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, 39 | 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 40 | }; 41 | 42 | static struct { 43 | const char *name; 44 | const unsigned short *map; 45 | struct charset *charset; 46 | } maps[] = { 47 | { "ISO-8859-2", mapping_iso_8859_2, 0 }, 48 | { 0, 0, 0 } 49 | }; 50 | 51 | static const struct { 52 | const char *bad; 53 | const char *good; 54 | } names[] = { 55 | { "ANSI_X3.4-1968", "us-ascii" }, 56 | { 0, 0 } 57 | }; 58 | -------------------------------------------------------------------------------- /ogg123/format.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef __FORMAT_H__ 19 | #define __FORMAT_H__ 20 | 21 | #include "audio.h" 22 | #include "transport.h" 23 | #include "ogg123.h" 24 | 25 | 26 | typedef struct decoder_stats_t { 27 | double total_time; /* seconds */ 28 | double current_time; /* seconds */ 29 | long instant_bitrate; 30 | long avg_bitrate; 31 | } decoder_stats_t; 32 | 33 | 34 | /* Severity constants */ 35 | enum { ERROR, WARNING, INFO }; 36 | 37 | typedef struct decoder_callbacks_t { 38 | void (* printf_error) (void *arg, int severity, char *message, ...); 39 | void (* printf_metadata) (void *arg, int verbosity, char *message, ...); 40 | } decoder_callbacks_t; 41 | 42 | 43 | struct format_t; 44 | 45 | typedef struct decoder_t { 46 | data_source_t *source; 47 | audio_format_t request_fmt; 48 | audio_format_t actual_fmt; 49 | struct format_t *format; 50 | decoder_callbacks_t *callbacks; 51 | void *callback_arg; 52 | void *private; 53 | } decoder_t; 54 | 55 | /* whence constants */ 56 | #define DECODER_SEEK_NONE 0 57 | #define DECODER_SEEK_START 1 58 | #define DECODER_SEEK_CUR 2 59 | 60 | typedef struct format_t { 61 | char *name; 62 | 63 | int (* can_decode) (data_source_t *source); 64 | decoder_t* (* init) (data_source_t *source, ogg123_options_t *ogg123_opts, 65 | audio_format_t *audio_fmt, 66 | decoder_callbacks_t *callbacks, void *callback_arg); 67 | int (* read) (decoder_t *decoder, void *ptr, int nbytes, int *eos, 68 | audio_format_t *audio_fmt); 69 | int (* seek) (decoder_t *decoder, double offset, int whence); 70 | decoder_stats_t* (* statistics) (decoder_t *decoder); 71 | void (* cleanup) (decoder_t *decoder); 72 | } format_t; 73 | 74 | format_t *get_format_by_name (char *name); 75 | format_t *select_format (data_source_t *source); 76 | 77 | decoder_stats_t *malloc_decoder_stats (decoder_stats_t *to_copy); 78 | 79 | #endif /* __FORMAT_H__ */ 80 | -------------------------------------------------------------------------------- /win32/VS2005/vorbis-tools.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 9.00 2 | # Visual Studio 2005 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggdec", "oggdec\oggdec.vcproj", "{D01454C5-2C94-45E1-917C-1C5CBC6990A0}" 4 | EndProject 5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggenc", "oggenc\oggenc.vcproj", "{10DA267E-7738-4E7E-9C31-9D0DF49A0B96}" 6 | EndProject 7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ogginfo", "ogginfo\ogginfo.vcproj", "{D60948A2-4781-435B-9609-786C0B564DBD}" 8 | EndProject 9 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vorbiscomment", "vorbiscomment\vorbiscomment.vcproj", "{851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}" 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcut", "vcut\vcut.vcproj", "{A3942B3E-65AE-477D-BE75-00DC7CAC7D3B}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Win32 = Debug|Win32 16 | Release|Win32 = Release|Win32 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Debug|Win32.ActiveCfg = Debug|Win32 20 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Debug|Win32.Build.0 = Debug|Win32 21 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Release|Win32.ActiveCfg = Release|Win32 22 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Release|Win32.Build.0 = Release|Win32 23 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Debug|Win32.ActiveCfg = Debug|Win32 24 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Debug|Win32.Build.0 = Debug|Win32 25 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Release|Win32.ActiveCfg = Release|Win32 26 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Release|Win32.Build.0 = Release|Win32 27 | {D60948A2-4781-435B-9609-786C0B564DBD}.Debug|Win32.ActiveCfg = Debug|Win32 28 | {D60948A2-4781-435B-9609-786C0B564DBD}.Debug|Win32.Build.0 = Debug|Win32 29 | {D60948A2-4781-435B-9609-786C0B564DBD}.Release|Win32.ActiveCfg = Release|Win32 30 | {D60948A2-4781-435B-9609-786C0B564DBD}.Release|Win32.Build.0 = Release|Win32 31 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Debug|Win32.ActiveCfg = Debug|Win32 32 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Debug|Win32.Build.0 = Debug|Win32 33 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Release|Win32.ActiveCfg = Release|Win32 34 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Release|Win32.Build.0 = Release|Win32 35 | {A3942B3E-65AE-477D-BE75-00DC7CAC7D3B}.Debug|Win32.ActiveCfg = Debug|Win32 36 | {A3942B3E-65AE-477D-BE75-00DC7CAC7D3B}.Debug|Win32.Build.0 = Debug|Win32 37 | {A3942B3E-65AE-477D-BE75-00DC7CAC7D3B}.Release|Win32.ActiveCfg = Release|Win32 38 | {A3942B3E-65AE-477D-BE75-00DC7CAC7D3B}.Release|Win32.Build.0 = Release|Win32 39 | EndGlobalSection 40 | GlobalSection(SolutionProperties) = preSolution 41 | HideSolutionNode = FALSE 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /win32/tools.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "oggdec"=".\oggdec.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "oggenc"=".\oggenc.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "oggenc_dynamic"=".\oggenc_dynamic.dsp" - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Project: "ogginfo"=".\ogginfo.dsp" - Package Owner=<4> 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<4> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | Project: "tools"=".\tools.dsp" - Package Owner=<4> 55 | 56 | Package=<5> 57 | {{{ 58 | }}} 59 | 60 | Package=<4> 61 | {{{ 62 | Begin Project Dependency 63 | Project_Dep_Name oggenc 64 | End Project Dependency 65 | Begin Project Dependency 66 | Project_Dep_Name oggenc_dynamic 67 | End Project Dependency 68 | Begin Project Dependency 69 | Project_Dep_Name ogginfo 70 | End Project Dependency 71 | Begin Project Dependency 72 | Project_Dep_Name vcut 73 | End Project Dependency 74 | Begin Project Dependency 75 | Project_Dep_Name vorbiscomment 76 | End Project Dependency 77 | Begin Project Dependency 78 | Project_Dep_Name oggdec 79 | End Project Dependency 80 | }}} 81 | 82 | ############################################################################### 83 | 84 | Project: "vcut"=".\vcut.dsp" - Package Owner=<4> 85 | 86 | Package=<5> 87 | {{{ 88 | }}} 89 | 90 | Package=<4> 91 | {{{ 92 | }}} 93 | 94 | ############################################################################### 95 | 96 | Project: "vorbiscomment"=".\vorbiscomment.dsp" - Package Owner=<4> 97 | 98 | Package=<5> 99 | {{{ 100 | }}} 101 | 102 | Package=<4> 103 | {{{ 104 | }}} 105 | 106 | ############################################################################### 107 | 108 | Global: 109 | 110 | Package=<5> 111 | {{{ 112 | }}} 113 | 114 | Package=<3> 115 | {{{ 116 | }}} 117 | 118 | ############################################################################### 119 | 120 | -------------------------------------------------------------------------------- /vcut/vcut.h: -------------------------------------------------------------------------------- 1 | #ifndef __VCUT_H 2 | #define __VCUT_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | typedef struct { 9 | int length; 10 | unsigned char *packet; 11 | } vcut_packet; 12 | 13 | /* this structure stores data associated with a single input stream; it will be 14 | cleared between streams if the input file has multiple chained streams */ 15 | typedef struct { 16 | ogg_stream_state stream_in; 17 | vorbis_dsp_state vd; 18 | vorbis_block vb; 19 | vorbis_info vi; 20 | vorbis_comment vc; 21 | int prevW; 22 | 23 | /* granulepos is -1 before any packets are seen, and 0 after the first 24 | packet; otherwise it's the GP of the last sample seen */ 25 | ogg_int64_t granulepos; 26 | 27 | /* the granulepos of the first sample (>= 0, since samples with a negative 28 | GP are discarded); always 0 for files produced by oggenc or vcut, but 29 | may be > 0 for data recorded from a stream (for example) */ 30 | ogg_int64_t initial_granpos; 31 | 32 | /* the number of samples already cut from this stream (all 33 | granule positions */ 34 | ogg_int64_t samples_cut; 35 | 36 | unsigned int serial; 37 | vcut_packet headers[3]; 38 | vcut_packet last_packet; 39 | } vcut_vorbis_stream; 40 | 41 | typedef struct vcut_segment { 42 | double cuttime; /* number of seconds at which to cut; 43 | -1 if cutting by sample number */ 44 | ogg_int64_t cutpoint; /* sample number at which to cut */ 45 | char *filename; /* name of the file to contain data after the CP */ 46 | struct vcut_segment *next; /* data for next cut, or NULL */ 47 | } vcut_segment; 48 | 49 | typedef struct { 50 | /* pointer to a linked list of segments/cutpoints */ 51 | vcut_segment *next_segment; 52 | 53 | /* the input file may have multiple chained streams; these variables store 54 | the number of samples and seconds that passed before the beginning of 55 | the current stream */ 56 | ogg_int64_t prevstream_samples; /* # of samples in prev. streams */ 57 | double prevstream_time; /* # of seconds past before this stream */ 58 | 59 | FILE *in; 60 | ogg_sync_state sync_in; 61 | int input_corrupt; /* 1 if we've complained about corruption */ 62 | int vorbis_init; /* 1 if vorbis_stream initialized */ 63 | vcut_vorbis_stream vorbis_stream; 64 | 65 | FILE *out; 66 | char *output_filename; 67 | int drop_output; /* 1 if we don't want any output */ 68 | int output_stream_open; /* 1 if stream_out initialized */ 69 | ogg_stream_state stream_out; 70 | unsigned int serial_out; /* serial # for the next output stream */ 71 | } vcut_state; 72 | 73 | int vcut_process(vcut_state *state); 74 | void vcut_clear(vcut_state *state); 75 | void vcut_vorbis_clear(vcut_vorbis_stream *state); 76 | int write_packet(vcut_state *s, ogg_packet *packet); 77 | 78 | #endif /* __VCUT_H */ 79 | -------------------------------------------------------------------------------- /m4/size_max.m4: -------------------------------------------------------------------------------- 1 | # size_max.m4 serial 6 2 | dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([gl_SIZE_MAX], 10 | [ 11 | AC_CHECK_HEADERS(stdint.h) 12 | dnl First test whether the system already has SIZE_MAX. 13 | AC_MSG_CHECKING([for SIZE_MAX]) 14 | AC_CACHE_VAL([gl_cv_size_max], [ 15 | gl_cv_size_max= 16 | AC_EGREP_CPP([Found it], [ 17 | #include 18 | #if HAVE_STDINT_H 19 | #include 20 | #endif 21 | #ifdef SIZE_MAX 22 | Found it 23 | #endif 24 | ], gl_cv_size_max=yes) 25 | if test -z "$gl_cv_size_max"; then 26 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider 27 | dnl than the type 'unsigned long'. Try hard to find a definition that can 28 | dnl be used in a preprocessor #if, i.e. doesn't contain a cast. 29 | AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1], 30 | [#include 31 | #include ], size_t_bits_minus_1=) 32 | AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], 33 | [#include ], fits_in_uint=) 34 | if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then 35 | if test $fits_in_uint = 1; then 36 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type 37 | dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. 38 | AC_TRY_COMPILE([#include 39 | extern size_t foo; 40 | extern unsigned long foo; 41 | ], [], fits_in_uint=0) 42 | fi 43 | dnl We cannot use 'expr' to simplify this expression, because 'expr' 44 | dnl works only with 'long' integers in the host environment, while we 45 | dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. 46 | if test $fits_in_uint = 1; then 47 | gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" 48 | else 49 | gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" 50 | fi 51 | else 52 | dnl Shouldn't happen, but who knows... 53 | gl_cv_size_max='((size_t)~(size_t)0)' 54 | fi 55 | fi 56 | ]) 57 | AC_MSG_RESULT([$gl_cv_size_max]) 58 | if test "$gl_cv_size_max" != yes; then 59 | AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max], 60 | [Define as the maximum value of type 'size_t', if the system doesn't define it.]) 61 | fi 62 | ]) 63 | 64 | dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in. 65 | dnl Remove this when we can assume autoconf >= 2.61. 66 | m4_ifdef([AC_COMPUTE_INT], [], [ 67 | AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) 68 | ]) 69 | -------------------------------------------------------------------------------- /oggenc/skeleton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * skeleton.h 3 | * author: Tahseen Mohammad 4 | */ 5 | 6 | #ifndef _SKELETON_H 7 | #define _SKELETON_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #include 14 | 15 | #define SKELETON_VERSION_MAJOR 3 16 | #define SKELETON_VERSION_MINOR 0 17 | #define FISHEAD_IDENTIFIER "fishead\0" 18 | #define FISBONE_IDENTIFIER "fisbone\0" 19 | #define FISHEAD_SIZE 64 20 | #define FISBONE_SIZE 52 21 | #define FISBONE_MESSAGE_HEADER_OFFSET 44 22 | 23 | /* fishead_packet holds a fishead header packet. */ 24 | typedef struct { 25 | /* Start time of the presentation. 26 | * For a new stream presentationtime & basetime is same. */ 27 | ogg_int64_t ptime_n; /* presentation time numerator */ 28 | ogg_int64_t ptime_d; /* presentation time denominator */ 29 | ogg_int64_t btime_n; /* basetime numerator */ 30 | ogg_int64_t btime_d; /* basetime denominator */ 31 | /* will holds the time of origin of the stream, a 20 bit field. */ 32 | unsigned char UTC[20]; 33 | } fishead_packet; 34 | 35 | /* fisbone_packet holds a fisbone header packet. */ 36 | typedef struct { 37 | ogg_uint32_t serial_no; /* serial no of the corresponding stream */ 38 | ogg_uint32_t nr_header_packet; /* number of header packets */ 39 | /* granule rate is the temporal resolution of the logical bitstream */ 40 | ogg_int64_t granule_rate_n; /* granule rate numerator */ 41 | ogg_int64_t granule_rate_d; /* granule rate denominator */ 42 | ogg_int64_t start_granule; /* start granule value */ 43 | ogg_uint32_t preroll; /* preroll */ 44 | unsigned char granule_shift; /* 1 byte value holding the granule shift */ 45 | char *message_header_fields; /* holds all the message header fields */ 46 | /* current total size of the message header fields, for realloc purpose, initially zero */ 47 | ogg_uint32_t current_header_size; 48 | } fisbone_packet; 49 | 50 | extern int add_message_header_field(fisbone_packet *fp, char *header_key, char *header_value); 51 | /* remember to deallocate the returned ogg_packet properly */ 52 | extern int ogg_from_fishead(fishead_packet *fp,ogg_packet *op); 53 | extern int ogg_from_fisbone(fisbone_packet *fp,ogg_packet *op); 54 | extern int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp); 55 | extern int add_fisbone_to_stream(ogg_stream_state *os, fisbone_packet *fp); 56 | extern int add_eos_packet_to_stream(ogg_stream_state *os); 57 | extern int flush_ogg_stream_to_file(ogg_stream_state *os, FILE *out); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* _SKELETON_H */ 64 | -------------------------------------------------------------------------------- /win32/VS2013/vorbis-tools.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2013 for Windows Desktop 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggdec", "oggdec\oggdec.vcxproj", "{2DD91F3C-A896-4617-95EF-A4F9851A63D0}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggenc", "oggenc\oggenc.vcxproj", "{9E916E26-E132-46AA-9641-FD51299D27B8}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ogginfo", "ogginfo\ogginfo.vcxproj", "{9C0C0612-E137-4ECE-9A96-653144A83DE3}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcut", "vcut\vcut.vcxproj", "{34081E57-70BB-4037-BEEE-081CD969D006}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vorbiscomment", "vorbiscomment\vorbiscomment.vcxproj", "{5892F129-6F0B-4A81-BCC5-81D7CD7403BA}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Win32 = Debug|Win32 19 | Release|Win32 = Release|Win32 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {2DD91F3C-A896-4617-95EF-A4F9851A63D0}.Debug|Win32.ActiveCfg = Debug|Win32 23 | {2DD91F3C-A896-4617-95EF-A4F9851A63D0}.Debug|Win32.Build.0 = Debug|Win32 24 | {2DD91F3C-A896-4617-95EF-A4F9851A63D0}.Release|Win32.ActiveCfg = Release|Win32 25 | {2DD91F3C-A896-4617-95EF-A4F9851A63D0}.Release|Win32.Build.0 = Release|Win32 26 | {9E916E26-E132-46AA-9641-FD51299D27B8}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {9E916E26-E132-46AA-9641-FD51299D27B8}.Debug|Win32.Build.0 = Debug|Win32 28 | {9E916E26-E132-46AA-9641-FD51299D27B8}.Release|Win32.ActiveCfg = Release|Win32 29 | {9E916E26-E132-46AA-9641-FD51299D27B8}.Release|Win32.Build.0 = Release|Win32 30 | {9C0C0612-E137-4ECE-9A96-653144A83DE3}.Debug|Win32.ActiveCfg = Debug|Win32 31 | {9C0C0612-E137-4ECE-9A96-653144A83DE3}.Debug|Win32.Build.0 = Debug|Win32 32 | {9C0C0612-E137-4ECE-9A96-653144A83DE3}.Release|Win32.ActiveCfg = Release|Win32 33 | {9C0C0612-E137-4ECE-9A96-653144A83DE3}.Release|Win32.Build.0 = Release|Win32 34 | {34081E57-70BB-4037-BEEE-081CD969D006}.Debug|Win32.ActiveCfg = Debug|Win32 35 | {34081E57-70BB-4037-BEEE-081CD969D006}.Debug|Win32.Build.0 = Debug|Win32 36 | {34081E57-70BB-4037-BEEE-081CD969D006}.Release|Win32.ActiveCfg = Release|Win32 37 | {34081E57-70BB-4037-BEEE-081CD969D006}.Release|Win32.Build.0 = Release|Win32 38 | {5892F129-6F0B-4A81-BCC5-81D7CD7403BA}.Debug|Win32.ActiveCfg = Debug|Win32 39 | {5892F129-6F0B-4A81-BCC5-81D7CD7403BA}.Debug|Win32.Build.0 = Debug|Win32 40 | {5892F129-6F0B-4A81-BCC5-81D7CD7403BA}.Release|Win32.ActiveCfg = Release|Win32 41 | {5892F129-6F0B-4A81-BCC5-81D7CD7403BA}.Release|Win32.Build.0 = Release|Win32 42 | EndGlobalSection 43 | GlobalSection(SolutionProperties) = preSolution 44 | HideSolutionNode = FALSE 45 | EndGlobalSection 46 | EndGlobal 47 | -------------------------------------------------------------------------------- /share/charset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Edmund Grimley Evans 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #include 20 | 21 | /* 22 | * These functions are like the C library's mbtowc() and wctomb(), 23 | * but instead of depending on the locale they always work in UTF-8, 24 | * and they use int instead of wchar_t. 25 | */ 26 | 27 | int utf8_mbtowc(int *pwc, const char *s, size_t n); 28 | int utf8_wctomb(char *s, int wc); 29 | 30 | /* 31 | * This is an object-oriented version of mbtowc() and wctomb(). 32 | * The caller first uses charset_find() to get a pointer to struct 33 | * charset, then uses the mbtowc() and wctomb() methods on it. 34 | * The function charset_max() gives the maximum length of a 35 | * multibyte character in that encoding. 36 | * This API is only appropriate for stateless encodings like UTF-8 37 | * or ISO-8859-3, but I have no intention of implementing anything 38 | * other than UTF-8 and 8-bit encodings. 39 | * 40 | * MINOR BUG: If there is no memory charset_find() may return 0 and 41 | * there is no way to distinguish this case from an unknown encoding. 42 | */ 43 | 44 | struct charset; 45 | 46 | struct charset *charset_find(const char *code); 47 | 48 | int charset_mbtowc(struct charset *charset, int *pwc, const char *s, size_t n); 49 | int charset_wctomb(struct charset *charset, char *s, int wc); 50 | int charset_max(struct charset *charset); 51 | 52 | /* 53 | * Function to convert a buffer from one encoding to another. 54 | * Invalid bytes are replaced by '#', and characters that are 55 | * not available in the target encoding are replaced by '?'. 56 | * Each of TO and TOLEN may be zero if the result is not wanted. 57 | * The input or output may contain null bytes, but the output 58 | * buffer is also null-terminated, so it is all right to 59 | * use charset_convert(fromcode, tocode, s, strlen(s), &t, 0). 60 | * 61 | * Return value: 62 | * 63 | * -2 : memory allocation failed 64 | * -1 : unknown encoding 65 | * 0 : data was converted exactly 66 | * 1 : valid data was converted approximately (using '?') 67 | * 2 : input was invalid (but still converted, using '#') 68 | */ 69 | 70 | int charset_convert(const char *fromcode, const char *tocode, 71 | const char *from, size_t fromlen, 72 | char **to, size_t *tolen); 73 | -------------------------------------------------------------------------------- /win32/VS2013/oggenc/oggenc.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | Header Files 67 | 68 | 69 | Header Files 70 | 71 | 72 | Header Files 73 | 74 | 75 | -------------------------------------------------------------------------------- /win32/VS2003/vorbis-tools.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vorbiscomment", "vorbiscomment\vorbiscomment.vcproj", "{851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggdec", "oggdec\oggdec.vcproj", "{D01454C5-2C94-45E1-917C-1C5CBC6990A0}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | EndProjectSection 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oggenc", "oggenc\oggenc.vcproj", "{10DA267E-7738-4E7E-9C31-9D0DF49A0B96}" 11 | ProjectSection(ProjectDependencies) = postProject 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ogginfo", "ogginfo\ogginfo.vcproj", "{D60948A2-4781-435B-9609-786C0B564DBD}" 15 | ProjectSection(ProjectDependencies) = postProject 16 | EndProjectSection 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vcut", "vcut\vcut.vcproj", "{7691D0F6-A15F-4F9C-B529-9A9224CEFA48}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | EndProjectSection 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfiguration) = preSolution 24 | Debug = Debug 25 | Release = Release 26 | EndGlobalSection 27 | GlobalSection(ProjectConfiguration) = postSolution 28 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Debug.ActiveCfg = Debug|Win32 29 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Debug.Build.0 = Debug|Win32 30 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Release.ActiveCfg = Release|Win32 31 | {851A5E6A-C2D8-44C4-A7AC-A5F7E2001FA9}.Release.Build.0 = Release|Win32 32 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Debug.ActiveCfg = Debug|Win32 33 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Debug.Build.0 = Debug|Win32 34 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Release.ActiveCfg = Release|Win32 35 | {D01454C5-2C94-45E1-917C-1C5CBC6990A0}.Release.Build.0 = Release|Win32 36 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Debug.ActiveCfg = Debug|Win32 37 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Debug.Build.0 = Debug|Win32 38 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Release.ActiveCfg = Release|Win32 39 | {10DA267E-7738-4E7E-9C31-9D0DF49A0B96}.Release.Build.0 = Release|Win32 40 | {D60948A2-4781-435B-9609-786C0B564DBD}.Debug.ActiveCfg = Debug|Win32 41 | {D60948A2-4781-435B-9609-786C0B564DBD}.Debug.Build.0 = Debug|Win32 42 | {D60948A2-4781-435B-9609-786C0B564DBD}.Release.ActiveCfg = Release|Win32 43 | {D60948A2-4781-435B-9609-786C0B564DBD}.Release.Build.0 = Release|Win32 44 | {7691D0F6-A15F-4F9C-B529-9A9224CEFA48}.Debug.ActiveCfg = Debug|Win32 45 | {7691D0F6-A15F-4F9C-B529-9A9224CEFA48}.Debug.Build.0 = Debug|Win32 46 | {7691D0F6-A15F-4F9C-B529-9A9224CEFA48}.Release.ActiveCfg = Release|Win32 47 | {7691D0F6-A15F-4F9C-B529-9A9224CEFA48}.Release.Build.0 = Release|Win32 48 | EndGlobalSection 49 | GlobalSection(ExtensibilityGlobals) = postSolution 50 | EndGlobalSection 51 | GlobalSection(ExtensibilityAddIns) = postSolution 52 | EndGlobalSection 53 | EndGlobal 54 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | WHAT'S HERE: 2 | 3 | This source distribution includes the vorbis-tools and nothing else. 4 | The audio codec libraries for use with Ogg bitstreams are contained in 5 | other modules: vorbis, speex and flac. 6 | 7 | 8 | DIRECTORIES: 9 | 10 | debian/ debian packaging stuff 11 | include/ header files shared between the tools 12 | intl/ GNU gettext library from gettext-0.10.40 (for i18n support) 13 | ogg123/ an ogg vorbis command line audio player 14 | oggenc/ the ogg vorbis encoder 15 | oggdec/ a simple, portable command line decoder (to wav and raw) 16 | ogginfo/ provides information (tags, bitrate, length, etc.) about 17 | an ogg vorbis file 18 | po/ translations for non-English languages 19 | share/ code shared between the tools 20 | vcut/ cuts an ogg vorbis file into two parts at a particular point 21 | vorbiscomment/ edits the comments in an ogg vorbis file 22 | win32/ Win32 build stuff 23 | 24 | 25 | DEPENDENCIES: 26 | 27 | All of the tools require libogg and libvorbis to be installed (along 28 | with the header files). Additionally, ogg123 requires libao, libcurl, 29 | and a POSIX-compatible thread library. Ogg123 can optionally compiled 30 | to use libFLAC, and libspeex. Oggenc can be optionally compiled with 31 | libFLAC, and libkate. The libraries libogg, libvorbis, and libao are 32 | all available at 33 | https://xiph.org/vorbis/ 34 | 35 | The libcurl library is packaged with most Linux distributions. The 36 | source code can also be downloaded from: 37 | http://curl.haxx.se/libcurl/ 38 | 39 | FLAC is available at: 40 | https://xiph.org/flac/ 41 | 42 | Speex is available at: 43 | https://www.speex.org/ 44 | 45 | libkate is available at: 46 | http://libkate.googlecode.com/ 47 | 48 | 49 | CONTACT: 50 | 51 | The Ogg Vorbis homepage is located at 'https://xiph.org/vorbis/'. Up to 52 | date technical documents, contact information, source code and 53 | pre-built utilities may be found there. 54 | 55 | Developer information is available from http://www.xiph.org/. Check 56 | there for bug reporting information, mailing lists and other resources. 57 | 58 | 59 | BUILDING FROM SUBVERSION (see the file HACKING for details): 60 | 61 | ./autogen.sh 62 | make 63 | 64 | and as root if desired : 65 | 66 | make install 67 | 68 | This will install the tools into /usr/local/bin and manpages into 69 | /usr/local/man. 70 | 71 | 72 | BUILDING FROM TARBALL DISTRIBUTIONS: 73 | 74 | ./configure 75 | make 76 | 77 | and as root if desired : 78 | 79 | make install 80 | 81 | BUILDING RPMS: 82 | 83 | RPMs may be built by: 84 | 85 | after autogen.sh or configure 86 | 87 | make dist 88 | rpm -ta vorbis-tools-.tar.gz 89 | 90 | 91 | KNOWN BUGS: 92 | 93 | #1321 94 | First noticed in non-English versions of the application, ogg123 has a major 95 | bug when it comes to status messages in the shell: any output bigger than 96 | the console's width will break and start spamming that message infinitely 97 | until the console is resized. 98 | 99 | Different attempts to fix this bug have ended up causing bigger problems, 100 | leading to the conclusion that it simply can't be fixed without a large 101 | re-write of the application, which will not happen any time soon. If you 102 | come across this issue, please augment your terminal window size. 103 | -------------------------------------------------------------------------------- /oggdec/oggdec.1: -------------------------------------------------------------------------------- 1 | .TH "oggdec" "1" "2008 September 9" "Xiph.Org Foundation" "Vorbis Tools" 2 | 3 | .SH "NAME" 4 | oggdec - simple decoder, Ogg Vorbis file to PCM audio file (Wave or RAW). 5 | 6 | .SH "SYNOPSIS" 7 | .B oggdec 8 | [ 9 | .B -Qhv 10 | ] [ 11 | .B -b bits_per_sample 12 | ] [ 13 | .B -e endianness 14 | ] [ 15 | .B -R 16 | ] [ 17 | .B -s signedness 18 | ] [ 19 | .B -o outputfile 20 | ] 21 | .B file ... 22 | 23 | .SH "DESCRIPTION" 24 | 25 | .B oggdec 26 | decodes Ogg Vorbis files into PCM-encoded ("uncompressed") audio files, either Wave or RAW format. 27 | 28 | For each input file, 29 | .B oggdec 30 | writes to a filename based on the input filename, but with the extension changed to ".wav" or ".raw" as appropriate. 31 | 32 | If the input file is specified as 33 | .B "-" 34 | , then 35 | .B oggdec 36 | will read from stdin, and write to stdout unless an output filename is specified. Likewise, an output filename of 37 | .B - 38 | will cause output to be to stdout. 39 | 40 | Writing Wave format to stdout is a bad idea. Wave requires a seekable medium for the header to be rewritten after all the data is written out; stdout is not seekable. 41 | 42 | .SH "OPTIONS" 43 | .IP "-Q, --quiet" 44 | Suppresses program output. 45 | .IP "-h, --help" 46 | Print help message. 47 | .IP "-V, --version" 48 | Display version information. 49 | .IP "-b n, --bits=n" 50 | Bits per sample. Valid values are 8 or 16. 51 | .IP "-e n, --endian=n" 52 | Set endianness for 16-bit output. 0 (default) is little-endian (Intel byte order). 1 is big-endian (sane byte order). 53 | .IP "-R, --raw" 54 | Output in raw format. If not specified, writes Wave file (RIFF headers). 55 | .IP "-s n, --sign=n" 56 | Set signedness for output. 0 for unsigned, 1 (default) for signed. 57 | .IP "-o filename, --output=filename" 58 | Write output to specified filename. This option is only valid if one input [file] is specified, or if raw mode is used. 59 | 60 | .SH "EXAMPLES" 61 | Decode a file 62 | .B enabler.ogg 63 | to 64 | .B enabler.wav 65 | as little-endian signed 16-bit (default options): 66 | .RS 67 | oggdec enabler.ogg 68 | .RE 69 | 70 | Decode a file 71 | .B enabler.ogg 72 | to 73 | .B enabler.raw 74 | as headerless little-endian signed 16-bit: 75 | .RS 76 | oggdec --raw enabler.ogg 77 | .RE 78 | 79 | Decode 80 | .B enabler.ogg 81 | to 82 | .B enabler.crazymonkey 83 | as unsigned 8-bit: 84 | .RS 85 | oggdec -b 8 -s 0 -o enabler.crazymonkey enabler.ogg 86 | .RE 87 | 88 | Decode 89 | .B enabler.ogg 90 | to 91 | .B enabler.raw 92 | as big-endian signed 16-bit (any of the following): 93 | .RS 94 | oggdec -R -e 1 -b 16 enabler.ogg 95 | .RE 96 | .RS 97 | oggdec -R -e 1 -b 16 -o enabler.raw - < enabler.ogg 98 | .RE 99 | .RS 100 | oggdec -R -e 1 -b 16 - < enabler.ogg > enabler.raw 101 | .RE 102 | 103 | Mass decoding (foo.ogg to foo.wav, bar.ogg to bar.wav, quux.ogg to quux.wav, etc.): 104 | .RS 105 | oggdec *.ogg 106 | .RE 107 | 108 | .SH "AUTHORS" 109 | .SS "Program Authors" 110 | Michael Smith 111 | .SS "Manpage Authors" 112 | 113 | .br 114 | 115 | Frederick Lee , assisted by a few million monkeys armed with keyboards in irc://irc.openprojects.net/#vorbis 116 | 117 | .SH "SEE ALSO" 118 | 119 | .PP 120 | \fBogg123\fR(1), \fBoggenc\fR(1), \fBvorbiscomment\fR(1), \fBflac\fR(1), \fBspeexdec\fR(1) 121 | -------------------------------------------------------------------------------- /m4/progtest.m4: -------------------------------------------------------------------------------- 1 | # progtest.m4 2 | # serial 10 (gettext-0.23) 3 | dnl Copyright (C) 1996-2003, 2005, 2008-2024 Free Software Foundation, Inc. 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | dnl 8 | dnl This file can be used in projects which are not available under 9 | dnl the GNU General Public License or the GNU Lesser General Public 10 | dnl License but which still want to provide support for the GNU gettext 11 | dnl functionality. 12 | dnl Please note that the actual code of the GNU gettext library is covered 13 | dnl by the GNU Lesser General Public License, and the rest of the GNU 14 | dnl gettext package is covered by the GNU General Public License. 15 | dnl They are *not* in the public domain. 16 | 17 | dnl Authors: 18 | dnl Ulrich Drepper , 1996. 19 | 20 | AC_PREREQ([2.53]) 21 | 22 | # Search path for a program which passes the given test. 23 | 24 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, 25 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) 26 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], 27 | [ 28 | # Prepare PATH_SEPARATOR. 29 | # The user is always right. 30 | if test "${PATH_SEPARATOR+set}" != set; then 31 | # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which 32 | # contains only /bin. Note that ksh looks also at the FPATH variable, 33 | # so we have to set that as well for the test. 34 | PATH_SEPARATOR=: 35 | (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ 36 | && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ 37 | || PATH_SEPARATOR=';' 38 | } 39 | fi 40 | 41 | # Find out how to test for executable files. Don't use a zero-byte file, 42 | # as systems may use methods other than mode bits to determine executability. 43 | cat >conf$$.file <<_ASEOF 44 | #! /bin/sh 45 | exit 0 46 | _ASEOF 47 | chmod +x conf$$.file 48 | if test -x conf$$.file >/dev/null 2>&1; then 49 | ac_executable_p="test -x" 50 | else 51 | ac_executable_p="test -f" 52 | fi 53 | rm -f conf$$.file 54 | 55 | # Extract the first word of "$2", so it can be a program name with args. 56 | set dummy $2; ac_word=[$]2 57 | AC_MSG_CHECKING([for $ac_word]) 58 | AC_CACHE_VAL([ac_cv_path_$1], 59 | [case "[$]$1" in 60 | [[\\/]]* | ?:[[\\/]]*) 61 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 62 | ;; 63 | *) 64 | gt_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR 65 | for ac_dir in m4_if([$5], , $PATH, [$5]); do 66 | IFS="$gt_saved_IFS" 67 | test -z "$ac_dir" && ac_dir=. 68 | for ac_exec_ext in '' $ac_executable_extensions; do 69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 70 | echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD 71 | if [$3]; then 72 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" 73 | break 2 74 | fi 75 | fi 76 | done 77 | done 78 | IFS="$gt_saved_IFS" 79 | dnl If no 4th arg is given, leave the cache variable unset, 80 | dnl so AC_PATH_PROGS will keep looking. 81 | m4_if([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" 82 | ])dnl 83 | ;; 84 | esac])dnl 85 | $1="$ac_cv_path_$1" 86 | if test m4_if([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 87 | AC_MSG_RESULT([$][$1]) 88 | else 89 | AC_MSG_RESULT([no]) 90 | fi 91 | AC_SUBST([$1])dnl 92 | ]) 93 | -------------------------------------------------------------------------------- /oggenc/resample.h: -------------------------------------------------------------------------------- 1 | /* This program is licensed under the GNU Library General Public License, 2 | * version 2, a copy of which is included with this program (LICENCE.LGPL). 3 | * 4 | * (c) 2002 Simon Hosie 5 | * 6 | * 7 | * A resampler 8 | * 9 | * reference: 10 | * 'Digital Filters', third edition, by R. W. Hamming ISBN 0-486-65088-X 11 | * 12 | * history: 13 | * 2002-05-31 ready for the world (or some small section thereof) 14 | * 15 | * 16 | * TOOD: 17 | * zero-crossing clipping in coefficient table 18 | */ 19 | 20 | #ifndef _RESAMPLE_H_INCLUDED 21 | #define _RESAMPLE_H_INCLUDED 22 | 23 | typedef float SAMPLE; 24 | 25 | typedef struct 26 | { 27 | unsigned int channels, infreq, outfreq, taps; 28 | float *table; 29 | SAMPLE *pool; 30 | 31 | /* dynamic bits */ 32 | int poolfill; 33 | int offset; 34 | } res_state; 35 | 36 | typedef enum 37 | { 38 | RES_END, 39 | RES_GAIN, /* (double)1.0 */ 40 | RES_CUTOFF, /* (double)0.80 */ 41 | RES_TAPS, /* (int)45 */ 42 | RES_BETA /* (double)16.0 */ 43 | } res_parameter; 44 | 45 | int res_init(res_state *state, int channels, int outfreq, int infreq, res_parameter op1, ...); 46 | /* 47 | * Configure *state to manage a data stream with the specified parameters. The 48 | * string 'params' is currently unspecified, but will configure the parameters 49 | * of the filter. 50 | * 51 | * This function allocates memory, and requires that res_clear() be called when 52 | * the buffer is no longer needed. 53 | * 54 | * 55 | * All counts/lengths used in the following functions consider only the data in 56 | * a single channel, and in numbers of samples rather than bytes, even though 57 | * functionality will be mirrored across as many channels as specified here. 58 | */ 59 | 60 | 61 | int res_push_max_input(res_state const *state, size_t maxoutput); 62 | /* 63 | * Returns the maximum number of input elements that may be provided without 64 | * risk of flooding an output buffer of size maxoutput. maxoutput is 65 | * specified in counts of elements, NOT in bytes. 66 | */ 67 | 68 | 69 | int res_push_check(res_state const *state, size_t srclen); 70 | /* 71 | * Returns the number of elements that will be returned if the given srclen 72 | * is used in the next call to res_push(). 73 | */ 74 | 75 | 76 | int res_push(res_state *state, SAMPLE **dstlist, SAMPLE const **srclist, size_t srclen); 77 | int res_push_interleaved(res_state *state, SAMPLE *dest, SAMPLE const *source, size_t srclen); 78 | /* 79 | * Pushes srclen samples into the front end of the filter, and returns the 80 | * number of resulting samples. 81 | * 82 | * res_push(): srclist and dstlist point to lists of pointers, each of which 83 | * indicates the beginning of a list of samples. 84 | * 85 | * res_push_interleaved(): source and dest point to the beginning of a list of 86 | * interleaved samples. 87 | */ 88 | 89 | 90 | int res_drain(res_state *state, SAMPLE **dstlist); 91 | int res_drain_interleaved(res_state *state, SAMPLE *dest); 92 | /* 93 | * Recover the remaining elements by flushing the internal pool with 0 values, 94 | * and storing the resulting samples. 95 | * 96 | * After either of these functions are called, *state should only re-used in a 97 | * final call to res_clear(). 98 | */ 99 | 100 | 101 | void res_clear(res_state *state); 102 | /* 103 | * Free allocated buffers, etc. 104 | */ 105 | 106 | #endif 107 | 108 | -------------------------------------------------------------------------------- /file-replace.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # parse the arguments: 4 | # file-replace [options] [--] filename[s]|dir[s] 5 | # --in-pattern="search for" 6 | # --out-pattern="replace with" 7 | # --in-pattern-file="file" 8 | # --out-pattern-file="file" 9 | # --no-recurse 10 | # --no-directories 11 | 12 | 13 | my $search; 14 | my $replace; 15 | my $argflag; 16 | my @infiles; 17 | my $norecurse; 18 | my $nodirs; 19 | my$pwd=`pwd`; 20 | chomp($pwd); 21 | 22 | foreach $arg (@ARGV){ 23 | if($arg eq "--"){ 24 | $argflag=1; 25 | next; 26 | } 27 | 28 | if(!$argflag && $arg=~/--([^=]*)=(.*)/){ 29 | my$key=$1; 30 | my$val=$2; 31 | 32 | if($key eq "in-pattern"){ 33 | $search=$val; 34 | next; 35 | } 36 | if($key eq "out-pattern"){ 37 | $replace=$val; 38 | next; 39 | } 40 | if($key eq "in-pattern-file"){ 41 | die "Could not open file $val: $!" unless open(F,"$val"); 42 | undef $/; 43 | $search=; 44 | $/="\n"; 45 | close(F); 46 | next; 47 | } 48 | if($key eq "out-pattern-file"){ 49 | die "Could not open file $val: $!" unless open(F,"$val"); 50 | undef $/; 51 | $replace=; 52 | $/="\n"; 53 | close(F); 54 | next; 55 | } 56 | 57 | print "Unknown option --$key\n"; 58 | exit(1); 59 | } 60 | 61 | 62 | if(!$argflag && $arg=~/--(.*)/){ 63 | if($key eq "no-recurse"){ 64 | $norecurse; 65 | next; 66 | } 67 | if($key eq "no-directories"){ 68 | $nodirs=1; 69 | next; 70 | } 71 | print "Unknown option --$key\n"; 72 | exit(1); 73 | } 74 | 75 | push @infiles, ($arg); 76 | } 77 | 78 | &recursive_doit($pwd,@infiles); 79 | 80 | sub recursive_doit{ 81 | my($pwd,@globlist)=@_; 82 | my @dirs; 83 | my @files; 84 | 85 | # seperate files from directories 86 | foreach $file (@globlist){ 87 | if(-d $file){ 88 | push @dirs,($file); 89 | next; 90 | } 91 | if(-f $file){ 92 | push @files,($file); 93 | next; 94 | } 95 | print "$pwd/$file is not a plain file or directory.\n"; 96 | } 97 | 98 | # Are we called on a directory? recurse? 99 | if(!$nodirs){ 100 | # fork into each dir with all but the original path ar 101 | foreach $dir (@dirs){ 102 | 103 | if(fork){ 104 | wait; # don't hose the box ;-) 105 | }else{ 106 | die "Could not chdir to $pwd/$dir: $!\n" unless chdir $dir; 107 | $pwd.="/$dir"; 108 | # open and read the dir 109 | die "Could not read directory $pwd: $!\n" unless 110 | opendir (D,"."); 111 | #ignore dotfiles 112 | @globlist=grep { /^[^\.]/ && !(-l "$_") } readdir(D); 113 | closedir(D); 114 | $nodirs=$norecurse; 115 | 116 | recursive_doit($pwd,@globlist); 117 | exit(0); 118 | } 119 | } 120 | } 121 | 122 | foreach $file (@files){ 123 | if (open(F,$file)){ 124 | undef $/; 125 | my$body=; 126 | $/="\n"; 127 | close(F); 128 | 129 | # do the regexp 130 | if($body=~s{$search}{$replace}g){ 131 | 132 | print "Performed substitution on $pwd/$file\n"; 133 | 134 | # replace with modified file 135 | my$tempfile="file-replace-tmp_$$"; 136 | die $! unless open(F,">$tempfile"); 137 | syswrite F,$body; 138 | close(F); 139 | die "Unable to replace modified file $file: $!\n" unless 140 | rename($tempfile,$file); 141 | unlink $tempfile; 142 | } 143 | 144 | }else{ 145 | print "Could not open $pwd/$file: $!\n"; 146 | } 147 | } 148 | exit(0); 149 | } 150 | -------------------------------------------------------------------------------- /po/Makevars: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | 3 | # Usually the message domain is the same as the package name. 4 | DOMAIN = $(PACKAGE) 5 | 6 | # These two variables depend on the location of this directory. 7 | subdir = po 8 | top_builddir = .. 9 | 10 | # These options get passed to xgettext. 11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 12 | 13 | # This is the copyright holder that gets inserted into the header of the 14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 15 | # package. (Note that the msgstr strings, extracted from the package's 16 | # sources, belong to the copyright holder of the package.) Translators are 17 | # expected to transfer the copyright for their translations to this person 18 | # or entity, or to disclaim their copyright. The empty string stands for 19 | # the public domain; in this case the translators are expected to disclaim 20 | # their copyright. 21 | COPYRIGHT_HOLDER = Xiph.Org Foundation 22 | 23 | # This tells whether or not to prepend "GNU " prefix to the package 24 | # name that gets inserted into the header of the $(DOMAIN).pot file. 25 | # Possible values are "yes", "no", or empty. If it is empty, try to 26 | # detect it automatically by scanning the files in $(top_srcdir) for 27 | # "GNU packagename" string. 28 | PACKAGE_GNU = no 29 | 30 | # This is the email address or URL to which the translators shall report 31 | # bugs in the untranslated strings: 32 | # - Strings which are not entire sentences, see the maintainer guidelines 33 | # in the GNU gettext documentation, section 'Preparing Strings'. 34 | # - Strings which use unclear terms or require additional context to be 35 | # understood. 36 | # - Strings which make invalid assumptions about notation of date, time or 37 | # money. 38 | # - Pluralisation problems. 39 | # - Incorrect English spelling. 40 | # - Incorrect formatting. 41 | # It can be your email address, or a mailing list address where translators 42 | # can write to without being subscribed, or the URL of a web page through 43 | # which the translators can contact you. 44 | MSGID_BUGS_ADDRESS = https://gitlab.xiph.org/xiph/vorbis-tools 45 | 46 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 47 | # message catalogs shall be used. It is usually empty. 48 | EXTRA_LOCALE_CATEGORIES = 49 | 50 | # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' 51 | # context. Possible values are "yes" and "no". Set this to yes if the 52 | # package uses functions taking also a message context, like pgettext(), or 53 | # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. 54 | USE_MSGCTXT = no 55 | 56 | # These options get passed to msgmerge. 57 | # Useful options are in particular: 58 | # --previous to keep previous msgids of translated messages, 59 | # --quiet to reduce the verbosity. 60 | MSGMERGE_OPTIONS = 61 | 62 | # These options get passed to msginit. 63 | # If you want to disable line wrapping when writing PO files, add 64 | # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and 65 | # MSGINIT_OPTIONS. 66 | MSGINIT_OPTIONS = 67 | 68 | # This tells whether or not to regenerate a PO file when $(DOMAIN).pot 69 | # has changed. Possible values are "yes" and "no". Set this to no if 70 | # the POT file is checked in the repository and the version control 71 | # program ignores timestamps. 72 | PO_DEPENDS_ON_POT = yes 73 | 74 | # This tells whether or not to forcibly update $(DOMAIN).pot and 75 | # regenerate PO files on "make dist". Possible values are "yes" and 76 | # "no". Set this to no if the POT file and PO files are maintained 77 | # externally. 78 | DIST_DEPENDS_ON_UPDATE_PO = yes 79 | -------------------------------------------------------------------------------- /share/base64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002 Michael Smith 3 | * Copyright (C) 2015-2021 Philipp Schafft 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "base64.h" 24 | 25 | static const signed char base64decode[256] = { 26 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 27 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 28 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 62, -2, -2, -2, 63, 29 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -1, -2, -2, 30 | -2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 31 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, -2, 32 | -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 33 | 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2, 34 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 35 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 36 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 37 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 38 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 39 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 40 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 41 | -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2 42 | }; 43 | 44 | 45 | int base64_decode(const char *in, void **out, size_t *len) 46 | { 47 | const unsigned char *input = (const unsigned char *)in; 48 | size_t todo = strlen(in); 49 | char *output; 50 | size_t opp = 0; // output pointer 51 | 52 | if (todo < 4 || (todo % 4) != 0) 53 | return -1; 54 | 55 | output = calloc(1, todo*3/4 + 5); 56 | if (!output) 57 | return -1; 58 | 59 | while (todo) { 60 | signed char vals[4]; 61 | size_t i; 62 | 63 | for (i = 0; i < (sizeof(vals)/sizeof(*vals)); i++) 64 | vals[i] = base64decode[*input++]; 65 | 66 | if(vals[0] < 0 || vals[1] < 0 || vals[2] < -1 || vals[3] < -1) { 67 | todo -= 4; 68 | continue; 69 | } 70 | 71 | output[opp++] = vals[0]<<2 | vals[1]>>4; 72 | 73 | /* vals[3] and (if that is) vals[2] can be '=' as padding, which is 74 | * looked up in the base64decode table as '-1'. Check for this case, 75 | * and output zero-terminators instead of characters if we've got 76 | * padding. */ 77 | if (vals[2] >= 0) { 78 | output[opp++] = ((vals[1]&0x0F)<<4) | (vals[2]>>2); 79 | } else { 80 | break; 81 | } 82 | 83 | if (vals[3] >= 0) { 84 | output[opp++] = ((vals[2]&0x03)<<6) | (vals[3]); 85 | } else { 86 | break; 87 | } 88 | 89 | todo -= 4; 90 | } 91 | output[opp++] = 0; 92 | 93 | *out = output; 94 | *len = opp - 1; 95 | 96 | return 0; 97 | } 98 | -------------------------------------------------------------------------------- /m4/intlmacosx.m4: -------------------------------------------------------------------------------- 1 | # intlmacosx.m4 2 | # serial 10 (gettext-0.23) 3 | dnl Copyright (C) 2004-2014, 2016, 2019-2024 Free Software Foundation, Inc. 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | dnl This file is offered as-is, without any warranty. 8 | dnl 9 | dnl This file can be used in projects which are not available under 10 | dnl the GNU General Public License or the GNU Lesser General Public 11 | dnl License but which still want to provide support for the GNU gettext 12 | dnl functionality. 13 | dnl Please note that the actual code of the GNU gettext library is covered 14 | dnl by the GNU Lesser General Public License, and the rest of the GNU 15 | dnl gettext package is covered by the GNU General Public License. 16 | dnl They are *not* in the public domain. 17 | 18 | dnl Checks for special options needed on Mac OS X. 19 | dnl Defines INTL_MACOSX_LIBS. 20 | AC_DEFUN([gt_INTL_MACOSX], 21 | [ 22 | dnl Check for API introduced in Mac OS X 10.4. 23 | AC_CACHE_CHECK([for CFPreferencesCopyAppValue], 24 | [gt_cv_func_CFPreferencesCopyAppValue], 25 | [gt_saved_LIBS="$LIBS" 26 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 27 | AC_LINK_IFELSE( 28 | [AC_LANG_PROGRAM( 29 | [[#include ]], 30 | [[CFPreferencesCopyAppValue(NULL, NULL)]])], 31 | [gt_cv_func_CFPreferencesCopyAppValue=yes], 32 | [gt_cv_func_CFPreferencesCopyAppValue=no]) 33 | LIBS="$gt_saved_LIBS"]) 34 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then 35 | AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], 36 | [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) 37 | fi 38 | dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent, 39 | dnl because in macOS 10.13.4 it has the following behaviour: 40 | dnl When two or more languages are specified in the 41 | dnl "System Preferences > Language & Region > Preferred Languages" panel, 42 | dnl it returns en_CC where CC is the territory (even when English is not among 43 | dnl the preferred languages!). What we want instead is what 44 | dnl CFLocaleCopyCurrent returned in earlier macOS releases and what 45 | dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the 46 | dnl first among the preferred languages and CC is the territory. 47 | AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages], 48 | [gt_saved_LIBS="$LIBS" 49 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 50 | AC_LINK_IFELSE( 51 | [AC_LANG_PROGRAM( 52 | [[#include ]], 53 | [[CFLocaleCopyPreferredLanguages();]])], 54 | [gt_cv_func_CFLocaleCopyPreferredLanguages=yes], 55 | [gt_cv_func_CFLocaleCopyPreferredLanguages=no]) 56 | LIBS="$gt_saved_LIBS"]) 57 | if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then 58 | AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1], 59 | [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.]) 60 | fi 61 | INTL_MACOSX_LIBS= 62 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ 63 | || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then 64 | dnl Starting with macOS version 14, CoreFoundation relies on CoreServices, 65 | dnl and we have to link it in explicitly, otherwise an exception 66 | dnl NSInvalidArgumentException "unrecognized selector sent to instance" 67 | dnl occurs. 68 | INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,CoreServices" 69 | fi 70 | AC_SUBST([INTL_MACOSX_LIBS]) 71 | ]) 72 | -------------------------------------------------------------------------------- /po/Makevars.template: -------------------------------------------------------------------------------- 1 | # Makefile variables for PO directory in any package using GNU gettext. 2 | # 3 | # Copyright (C) 2003-2019 Free Software Foundation, Inc. 4 | # This file is free software; the Free Software Foundation gives 5 | # unlimited permission to use, copy, distribute, and modify it. 6 | 7 | # Usually the message domain is the same as the package name. 8 | DOMAIN = $(PACKAGE) 9 | 10 | # These two variables depend on the location of this directory. 11 | subdir = po 12 | top_builddir = .. 13 | 14 | # These options get passed to xgettext. 15 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 16 | 17 | # This is the copyright holder that gets inserted into the header of the 18 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 19 | # package. (Note that the msgstr strings, extracted from the package's 20 | # sources, belong to the copyright holder of the package.) Translators are 21 | # expected to transfer the copyright for their translations to this person 22 | # or entity, or to disclaim their copyright. The empty string stands for 23 | # the public domain; in this case the translators are expected to disclaim 24 | # their copyright. 25 | COPYRIGHT_HOLDER = Free Software Foundation, Inc. 26 | 27 | # This tells whether or not to prepend "GNU " prefix to the package 28 | # name that gets inserted into the header of the $(DOMAIN).pot file. 29 | # Possible values are "yes", "no", or empty. If it is empty, try to 30 | # detect it automatically by scanning the files in $(top_srcdir) for 31 | # "GNU packagename" string. 32 | PACKAGE_GNU = 33 | 34 | # This is the email address or URL to which the translators shall report 35 | # bugs in the untranslated strings: 36 | # - Strings which are not entire sentences, see the maintainer guidelines 37 | # in the GNU gettext documentation, section 'Preparing Strings'. 38 | # - Strings which use unclear terms or require additional context to be 39 | # understood. 40 | # - Strings which make invalid assumptions about notation of date, time or 41 | # money. 42 | # - Pluralisation problems. 43 | # - Incorrect English spelling. 44 | # - Incorrect formatting. 45 | # It can be your email address, or a mailing list address where translators 46 | # can write to without being subscribed, or the URL of a web page through 47 | # which the translators can contact you. 48 | MSGID_BUGS_ADDRESS = 49 | 50 | # This is the list of locale categories, beyond LC_MESSAGES, for which the 51 | # message catalogs shall be used. It is usually empty. 52 | EXTRA_LOCALE_CATEGORIES = 53 | 54 | # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' 55 | # context. Possible values are "yes" and "no". Set this to yes if the 56 | # package uses functions taking also a message context, like pgettext(), or 57 | # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. 58 | USE_MSGCTXT = no 59 | 60 | # These options get passed to msgmerge. 61 | # Useful options are in particular: 62 | # --previous to keep previous msgids of translated messages, 63 | # --quiet to reduce the verbosity. 64 | MSGMERGE_OPTIONS = 65 | 66 | # These options get passed to msginit. 67 | # If you want to disable line wrapping when writing PO files, add 68 | # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and 69 | # MSGINIT_OPTIONS. 70 | MSGINIT_OPTIONS = 71 | 72 | # This tells whether or not to regenerate a PO file when $(DOMAIN).pot 73 | # has changed. Possible values are "yes" and "no". Set this to no if 74 | # the POT file is checked in the repository and the version control 75 | # program ignores timestamps. 76 | PO_DEPENDS_ON_POT = yes 77 | 78 | # This tells whether or not to forcibly update $(DOMAIN).pot and 79 | # regenerate PO files on "make dist". Possible values are "yes" and 80 | # "no". Set this to no if the POT file and PO files are maintained 81 | # externally. 82 | DIST_DEPENDS_ON_UPDATE_PO = yes 83 | -------------------------------------------------------------------------------- /ogg123/audio.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * 5 | * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * 6 | * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 * 9 | * by Stan Seibert AND OTHER CONTRIBUTORS * 10 | * http://www.xiph.org/ * 11 | * * 12 | ******************************************************************** 13 | 14 | last mod: $Id$ 15 | 16 | ********************************************************************/ 17 | 18 | #ifdef HAVE_CONFIG_H 19 | #include 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "audio.h" 27 | 28 | 29 | int audio_format_equal (audio_format_t *a, audio_format_t *b) 30 | { 31 | return 32 | a->big_endian == b->big_endian && 33 | a->word_size == b->word_size && 34 | a->signed_sample == b->signed_sample && 35 | a->rate == b->rate && 36 | a->channels == b->channels && 37 | ((a->matrix==NULL && b->matrix==NULL) || 38 | !strcmp(a->matrix,b->matrix)); 39 | } 40 | 41 | audio_device_t *append_audio_device(audio_device_t *devices_list, 42 | int driver_id, 43 | ao_option *options, char *filename) 44 | { 45 | if (devices_list != NULL) { 46 | while (devices_list->next_device != NULL) 47 | devices_list = devices_list->next_device; 48 | devices_list = devices_list->next_device = 49 | malloc(sizeof(audio_device_t)); 50 | } else { 51 | devices_list = (audio_device_t *) malloc(sizeof(audio_device_t)); 52 | } 53 | devices_list->driver_id = driver_id; 54 | devices_list->options = options; 55 | devices_list->filename = filename; 56 | devices_list->device = NULL; 57 | devices_list->next_device = NULL; 58 | 59 | return devices_list; 60 | } 61 | 62 | 63 | int audio_devices_write(audio_device_t *d, void *ptr, int nbytes) 64 | { 65 | 66 | while (d != NULL) { 67 | if (ao_play(d->device, ptr, nbytes) == 0) 68 | return 0; /* error occurred */ 69 | d = d->next_device; 70 | } 71 | 72 | return 1; 73 | } 74 | 75 | int add_ao_option(ao_option **op_h, const char *optstring) 76 | { 77 | char *key, *value; 78 | int result; 79 | 80 | key = strdup(optstring); 81 | if (key == NULL) 82 | return 0; 83 | 84 | value = strchr(key, ':'); 85 | if (value) { 86 | /* split by replacing the separator with a null */ 87 | *value++ = '\0'; 88 | } 89 | 90 | result = ao_append_option(op_h, key, value); 91 | free(key); 92 | 93 | return (result); 94 | } 95 | 96 | void close_audio_devices (audio_device_t *devices) 97 | { 98 | audio_device_t *current = devices; 99 | 100 | while (current != NULL) { 101 | if (current->device) 102 | ao_close(current->device); 103 | current->device = NULL; 104 | current = current->next_device; 105 | } 106 | } 107 | 108 | void free_audio_devices (audio_device_t *devices) 109 | { 110 | audio_device_t *current; 111 | 112 | while (devices != NULL) { 113 | current = devices->next_device; 114 | ao_free_options(devices->options); 115 | free (devices); 116 | devices = current; 117 | } 118 | } 119 | 120 | void ao_onexit (void *arg) 121 | { 122 | audio_device_t *devices = (audio_device_t *) arg; 123 | 124 | close_audio_devices (devices); 125 | free_audio_devices (devices); 126 | 127 | ao_shutdown(); 128 | } 129 | -------------------------------------------------------------------------------- /vorbiscomment/vorbiscomment.1: -------------------------------------------------------------------------------- 1 | .\" Process this file with 2 | .\" groff -man -Tascii vorbiscomment.1 3 | .\" 4 | .TH VORBISCOMMENT 1 "December 30, 2008" "Xiph.Org Foundation" "Ogg Vorbis Tools" 5 | 6 | .SH NAME 7 | vorbiscomment \- List or edit comments in Ogg Vorbis files 8 | 9 | .SH SYNOPSIS 10 | .B vorbiscomment 11 | .B [-l] 12 | .RB [ -R ] 13 | .RB [ -e ] 14 | .I file.ogg 15 | .br 16 | .B vorbiscomment 17 | .B -a 18 | .B [ -c commentfile | -t \*(lqname=value\*(rq | -d \*(lqname=value\*(rq ] 19 | .RB [ -q ] 20 | .RB [ -R ] 21 | .RB [ -e ] 22 | .I in.ogg 23 | .I [out.ogg] 24 | .br 25 | .B vorbiscomment 26 | .B -w 27 | .B [ -c commentfile | -t \*(lqname=value\*(rq ] 28 | .RB [ -q ] 29 | .RB [ -R ] 30 | .RB [ -e ] 31 | .I in.ogg 32 | .I [out.ogg] 33 | 34 | .SH DESCRIPTION 35 | .B vorbiscomment 36 | Reads, modifies, and appends Ogg Vorbis audio file metadata tags. 37 | 38 | .SH OPTIONS 39 | .IP "-a, --append" 40 | Updates comments. 41 | .IP "-c file, --commentfile file" 42 | Take comments from a file. The file is the same format as is output by the the -l option or given to the -t option: one element per line in 'tag=value' format. If the file is /dev/null and -w was passed, the existing comments will be removed. 43 | .IP "-h, --help" 44 | Show command help. 45 | .IP "-l, --list" 46 | List the comments in the Ogg Vorbis file. 47 | .IP "-q, --quiet" 48 | Quiet mode. No messages are displayed. 49 | .IP "-t 'name=value', --tag 'name=value'" 50 | Specify a new tag on the command line. Each tag is given as a single string. The part before the '=' is treated as the tag name and the part after as the value. 51 | .IP "-d 'name[=value]', --rm 'name[=value]'" 52 | Specify a tag on the command line for removal. Each tag is given as a single string. The part before the '=' is treated as the tag name and the part after as the value. If no value is given all tags are deleted with the given name. Otherwise only those with matching values are deleted. 53 | .IP "-w, --write" 54 | Replace comments with the new set given either on the command line with -t or from a file with -c. If neither -c nor -t is given, the new set will be read from the standard input. 55 | .IP "-R, --raw" 56 | Read and write comments in UTF-8, rather than converting to the user's character set. 57 | .IP "-e, --escapes" 58 | Quote/unquote newlines and backslashes in the comments. This ensures every comment is exactly one line in the output (or input), allowing to filter and round-trip them. Without it, you can only write multi-line comments by using -t and you can't reliably distinguish them from multiple one-line comments. 59 | 60 | Supported escapes are c-style "\en", "\er", "\e\e" and "\e0". A backslash followed by anything else is an error. 61 | 62 | Note: currently, anything after the first "\e0" is thrown away while writing. This is a bug -- the Vorbis format can safely store null characters, but most other tools wouldn't handle them anyway. 63 | .IP "-V, --version" 64 | Display the version of vorbiscomment. 65 | 66 | .\" Examples go here 67 | .SH EXAMPLES 68 | 69 | To just see what comment tags are in a file: 70 | 71 | vorbiscomment -l file.ogg 72 | 73 | To edit those comments: 74 | 75 | vorbiscomment -l file.ogg > file.txt 76 | [edit the comments in file.txt to your satisfaction] 77 | vorbiscomment -w -c file.txt file.ogg newfile.ogg 78 | 79 | To simply add a comment: 80 | 81 | vorbiscomment -a -t 'ARTIST=No One You Know' file.ogg newfile.ogg 82 | 83 | To add a set of comments from the standard input: 84 | 85 | vorbiscomment -a file.ogg 86 | ARTIST=No One You Know 87 | ALBUM=The Famous Album 88 | 89 | 90 | .SH TAG FORMAT 91 | 92 | See https://xiph.org/vorbis/doc/v-comment.html for documentation on the Ogg Vorbis tag format, including a suggested list of canonical tag names. 93 | 94 | .SH AUTHORS 95 | 96 | .TP 97 | Program Authors: 98 | .br 99 | Michael Smith 100 | .br 101 | Ralph Giles 102 | .br 103 | 104 | .TP 105 | Manpage Author: 106 | .br 107 | Christopher L Cheney 108 | 109 | .SH "SEE ALSO" 110 | 111 | .PP 112 | \fBoggenc\fR(1), \fBoggdec\fR(1), \fBogg123\fR(1), \fBogginfo\fR(1) 113 | -------------------------------------------------------------------------------- /oggenc/encode.h: -------------------------------------------------------------------------------- 1 | #ifndef __ENCODE_H 2 | #define __ENCODE_H 3 | 4 | #include 5 | #include 6 | 7 | typedef void TIMER; 8 | typedef long (*audio_read_func)(void *src, float **buffer, int samples); 9 | typedef void (*progress_func)(char *fn, long totalsamples, 10 | long samples, double time); 11 | typedef void (*enc_end_func)(char *fn, double time, int rate, 12 | long samples, long bytes); 13 | typedef void (*enc_start_func)(char *fn, char *outfn, int bitrate, 14 | float quality, int qset, int managed, int min_br, int max_br); 15 | typedef void (*error_func)(char *errormessage); 16 | 17 | 18 | void *timer_start(void); 19 | double timer_time(void *); 20 | void timer_clear(void *); 21 | int create_directories(char *, int); 22 | 23 | void update_statistics_full(char *fn, long total, long done, double time); 24 | void update_statistics_notime(char *fn, long total, long done, double time); 25 | void update_statistics_null(char *fn, long total, long done, double time); 26 | void start_encode_full(char *fn, char *outfn, int bitrate, float quality, int qset, 27 | int managed, int min, int max); 28 | void start_encode_null(char *fn, char *outfn, int bitrate, float quality, int qset, 29 | int managed, int min, int max); 30 | void final_statistics(char *fn, double time, int rate, long total_samples, 31 | long bytes); 32 | void final_statistics_null(char *fn, double time, int rate, long total_samples, 33 | long bytes); 34 | void encode_error(char *errmsg); 35 | 36 | typedef struct { 37 | char *arg; 38 | char *val; 39 | } adv_opt; 40 | 41 | typedef struct 42 | { 43 | char **title; 44 | int title_count; 45 | char **artist; 46 | int artist_count; 47 | char **album; 48 | int album_count; 49 | char **comments; 50 | int comment_count; 51 | char **tracknum; 52 | int track_count; 53 | char **dates; 54 | int date_count; 55 | char **genre; 56 | int genre_count; 57 | char **lyrics; 58 | int lyrics_count; 59 | char **lyrics_language; 60 | int lyrics_language_count; 61 | adv_opt *advopt; 62 | int advopt_count; 63 | 64 | int copy_comments; 65 | int with_skeleton; 66 | int quiet; 67 | int rawmode; 68 | 69 | int raw_samplesize; 70 | int raw_samplerate; 71 | int raw_channels; 72 | int raw_endianness; 73 | 74 | char *namefmt; 75 | char *namefmt_remove; 76 | char *namefmt_replace; 77 | 78 | char *outfile; 79 | 80 | /* All 3 in kbps */ 81 | int managed; 82 | int min_bitrate; 83 | int nominal_bitrate; 84 | int max_bitrate; 85 | 86 | /* Float from 0 to 1 (low->high) */ 87 | float quality; 88 | int quality_set; 89 | 90 | int resamplefreq; 91 | int downmix; 92 | float scale; 93 | 94 | unsigned int serial; 95 | unsigned int skeleton_serial; 96 | unsigned int kate_serial; 97 | int fixedserial; 98 | int ignorelength; 99 | 100 | int isutf8; 101 | } oe_options; 102 | 103 | typedef struct 104 | { 105 | vorbis_comment *comments; 106 | unsigned int serialno; 107 | unsigned int skeleton_serialno; 108 | unsigned int kate_serialno; 109 | 110 | audio_read_func read_samples; 111 | progress_func progress_update; 112 | enc_end_func end_encode; 113 | enc_start_func start_encode; 114 | error_func error; 115 | 116 | void *readdata; 117 | 118 | long total_samples_per_channel; 119 | int channels; 120 | long rate; 121 | int samplesize; 122 | int endianness; 123 | int resamplefreq; 124 | int copy_comments; 125 | int with_skeleton; 126 | 127 | /* Various bitrate/quality options */ 128 | int managed; 129 | int bitrate; 130 | int min_bitrate; 131 | int max_bitrate; 132 | float quality; 133 | int quality_set; 134 | adv_opt *advopt; 135 | int advopt_count; 136 | 137 | FILE *out; 138 | char *filename; 139 | char *infilename; 140 | int ignorelength; 141 | 142 | char *lyrics; 143 | char *lyrics_language; 144 | } oe_enc_opt; 145 | 146 | 147 | int oe_encode(oe_enc_opt *opt); 148 | 149 | #endif /* __ENCODE_H */ 150 | -------------------------------------------------------------------------------- /share/charsetmap.h: -------------------------------------------------------------------------------- 1 | /* This file was automatically generated by make_code_map.pl 2 | please don't edit directly 3 | Daniel Resare 4 | */ 5 | charset_map maps[] = { 6 | {"ISO-8859-1", 7 | { 8 | 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 9 | 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 10 | 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, 11 | 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, 12 | 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, 13 | 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, 14 | 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, 15 | 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, 16 | 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, 17 | 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, 18 | 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, 19 | 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, 20 | 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, 21 | 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, 22 | 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, 23 | 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, 24 | 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, 25 | 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, 26 | 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, 27 | 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, 28 | 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, 29 | 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, 30 | 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, 31 | 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, 32 | 0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, 33 | 0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, 34 | 0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, 35 | 0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, 36 | 0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, 37 | 0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, 38 | 0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, 39 | 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF 40 | } 41 | }, 42 | {"ISO-8859-2", 43 | { 44 | 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 45 | 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 46 | 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, 47 | 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, 48 | 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, 49 | 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, 50 | 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, 51 | 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, 52 | 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, 53 | 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, 54 | 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, 55 | 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, 56 | 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, 57 | 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, 58 | 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, 59 | 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, 60 | 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, 61 | 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, 62 | 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, 63 | 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, 64 | 0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, 65 | 0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, 66 | 0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, 67 | 0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, 68 | 0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, 69 | 0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, 70 | 0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, 71 | 0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, 72 | 0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, 73 | 0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, 74 | 0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, 75 | 0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 76 | } 77 | }, 78 | {NULL} 79 | }; 80 | -------------------------------------------------------------------------------- /ogg123/vgfilter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * vgfilter.c (c) 2007,2008 William Poetra Yoga Hadisoeseno 3 | * based on: 4 | * vgplay.c 1.0 (c) 2003 John Morton 5 | */ 6 | 7 | /* vgplay.c 1.0 (c) 2003 John Morton 8 | * 9 | * Portions of this file are (C) COPYRIGHT 1994-2002 by 10 | * the XIPHOPHORUS Company http://www.xiph.org/ 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions 14 | * are met: 15 | * 16 | * - Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in the 21 | * documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * - Neither the name of the Xiph.org Foundation nor the names of its 25 | * contributors may be used to endorse or promote products derived 26 | * from this software without specific prior written permission. 27 | * 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 35 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 36 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 38 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 39 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 40 | * OF THE POSSIBILITY OF SUCH DAMAGE. 41 | * 42 | ********************************************************************** 43 | * 44 | * vgfilter - a filter for ov_read_filter to enable replay gain. 45 | * 46 | */ 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | #include 55 | #include 56 | 57 | #include "vgfilter.h" 58 | 59 | /* 60 | * Initialize the replaygain parameters from vorbis comments. 61 | */ 62 | void vg_init(vgain_state *vg, vorbis_comment *vc) { 63 | float track_gain_db = 0.00, track_peak = 1.00; 64 | char *tag = NULL; 65 | 66 | if (vc) { 67 | if ((tag = vorbis_comment_query(vc, "replaygain_album_gain", 0)) 68 | || (tag = vorbis_comment_query(vc, "rg_audiophile", 0))) 69 | track_gain_db = atof(tag); 70 | else if ((tag = vorbis_comment_query(vc, "replaygain_track_gain", 0)) 71 | || (tag = vorbis_comment_query(vc, "rg_radio", 0))) 72 | track_gain_db = atof(tag); 73 | 74 | if ((tag = vorbis_comment_query(vc, "replaygain_album_peak", 0)) 75 | || (tag = vorbis_comment_query(vc, "replaygain_track_peak", 0)) 76 | || (tag = vorbis_comment_query(vc, "rg_peak", 0))) 77 | track_peak = atof(tag); 78 | } 79 | 80 | vg->scale_factor = pow(10.0, (track_gain_db + VG_PREAMP_DB)/20); 81 | vg->max_scale = 1.0 / track_peak; 82 | } 83 | 84 | 85 | /* 86 | * This is the filter function for the decoded Ogg Vorbis stream. 87 | */ 88 | void vg_filter(float **pcm, long channels, long samples, void *filter_param) 89 | { 90 | int i, j; 91 | float cur_sample; 92 | vgain_state *param = filter_param; 93 | float scale_factor = param->scale_factor; 94 | float max_scale = param->max_scale; 95 | 96 | /* Apply the gain, and any limiting necessary */ 97 | if (scale_factor > max_scale) { 98 | for(i = 0; i < channels; i++) 99 | for(j = 0; j < samples; j++) { 100 | cur_sample = pcm[i][j] * scale_factor; 101 | /* This is essentially the scaled hard-limiting algorithm */ 102 | /* It looks like the soft-knee to me */ 103 | /* I haven't found a better limiting algorithm yet... */ 104 | if (cur_sample < -0.5) 105 | cur_sample = tanh((cur_sample + 0.5) / (1-0.5)) * (1-0.5) - 0.5; 106 | else if (cur_sample > 0.5) 107 | cur_sample = tanh((cur_sample - 0.5) / (1-0.5)) * (1-0.5) + 0.5; 108 | pcm[i][j] = cur_sample; 109 | } 110 | } else if (scale_factor > 0.0) { 111 | for(i = 0; i < channels; i++) 112 | for(j = 0; j < samples; j++) 113 | pcm[i][j] *= scale_factor; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /m4/longlong.m4: -------------------------------------------------------------------------------- 1 | # longlong.m4 serial 13 2 | dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_LONG_LONG_INT if 'long long int' works. 10 | # This fixes a bug in Autoconf 2.61, but can be removed once we 11 | # assume 2.62 everywhere. 12 | 13 | # Note: If the type 'long long int' exists but is only 32 bits large 14 | # (as on some very old compilers), HAVE_LONG_LONG_INT will not be 15 | # defined. In this case you can treat 'long long int' like 'long int'. 16 | 17 | AC_DEFUN([AC_TYPE_LONG_LONG_INT], 18 | [ 19 | AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], 20 | [AC_LINK_IFELSE( 21 | [_AC_TYPE_LONG_LONG_SNIPPET], 22 | [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. 23 | dnl If cross compiling, assume the bug isn't important, since 24 | dnl nobody cross compiles for this platform as far as we know. 25 | AC_RUN_IFELSE( 26 | [AC_LANG_PROGRAM( 27 | [[@%:@include 28 | @%:@ifndef LLONG_MAX 29 | @%:@ define HALF \ 30 | (1LL << (sizeof (long long int) * CHAR_BIT - 2)) 31 | @%:@ define LLONG_MAX (HALF - 1 + HALF) 32 | @%:@endif]], 33 | [[long long int n = 1; 34 | int i; 35 | for (i = 0; ; i++) 36 | { 37 | long long int m = n << i; 38 | if (m >> i != n) 39 | return 1; 40 | if (LLONG_MAX / 2 < m) 41 | break; 42 | } 43 | return 0;]])], 44 | [ac_cv_type_long_long_int=yes], 45 | [ac_cv_type_long_long_int=no], 46 | [ac_cv_type_long_long_int=yes])], 47 | [ac_cv_type_long_long_int=no])]) 48 | if test $ac_cv_type_long_long_int = yes; then 49 | AC_DEFINE([HAVE_LONG_LONG_INT], 1, 50 | [Define to 1 if the system has the type `long long int'.]) 51 | fi 52 | ]) 53 | 54 | # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. 55 | # This fixes a bug in Autoconf 2.61, but can be removed once we 56 | # assume 2.62 everywhere. 57 | 58 | # Note: If the type 'unsigned long long int' exists but is only 32 bits 59 | # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT 60 | # will not be defined. In this case you can treat 'unsigned long long int' 61 | # like 'unsigned long int'. 62 | 63 | AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], 64 | [ 65 | AC_CACHE_CHECK([for unsigned long long int], 66 | [ac_cv_type_unsigned_long_long_int], 67 | [AC_LINK_IFELSE( 68 | [_AC_TYPE_LONG_LONG_SNIPPET], 69 | [ac_cv_type_unsigned_long_long_int=yes], 70 | [ac_cv_type_unsigned_long_long_int=no])]) 71 | if test $ac_cv_type_unsigned_long_long_int = yes; then 72 | AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, 73 | [Define to 1 if the system has the type `unsigned long long int'.]) 74 | fi 75 | ]) 76 | 77 | # Expands to a C program that can be used to test for simultaneous support 78 | # of 'long long' and 'unsigned long long'. We don't want to say that 79 | # 'long long' is available if 'unsigned long long' is not, or vice versa, 80 | # because too many programs rely on the symmetry between signed and unsigned 81 | # integer types (excluding 'bool'). 82 | AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], 83 | [ 84 | AC_LANG_PROGRAM( 85 | [[/* Test preprocessor. */ 86 | #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) 87 | error in preprocessor; 88 | #endif 89 | #if ! (18446744073709551615ULL <= -1ull) 90 | error in preprocessor; 91 | #endif 92 | /* Test literals. */ 93 | long long int ll = 9223372036854775807ll; 94 | long long int nll = -9223372036854775807LL; 95 | unsigned long long int ull = 18446744073709551615ULL; 96 | /* Test constant expressions. */ 97 | typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) 98 | ? 1 : -1)]; 99 | typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 100 | ? 1 : -1)]; 101 | int i = 63;]], 102 | [[/* Test availability of runtime routines for shift and division. */ 103 | long long int llmax = 9223372036854775807ll; 104 | unsigned long long int ullmax = 18446744073709551615ull; 105 | return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) 106 | | (llmax / ll) | (llmax % ll) 107 | | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) 108 | | (ullmax / ull) | (ullmax % ull));]]) 109 | ]) 110 | --------------------------------------------------------------------------------