mpg123-1.32.4

This commit is contained in:
Ozkan Sezer
2024-01-10 20:40:40 +03:00
parent 530d2f6056
commit a06847ca33
142 changed files with 1370 additions and 1487 deletions

View File

@@ -58,25 +58,25 @@ endif
src_tests_volume_SOURCES = \
src/tests/volume.c
src_tests_volume_LDADD = \
src/libsyn123/libsyn123.la
$(LIBSYN123)
src_tests_decode_fixed_SOURCES = \
src/tests/decode_fixed.c
src_tests_decode_fixed_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la
$(LIBMPG123)
src_tests_seek_whence_SOURCES = \
src/tests/seek_whence.c
src_tests_seek_whence_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la
$(LIBMPG123)
src_tests_seek_accuracy_SOURCES = \
src/tests/seek_accuracy.c
src_tests_seek_accuracy_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la
$(LIBMPG123)
src_tests_noise_SOURCES = \
src/tests/noise.c \
@@ -89,20 +89,20 @@ src_tests_sweeper_SOURCES = \
src/tests/sweeper.c
src_tests_sweeper_LDADD = \
src/compat/libcompat.la \
src/libsyn123/libsyn123.la \
src/libout123/libout123.la
$(LIBSYN123) \
$(LIBOUT123)
src_tests_resample_total_SOURCES = \
src/tests/resample_total.c
src_tests_resample_total_LDADD = \
src/libsyn123/libsyn123.la
$(LIBSYN123)
src_tests_text_SOURCES = \
src/tests/text.c \
src/tests/testtext.h
src_tests_text_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la
$(LIBMPG123)
src_tests_textprint_SOURCES =\
src/tests/textprint.c \
@@ -111,10 +111,10 @@ src_tests_textprint_SOURCES =\
src_tests_textprint_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la
$(LIBMPG123)
src_tests_plain_id3_SOURCES = \
src/tests/plain_id3.c
src_tests_plain_id3_LDADD = \
src/compat/libcompat.la \
src/libmpg123/libmpg123.la
$(LIBMPG123)

View File

@@ -1,6 +1,6 @@
#include "compat.h"
#include "../compat/compat.h"
#include <mpg123.h>
#include "debug.h"
#include "../common/debug.h"
int work(mpg123_handle *mh, int ch, int enc)

View File

@@ -1,7 +1,7 @@
#include "config.h"
#include "compat.h"
#include "dither.h"
#include "debug.h"
#include "../compat/compat.h"
#include "../libmpg123/dither.h"
#include "../common/debug.h"
/* Directly include the code for testing, avoiding
build of same object with and without libtool. */

View File

@@ -1,8 +1,8 @@
/* Just printing out ID3 tags with plain data from libmpg123 and explicitly called conversion routine. */
#include "compat.h"
#include "../compat/compat.h"
#include <mpg123.h>
#include "debug.h"
#include "../common/debug.h"
int test_whence(const char* path, int scan_before)
{
@@ -29,7 +29,7 @@ int test_whence(const char* path, int scan_before)
mpg123_close(mh);
mpg123_delete(mh);
fprintf(stdout, "length %"OFF_P" vs. pos %"OFF_P"\n", length, pos);
fprintf(stdout, "length %" PRIiMAX " vs. pos %" PRIiMAX "\n", (intmax_t)length, (intmax_t)pos);
return (pos == length) ? 0 : -1;
}

View File

