Author: thl
Update of /cvs/free/rpms/mp3gain/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv24325
Modified Files:
.cvsignore sources
Added Files:
README.method mp3gain-cflags.patch mp3gain-exit.patch
mp3gain-tempfile-default.patch mp3gain.spec
Log Message:
initial import from livna
--- NEW FILE README.method ---
Q: What dB value does mp3gain normalize to? How does this compare with
normalize-audio?
A: mp3gain and normalize-audio use different methods to determine the
perceived volume of a file, so the numbers are not comparable. As I understand
it, normalize-audio applies a smoothing filter and then sets the maximum to
-12dBFS. mp3gain sorts the volume and then uses the value at 95% (i.e. 5% of
the file are louder, 95% are quieter). This value is set to -20dBFS. I have
tried a few files and found the difference in the recomended values to vary
between 3dB and 6dB.
The method mp3gain uses to determine the perceived volume is described at
http://www.replaygain.org/.
Q: Why are the files not exactly at the same volume?
A: Since mp3gain changes the global gain value in every mp3 frame, it can only
use 1.5dB steps for adjusting the volume. It will however write replaygain
values to tags with finer accuracy than these 1.5dB steps.
mp3gain-cflags.patch:
--- NEW FILE mp3gain-cflags.patch ---
diff -ur mp3gain-1_4_6-src.zip_FILES.OLD/Makefile mp3gain-1_4_6-src.zip_FILES/Makefile
--- mp3gain-1_4_6-src.zip_FILES.OLD/Makefile 2004-04-03 02:24:36.000000000 -0500
+++ mp3gain-1_4_6-src.zip_FILES/Makefile 2006-11-26 13:10:09.000000000 -0500
@@ -6,7 +6,7 @@
CC= gcc
-CFLAGS= -Wall -O3 -DHAVE_MEMCPY
+CFLAGS= $(RPM_OPT_FLAGS) -DHAVE_MEMCPY
ifneq ($(OSTYPE),beos)
INSTALL_PATH= /usr/local/bin
mp3gain-exit.patch:
--- NEW FILE mp3gain-exit.patch ---
diff -ur mp3gain-1_4_6-src.zip_FILES.OLD/gain_analysis.c
mp3gain-1_4_6-src.zip_FILES/gain_analysis.c
--- mp3gain-1_4_6-src.zip_FILES.OLD/gain_analysis.c 2004-04-03 02:24:36.000000000 -0500
+++ mp3gain-1_4_6-src.zip_FILES/gain_analysis.c 2006-11-20 17:10:06.000000000 -0500
@@ -111,7 +111,7 @@
#define MAX_dB 120. // Table entries for 0...MAX_dB (normal max.
values are 70...80 dB)
#define MAX_ORDER (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER :
YULE_ORDER)
-#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME) // max.
Samples per Time slice
+#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME +1) //
max. Samples per Time slice
#define PINK_REF 64.82 //298640883795 //
calibration value
Float_t linprebuf [MAX_ORDER * 2];
diff -ur mp3gain-1_4_6-src.zip_FILES.OLD/mpglibDBL/common.c
mp3gain-1_4_6-src.zip_FILES/mpglibDBL/common.c
--- mp3gain-1_4_6-src.zip_FILES.OLD/mpglibDBL/common.c 2003-08-11 17:02:56.000000000
-0400
+++ mp3gain-1_4_6-src.zip_FILES/mpglibDBL/common.c 2006-11-20 17:12:10.000000000 -0500
@@ -160,7 +160,7 @@
fprintf(stderr,"Stream error\n");
fclose(stdout);
fclose(stderr);
- exit(0);
+ exit(EXIT_FAILURE);
}
if(fr->mpeg25) {
fr->sampling_frequency = 6 + ((newhead>>10)&0x3);
diff -ur mp3gain-1_4_6-src.zip_FILES.OLD/mpglibDBL/interface.c
mp3gain-1_4_6-src.zip_FILES/mpglibDBL/interface.c
--- mp3gain-1_4_6-src.zip_FILES.OLD/mpglibDBL/interface.c 2004-03-22 14:29:16.000000000
-0500
+++ mp3gain-1_4_6-src.zip_FILES/mpglibDBL/interface.c 2006-11-20 17:11:35.000000000 -0500
@@ -137,7 +137,7 @@
fprintf(stderr,"Fatal error! tried to read past mp buffer\n");
fclose(stdout);
fclose(stderr);
- exit(0);
+ exit(EXIT_FAILURE);
}
pos = mp->tail->pos;
}
mp3gain-tempfile-default.patch:
--- NEW FILE mp3gain-tempfile-default.patch ---
diff -ur mp3gain-1_4_6-src.zip_FILES.OLD/mp3gain.c mp3gain-1_4_6-src.zip_FILES/mp3gain.c
--- mp3gain-1_4_6-src.zip_FILES.OLD/mp3gain.c 2004-12-23 15:47:04.000000000 -0500
+++ mp3gain-1_4_6-src.zip_FILES/mp3gain.c 2006-11-20 17:14:03.000000000 -0500
@@ -42,7 +42,11 @@
* out there will have come up with superior versions already...
*
* So have fun dissecting.
- */
+ */
+
+/* stf: make -t the default
+ * -T restores old behaviour
+ */
#include <stdio.h>
#include <stdlib.h>
@@ -117,8 +121,8 @@
unsigned char buffer[BUFFERSIZE];
int writeself = 0;
-int QuietMode = 0;
-int UsingTemp = 0;
+int QuietMode = 0;
+int UsingTemp = 1;
int NowWriting = 0;
double lastfreq = -1.0;
@@ -701,7 +705,8 @@
fclose(inf);
inf = NULL;
passError(MP3GAIN_UNSPECIFED_ERROR, 3,
- "\nCan't open ", outfilename, " for temp
writing\n");
+ "\nCan't open ", outfilename, " for temp
writing\n");
+ NowWriting = 0;
return M3G_ERR_CANT_MAKE_TMP;
}
@@ -715,7 +720,8 @@
if (UsingTemp && (outf != NULL))
fclose(outf);
passError( MP3GAIN_UNSPECIFED_ERROR, 3,
- "\nCan't open ", filename, " for modifying\n");
+ "\nCan't open ", filename, " for modifying\n");
+ NowWriting = 0;
return M3G_ERR_CANT_MODIFY_FILE;
}
else {
@@ -926,7 +932,8 @@
passError(MP3GAIN_CANCELLED,3,"Cancelled processing.\n", filename, " is
probably corrupted now.");
}
if (saveTime)
- fileTime(filename, setStoredTime);
+ fileTime(filename, setStoredTime);
+ NowWriting = 0;
return;
}
#endif
@@ -995,8 +1002,9 @@
if (outlength != inlength) {
deleteFile(outfilename);
passError( MP3GAIN_UNSPECIFED_ERROR, 3,
- "Not enough temp space on disk to modify ", filename,
- "\nEither free some space, or do not use \"temp file\"
option\n");
+ "Not enough temp space on disk to modify ", filename,
+ "\nEither free some space, or switch off \"temp file\" option with
-T\n");
+ NowWriting = 0;
return M3G_ERR_NOT_ENOUGH_TMP_SPACE;
}
else {
@@ -1004,7 +1012,8 @@
if (deleteFile(filename)) {
deleteFile(outfilename); //try to delete tmp file
passError( MP3GAIN_UNSPECIFED_ERROR, 3,
- "Can't open ", filename, " for
modifying\n");
+ "Can't open ", filename, " for
modifying\n");
+ NowWriting = 0;
return M3G_ERR_CANT_MODIFY_FILE;
}
if (moveFile(outfilename, filename)) {
@@ -1012,7 +1021,8 @@
"Problem re-naming ", outfilename, " to ",
filename,
"\nThe mp3 was correctly modified, but you will need to re-name
",
outfilename, " to ", filename,
- " yourself.\n");
+ " yourself.\n");
+ NowWriting = 0;
return M3G_ERR_RENAME_TMP;
};
if (saveTime)
@@ -1214,9 +1224,10 @@
fprintf(stderr,"\t%cm <i> - modify suggested MP3 gain by integer
i\n",SWITCH_CHAR);
fprintf(stderr,"\t%cd <n> - modify suggested dB gain by floating-point
n\n",SWITCH_CHAR);
fprintf(stderr,"\t%cc - ignore clipping warning when applying
gain\n",SWITCH_CHAR);
- fprintf(stderr,"\t%co - output is a database-friendly tab-delimited
list\n",SWITCH_CHAR);
- fprintf(stderr,"\t%ct - mp3gain writes modified mp3 to temp file, then deletes
original\n",SWITCH_CHAR);
- fprintf(stderr,"\t instead of modifying bytes in original file\n");
+ fprintf(stderr,"\t%co - output is a database-friendly tab-delimited
list\n",SWITCH_CHAR);
+ fprintf(stderr,"\t%ct - mp3gain writes modified mp3 to temp file, then deletes
original \n",SWITCH_CHAR);
++ fprintf(stderr,"\t instead of modifying bytes in original file
(default)\n");
++ fprintf(stderr,"\t%cT - mp3gain directly modifies mp3 file (opposite of
%ct)\n",SWITCH_CHAR,SWITCH_CHAR);
fprintf(stderr,"\t%cq - Quiet mode: no status messages\n",SWITCH_CHAR);
fprintf(stderr,"\t%cp - Preserve original file timestamp\n",SWITCH_CHAR);
fprintf(stderr,"\t%cx - Only find max. amplitude of mp3\n",SWITCH_CHAR);
@@ -1505,9 +1516,12 @@
break;
- case 't':
- case 'T':
+ case 't':
UsingTemp = !0;
+ break;
+
+ case 'T':
+ UsingTemp = 0;
break;
case 'u':
--- NEW FILE mp3gain.spec ---
%define tarball_version 1_4_6
Name: mp3gain
Version: 1.4.6
Release: 5%{?dist}
Summary: Lossless MP3 volume adjustment tool
Group: Applications/Multimedia
License: LGPL
URL:
http://mp3gain.sourceforge.net
Source0:
http://osdn.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{tarball_vers...
Source1: %{name}.1.gz
Source2: README.method
Patch0: %{name}-tempfile-default.patch
Patch1: %{name}-exit.patch
Patch2: %{name}-cflags.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
MP3Gain analyzes and adjusts mp3 files so that they have the same
volume. It does not just do peak normalization, as many normalizers
do. Instead, it does some statistical analysis to determine how loud
the file actually sounds to the human ear. Also, the changes MP3Gain
makes are completely lossless. There is no quality lost in the change
because the program adjusts the mp3 file directly, without decoding
and re-encoding.
%prep
%setup -q -c %{name}-%{tarball_version}
%patch0 -p1 -b .tempfile
%patch1 -p1 -b .exit
%patch2 -p1 -b .cflags
install -p -m 644 %{SOURCE2} .
%{__sed} -i 's/\r//' lgpl.txt
%build
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
install -Dp -m 755 %{name} $RPM_BUILD_ROOT%{_bindir}/%{name}
install -Dp -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1.gz
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc lgpl.txt README.method
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz
%changelog
* Mon Aug 04 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 1.4.6-5
- rebuild
* Tue Nov 28 2006 Brian Pepple <bpepple(a)fedoraproject.org> - 1.4.6-4
- Bump.
* Sun Nov 26 2006 Brian Pepple <bpepple(a)fedoraproject.org> - 1.4.6-3
- D'Oh! Add HAVE_MEMCPY back to cflag patch.
* Sun Nov 26 2006 Brian Pepple <bpepple(a)fedoraproject.org> - 1.4.6-2
- Update cflags patch to use RPM_OPT_FLAGS.
* Mon Nov 20 2006 Brian Pepple <bpepple(a)fedoraproject.org> - 1.4.6-1
- Initial Livna spec.
Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/mp3gain/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 22 Jul 2008 16:53:32 -0000 1.1
+++ .cvsignore 4 Aug 2008 19:09:54 -0000 1.2
@@ -0,0 +1,2 @@
+mp3gain-1_4_6-src.zip
+mp3gain.1.gz
Index: sources
===================================================================
RCS file: /cvs/free/rpms/mp3gain/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 22 Jul 2008 16:53:32 -0000 1.1
+++ sources 4 Aug 2008 19:09:54 -0000 1.2
@@ -0,0 +1,2 @@
+4327167375dce5bce97625729a95fdb9 mp3gain-1_4_6-src.zip
+be6cfa62f64a2f4c2818de9b93411525 mp3gain.1.gz