string: Rename para_malloc() -> alloc(). Just because it's shorter and matches the naming of the new allocators we are about to introduce. The bulk of this patch was created with sed -i 's/para_malloc/alloc/g' *.c *.h yy/mp.y
afh: Constify definition of audio format handlers. The audio_format_handler structure contains only pointers, and the ->init method of each instance initializes these pointers to constant values. The ->init() method is thus useless at best, and it prevents the structures from being declared constant. This patch removes ->init() of struct audio_format_handler and the public afh_init() which iterates over all audio formats to call each ->init() method. The audio format handlers are modified to define an instance of the structure rather than an init function which fills the fields of the given structure. The structure can be declared constant, but not static because afh_common.c needs a way to refer to it. We rely on weak symbols to deal with audio format handlers which are not compiled in. The codec-independent code in afh_common.c defines a weak instance of the audio_format_handler structure for each audio format. The command handlers which are compiled in override the weak symbol with their own definition. The afh receiver used to define afh_init() as its (receiver!) init function, which no longer exists. Since receiver init functions are optional, we don't need to supply a replacement. However, play.c calls ->init() of the afh_receiver unconditionally. This call needs to be removed to avoid a null pointer dereference.
Shorten copyright notice. The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
opus_afh: Use custom header API to strip comment packet. Currently we define the header of an ogg/opus file as the first two ogg pages. This is problematic for two reasons: (a) the metadata packet (ogg packet #2) may be arbitrary large and should not be sent over the network as it is not needed for decoding the audio stream, and (b) the second ogg page may contain, in addition to the metadata packet, opus encoded audio packets which should not be part of the header. This patch employs the recently added custom header API to avoid both problems in the same way the ogg/vorbis audio format handler does: we create a custom header which contains the unmodified ID header packet and a dummy metadata packet.
Prefix public functions of ogg_afh_common.c with "oac". This way it is clear that these are not functions provided by libogg. Pure rename. no real changes.
Fix signedness issues in format strings. Compiling with -Wformat-signedness (not enabled so far) causes many warnings because of format strings which specify an unsigned type but correspond to an argument of signed type, or vice versa. This commit fixes all these mismatches. For "%u", "%d", "%lu", "%ld" we let the format string match the type of the argument, but for "%x" we need to cast the argument to a suitable unsigned type. After this patch the tree compiles cleanly with -Wformat-signedness given. The warning will be enabled in a subsequent commit.
afh: Make ->suffixes array const. Not only the individual strings are constant, but also the array itself.
opus_afh.c: Trivial whitespace fix. Just an overlong line.
The ogg/opus tagger. This adds support for modifying meta tags of ogg/opus files. The heart of this patch is ogg_rewrite_tags(), a codec-independent function which replaces the meta packet of an ogg stream. This function will also be used in subsequent patches which add support for ogg/vorbis and ogg/speex files. In order to create identically sized ogg pages for the output, the new ogg_rewrite_tags() function calls ogg_stream_flush_fill() if it is available. This function was introduced in libogg version 1.3.0. So this commit adds a configure check and makes ogg_rewrite_tags() fall back to ogg_stream_flush() on systems where libogg lacks ogg_stream_flush_fill().
Update year in copyright headers. Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
doc: Change email address to maan@tuebingen.mpg.de The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
Change copyright year to 2014. This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
The opus audio format handler. This fills the dummy files opus_afh.c and opus_common.c which were introduced in the previous commit with content. One function, opus_parse_header(), will also be needed by the decoder to be introduced in the next commit. So this function belongs to opus_common.c and must be public.
ogg/opus: Infrastructure. This adds tests for libopus to configure.ac and minimal (non-working) implementations of the ogg/opus decoder and audio format handler.