@@ -1,7 +1,7 @@
/*
seek-accuracy: Take some given mpeg file and validate that seeks are indeed accurate.
copyright 2009-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
copyright 2009-2023 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <fcntl.h>
#include "mpg123.h"
#include "compat.h"
#include "../compat/compat.h"
#define SAMPLES 187
/* Cannot use the const value as fixed array size:-( */
@@ -82,11 +82,11 @@ int main(int argc, char **argv)
else fprintf(stderr, "Some failure occured! Unable to test properly!");
fprintf(stderr,"\n");
fprintf(stderr,"1to1 indexed seek errors: %"SIZE_P" / %"SIZE_P"\n", (size_p)errs[0],(size_p)samples);
fprintf(stderr,"1to1 non-indexed seek errors: %"SIZE_P" / %"SIZE_P"\n", (size_p)errs[1],(size_p)samples);
fprintf(stderr,"NtoM indexed seek errors: %"SIZE_P" / %"SIZE_P"\n", (size_p)errs_ntom[0],(size_p)samples);
fprintf(stderr,"NtoM non-indexed seek errors: %"SIZE_P" / %"SIZE_P"\n", (size_p)errs_ntom[1],(size_p)samples);
fprintf(stderr,"Errors in getting first sample again: %"SIZE_P"\n", (size_p)first_sample_errs);
fprintf(stderr,"1to1 indexed seek errors: %zu / %zu\n", errs[0], samples);
fprintf(stderr,"1to1 non-indexed seek errors: %zu / %zu\n", errs[1], samples);
fprintf(stderr,"NtoM indexed seek errors: %zu / %zu\n", errs_ntom[0], samples);
fprintf(stderr,"NtoM non-indexed seek errors: %zu / %zu\n", errs_ntom[1], samples);
fprintf(stderr,"Errors in getting first sample again: %zu\n", first_sample_errs);
fprintf(stderr,"\n");
if(ret == 0)
@@ -163,7 +163,7 @@ int collect(struct seeko *so)
size_t posi = 0;
mpg123_scan(m);
length = mpg123_length(m);
fprintf(stderr,"Estimated length: %"OFF_P"\n", (off_p)length);
fprintf(stderr,"Estimated length: %" PRIiMAX "\n", (intmax_t)length);
/* Compute the interesting positions */
fix_positions(so, length);
/*
@@ -180,7 +180,7 @@ int collect(struct seeko *so)
while(so->position[posi] < pos_count+buffsamples)
{
size_t i = (so->position[posi]-pos_count)*channels;
fprintf(stderr,"got sample %"SIZE_P" (%"OFF_P")\n", (size_p)posi, (off_p)so->position[posi]);
fprintf(stderr,"got sample %zu (%" PRIiMAX ")\n", posi, (intmax_t)so->position[posi]);
so->left[posi] = buff[i];
if(channels == 2)
so->right[posi] = buff[i+1];
@@ -212,7 +212,7 @@ int check_sample(struct seeko *so, size_t i)
if(mpg123_seek(m, so->position[i], SEEK_SET) != so->position[i])
{
fprintf(stderr,"Error seeking to %"OFF_P": %s\n", (off_p)so->position[i], mpg123_strerror(m));
fprintf(stderr,"Error seeking to %" PRIiMAX ": %s\n", (intmax_t)so->position[i], mpg123_strerror(m));
return -1;
}
@@ -220,17 +220,17 @@ int check_sample(struct seeko *so, size_t i)
||
got/sizeof(short) != channels )
{
fprintf(stderr,"Error occured on reading sample %"SIZE_P"! (%s)\n", (size_p)i, mpg123_strerror(m));
fprintf(stderr,"Error occured on reading sample %zu! (%s)\n", i, mpg123_strerror(m));
return -1;
}
if(same(buf[0], so->left[i]) && (channels == 1 || same(buf[1], so->right[i])))
{
fprintf(stderr,"sample %"SIZE_P" PASS\n", (size_p)i);
fprintf(stderr,"sample %zu PASS\n", i);
}
else
{
if(channels == 1) fprintf(stderr,"sample %"SIZE_P" FAIL (%i != %i)\n", (size_p)i, buf[0], so->left[i]);
else fprintf(stderr,"sample %"SIZE_P" FAIL (%i != %i || %i != %i)\n", (size_p)i, buf[0], so->left[i], buf[1], so->right[i]);
if(channels == 1) fprintf(stderr,"sample %zu FAIL (%i != %i)\n", i, buf[0], so->left[i]);
else fprintf(stderr,"sample %zu FAIL (%i != %i || %i != %i)\n", i, buf[0], so->left[i], buf[1], so->right[i]);
return -1;
}
return 0;

View File

@@ -1,6 +1,6 @@
#include "compat.h"
#include "../compat/compat.h"
#include <mpg123.h>
#include "debug.h"
#include "../common/debug.h"
int test_whence(const char* path, int scan_before)
{
@@ -27,7 +27,7 @@ int test_whence(const char* path, int scan_before)
mpg123_close(mh);
mpg123_delete(mh);
fprintf(stdout, "length %"OFF_P" vs. pos %"OFF_P"\n", length, pos);
fprintf(stdout, "length %" PRIiMAX " vs. pos %" PRIiMAX "\n", (intmax_t)length, (intmax_t)pos);
return (pos == length) ? 0 : -1;
}

View File

@@ -2,7 +2,7 @@
#include <syn123.h>
#include <out123.h>
#include "compat.h"
#include "../compat/compat.h"
static long block_rate(long rate, double speed, double factor, off_t bi)
{
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
while(bi < out_limit)
{
long outrate = block_rate(rate, speed, factor, bi);
fprintf(stderr, "block %"OFF_P" rate %ld\n", (off_p)bi, outrate);
fprintf(stderr, "block %" PRIiMAX " rate %ld\n", (intmax_t)bi, outrate);
if(syn123_setup_resample(syn, rate, outrate, 1, 0, smooth))
{
ret = -11;
@@ -123,10 +123,10 @@ int main(int argc, char **argv)
}
intotal += inblock;
outtotal += outblock;
//fprintf( stderr, "ratio: %f %"OFF_P":%"OFF_P" to %"OFF_P":%"OFF_P"\n"
//, (double)intotal/outtotal, (off_p)intotal
//, (off_p)syn123_resample_intotal(rate, outrate, outtotal)
//, (off_p)outtotal, (off_p)syn123_resample_total(rate, outrate, intotal) );
//fprintf( stderr, "ratio: %f %" PRIiMAX ":%" PRIiMAX " to %" PRIiMAX ":%" PRIiMAX "\n"
//, (double)intotal/outtotal, (intmax_t)intotal
//, (intmax_t)syn123_resample_intotal(rate, outrate, outtotal)
//, (intmax_t)outtotal, (intmax_t)syn123_resample_total(rate, outrate, intotal) );
syn123_amp(outbuf, MPG123_ENC_FLOAT_32, outsamples, syn123_db2lin(-12), 0, NULL, NULL);
if(out123_play(out, outbuf, sizeof(float)*outsamples) != sizeof(float)*outsamples)
{

View File

@@ -1,7 +1,7 @@
/*
text: Test text transformations in libmpg123 (conversion to UTF-8).
copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1
copyright 2009-2023 by the mpg123 project - free software under the terms of the LGPL 2.1
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Thomas Orgis
@@ -9,7 +9,7 @@
*/
#include <mpg123.h>
#include <compat.h>
#include "../compat/compat.h"
#include "testtext.h"
@@ -52,7 +52,7 @@ int check_string(const char* name, enum mpg123_text_encoding enc, const unsigned
}
else
{
printf("FAIL (%"SIZE_P" vs. %"SIZE_P")\n", (size_p)sb.fill, (size_p)sizeof(utf8));
printf("FAIL (%zu vs. %zu)\n", sb.fill, sizeof(utf8));
ret = 1;
}

View File

@@ -8,8 +8,8 @@
initially written by Thomas Orgis
*/
#include "mpg123app.h"
#include "local.h"
#include "../mpg123app.h"
#include "../local.h"
// A number of UTF-8 strings to test.