Author: jwrdegoede
Update of /cvs/free/rpms/mpg123/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv28201
Modified Files:
mpg123.spec
Added Files:
mpg123-1.22.2-apetag.patch
Log Message:
* Mon Jun 22 2015 Hans de Goede <j.w.r.degoede(a)gmail.com> - 1.22.2-2
- Fix playback of files with apetags
mpg123-1.22.2-apetag.patch:
parse.c | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
--- NEW FILE mpg123-1.22.2-apetag.patch ---
diff -up mpg123-1.22.2/src/libmpg123/parse.c.apetag mpg123-1.22.2/src/libmpg123/parse.c
--- mpg123-1.22.2/src/libmpg123/parse.c.apetag 2015-05-24 14:50:24.000000000 +0200
+++ mpg123-1.22.2/src/libmpg123/parse.c 2015-06-22 09:39:00.904835586 +0200
@@ -1077,6 +1077,44 @@ static int handle_id3v2(mpg123_handle *f
return PARSE_AGAIN;
}
+static int handle_apetag(mpg123_handle *fr, unsigned long newhead)
+{
+ unsigned char apebuf[28];
+ unsigned long val;
+ int i, ret;
+
+ fr->oldhead = 0;
+
+ /* Apetag headers are 32 bytes, newhead contains 4, read the rest */
+ if((ret=fr->rd->fullread(fr,apebuf,28)) < 0) return ret;
+
+ /* Apetags start with "APETAGEX", "APET" is already tested. */
+ if(strncmp((char *)apebuf,"AGEX",4) != 0)
+ goto apetag_bad;
+
+ /* Version must be 2.000 / 2000 */
+ val = (apebuf[7]<<24)|(apebuf[6]<<16)|(apebuf[5]<<8)|apebuf[4];
+ if(val != 2000)
+ goto apetag_bad;
+
+ /* Last 8 bytes must be 0 */
+ for(i=20; i<28; i++)
+ if(apebuf[i])
+ goto apetag_bad;
+
+ /* Looks good, skip the rest. */
+ val = (apebuf[11]<<24)|(apebuf[10]<<16)|(apebuf[9]<<8)|apebuf[8];
+ if((ret=fr->rd->skip_bytes(fr,val)) < 0) return ret;
+
+ return PARSE_AGAIN;
+
+apetag_bad:
+ if(fr->rd->back_bytes(fr,31) < 0 && NOQUIET)
+ error("Cannot seek 31 bytes back!");
+
+ return PARSE_AGAIN; /* Give the resync code a chance to fix things */
+}
+
/* Advance a byte in stream to get next possible header and forget
buffered data if possible (for feed reader). */
#define FORGET_INTERVAL 1024 /* Used by callers to set forget flag each <n> bytes.
*/
@@ -1202,6 +1240,11 @@ static int wetwork(mpg123_handle *fr, un
{
return handle_id3v2(fr, newhead);
}
+ /* Check for an apetag header */
+ if(newhead ==
('A'<<24)+('P'<<16)+('E'<<8)+'T')
+ {
+ return handle_apetag(fr, newhead);
+ }
else if(NOQUIET && fr->silent_resync == 0)
{
fprintf(stderr,"Note: Illegal Audio-MPEG-Header 0x%08lx at offset
%"OFF_P".\n",
Index: mpg123.spec
===================================================================
RCS file: /cvs/free/rpms/mpg123/devel/mpg123.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- mpg123.spec 21 Jun 2015 08:56:57 -0000 1.13
+++ mpg123.spec 22 Jun 2015 07:51:30 -0000 1.14
@@ -4,12 +4,14 @@
Name: mpg123
Version: 1.22.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: MPEG audio player
Group: Applications/Multimedia
License: GPLv2+ and LGPLv2
URL:
http://mpg123.org/
Source:
http://downloads.sourceforge.net/mpg123/mpg123-%{version}.tar.bz2
+# Fix playback of files with apetags, submitted upstream
+Patch0: mpg123-1.22.2-apetag.patch
BuildRequires: libtool-ltdl-devel SDL-devel portaudio-devel
BuildRequires: jack-audio-connection-kit-devel nas-devel
BuildRequires: alsa-lib-devel pulseaudio-libs-devel openal-soft-devel
@@ -71,6 +73,7 @@
%prep
%setup -q
+%patch0 -p1
iconv -f iso8859-1 -t utf8 AUTHORS -o AUTHORS.utf8
touch -r AUTHORS AUTHORS.utf8
mv AUTHORS.utf8 AUTHORS
@@ -166,6 +169,9 @@
%changelog
+* Mon Jun 22 2015 Hans de Goede <j.w.r.degoede(a)gmail.com> - 1.22.2-2
+- Fix playback of files with apetags
+
* Sun Jun 21 2015 Hans de Goede <j.w.r.degoede(a)gmail.com> - 1.22.2-1
- New upstream release 1.22.2