Package: djplay Version: 0.5.0-3.1+b1 Severity: wishlist Tags: patch Hi
I'm the Debian maintainer of libid3 and I would like to encourage you to switch to a different tagging library instead. The reason behind this is that libid3 doesn't support ID3v2.4 tags and has issues with UTF8 tags. Also, upstream development has pretty much stopped. I would thus like to get rid of libid3 for wheezy. You will find a patch attached to this report which replaces libid3 with libtag, a properly supported library for reading ID3 tags. It would be nice if you could apply that patch and ship a modified version of djplay, ideally some time soon since we are early in the release cycle and have enough time to break & fix things :) Please don't hesitate to contact me if you have any questions / other issues regarding this patch. -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (700, 'testing'), (650, 'stable'), (600, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.38.6 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages djplay depends on: ii jackd 5 JACK Audio Connection Kit (default ii libaudio2 1.9.2-4 Network Audio System - shared libr ii libaudiofile0 0.2.6-8 Open-source version of SGI's audio ii libc6 2.11.2-11 Embedded GNU C Library: Shared lib ii libcdparanoia0 3.10.2+debian-10 audio extraction tool for sampling ii libdjconsole0 0.1.3-1 Hercules DJ Console access library ii libfontconfig1 2.8.0-2.2 generic font configuration library ii libfreetype6 2.4.4-1 FreeType 2 font engine, shared lib ii libgcc1 1:4.6.0-2 GCC support library ii libice6 2:1.0.7-1 X11 Inter-Client Exchange library ii libid3-3.8.3c2a 3.8.3-13 A library for manipulating ID3v1 a ii libjack0 [libjack-0. 1:0.120.1+svn4142-1 JACK Audio Connection Kit (librari ii libjpeg62 6b1-1 The Independent JPEG Group's JPEG ii libmad0 0.15.1b-6 MPEG audio decoder library ii libmpeg3-1 1.5.4-5 MPEG streams decoding library ii libogg0 1.2.0~dfsg-1 Ogg bitstream library ii libpng12-0 1.2.44-2 PNG library - runtime ii libqt3-mt 3:3.3.8b-7+b1 Qt GUI Library (Threaded runtime v ii libsamplerate0 0.1.7-3 Audio sample rate conversion libra ii libsm6 2:1.2.0-1 X11 Session Management library ii libstdc++6 4.6.0-2 The GNU Standard C++ Library v3 ii libusb-0.1-4 2:0.1.12-17 userspace USB programming library ii libvorbis0a 1.3.2-1 The Vorbis General Audio Compressi ii libvorbisfile3 1.3.2-1 The Vorbis General Audio Compressi ii libx11-6 2:1.4.3-1 X11 client-side library ii libxcursor1 1:1.1.11-1 X cursor management library ii libxext6 2:1.2.0-2 X11 miscellaneous extension librar ii libxft2 2.2.0-2 FreeType-based font drawing librar ii libxi6 2:1.4.2-1 X11 Input extension library ii libxinerama1 2:1.1.1-1 X11 Xinerama extension library ii libxml2 2.7.8.dfsg-2+b1 GNOME XML library ii libxrandr2 2:1.3.1-1 X11 RandR extension library ii libxrender1 1:0.9.6-1 X Rendering Extension client libra ii libxt6 1:1.1.1-1 X11 toolkit intrinsics library ii qjackctl 0.3.7-4 User interface for controlling the ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime djplay recommends no packages. djplay suggests no packages. -- no debconf information
Description: Use taglib instead of libid3 This patch replaces libid3 with taglib in order to get support for reading ID3v2.4 tags Author: Stefan Ott <ste...@ott.net> Last-Update: 2011-05-12 --- a/config.h.in +++ b/config.h.in @@ -61,7 +61,7 @@ #undef HAVE_LIBCDDA_PARANOIA /* Define if you have the id3 library */ -#undef HAVE_LIBID3 +#undef HAVE_LIBTAG /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM --- a/configure.ac +++ b/configure.ac @@ -104,7 +104,6 @@ AC_CHECK_LIB(Xext, main) PKG_CHECK_MODULES(JACK, jack >= 0.80.0) -PKG_CHECK_MODULES(GLIB, glib >= 1.2.0) PKG_CHECK_MODULES(XML2, libxml-2.0 >= 2-2.4.23, [AC_DEFINE([HAVE_LIBXML2],[1],[Define if you have the xml2 library])],[echo "XML editing disabled"] ) @@ -193,13 +192,9 @@ LIBS="-lSoundTouch $LIBS" ]) ]) -AC_CHECK_HEADERS([id3/tag.h],[ - AC_CHECK_LIB([z], [crc32],[ - AC_CHECK_LIB([id3], [ID3Tag_New],[ - AC_DEFINE([HAVE_LIBID3],[1],[Define if you have the id3 library]) - LIBS="-lid3 -lz $LIBS" - ],,"-lz") - ]) +PKG_CHECK_MODULES(TAGLIB, taglib >= 1.7,[ + AC_DEFINE([HAVE_LIBTAG],[1],[Define if you have the tag library]) + LIBS="-ltag $LIBS" ]) AC_CHECK_HEADERS([mad.h],[ AC_CHECK_LIB([mad], [mad_frame_init],[ @@ -242,8 +237,8 @@ AC_FUNC_STAT AC_CHECK_FUNCS([getcwd memmove memset pow sqrt strcasecmp strchr strrchr strstr]) -LIBS="-lqt-mt $JACK_LIBS $GLIB_LIBS $LIBS" -CXXFLAGS="-include djplay.h -DQT_THREAD_SUPPORT $JACK_CFLAGS $GLIB_CFLAGS $CXXFLAGS" +LIBS="-lqt-mt $JACK_LIBS $LIBS" +CXXFLAGS="-include djplay.h -DQT_THREAD_SUPPORT $JACK_CFLAGS $CXXFLAGS" CXXFLAGS="`echo $CXXFLAGS | sed -e \"s/-I\/usr\/include //\"`" AC_SUBST(dontbuild_moc) --- a/mp3.cpp +++ b/mp3.cpp @@ -8,9 +8,11 @@ #include <qthread.h> #include "mainwnd.h" #include "pump.h" -#ifdef HAVE_LIBID3 +#ifdef HAVE_LIBTAG #undef HAVE_CONFIG_H -#include <id3/tag.h> +#include <taglib/taglib.h> +#include <taglib/mpegfile.h> +#include <taglib/id3v2tag.h> #endif #define BLOCK_SKIP 1152 @@ -108,31 +110,12 @@ } m_artist=""; m_title=""; -#ifdef HAVE_LIBID3 - /* This is a primary open (no map), get ID3 tags */ - const char *s_artist=0; - const char *s_title=0; - ID3_Tag tag(file); - ID3_Frame *artist=tag.Find(ID3FID_LEADARTIST); - ID3_Frame *title=tag.Find(ID3FID_TITLE); - if(artist) - { - ID3_Field *f_artist=0; - f_artist=artist->GetField(ID3FN_TEXT); - if(f_artist) - s_artist=f_artist->GetRawText(); - } - if(title) - { - ID3_Field *f_title=0; - f_title=title->GetField(ID3FN_TEXT); - if(f_title) - s_title=f_title->GetRawText(); - } - if(s_artist) - m_artist=s_artist; - if(s_title) - m_title=s_title; +#ifdef HAVE_LIBTAG + TagLib::MPEG::File f(file); + TagLib::ID3v2::Tag *tag = f.ID3v2Tag(); + + m_artist=tag->artist().toCString(); + m_title=tag->title().toCString(); #endif if(m_artist == "" && m_title == "") { --- a/scanthread.cpp +++ b/scanthread.cpp @@ -6,9 +6,11 @@ #include "mp3map.h" #include <qfileinfo.h> #include <qapplication.h> -#ifdef HAVE_LIBID3 +#ifdef HAVE_LIBTAG #undef HAVE_CONFIG_H -#include <id3/tag.h> +#include <taglib/mpegfile.h> +#include <taglib/id3v2tag.h> +#include <taglib/textidentificationframe.h> #endif #ifdef HAVE_LIBVORBIS #include <vorbis/vorbisfile.h> @@ -154,36 +156,32 @@ { int time_secs=-1; int bpm=-1; -#ifdef HAVE_LIBID3 - ID3_Tag tag(info.absFilePath()); - ID3_Frame *tlen=tag.Find(ID3FID_SONGLEN); - ID3_Field *fld=0; - ID3_Frame *tbpm=tag.Find(ID3FID_BPM); - ID3_Field *fbpm=0; +#ifdef HAVE_LIBTAG + TagLib::MPEG::File f(info.absFilePath()); + TagLib::ID3v2::Tag *tag = f.ID3v2Tag(); + TagLib::ID3v2::FrameList llen = tag->frameList("TLEN"); + TagLib::ID3v2::FrameList lbpm = tag->frameList("TBPM"); #endif int res=-1; Mp3Map *map=0; -#ifdef HAVE_LIBID3 - if(tlen) +#ifdef HAVE_LIBTAG + if (llen.size() > 0) { - if(tbpm) + TagLib::ID3v2::Frame *frame; + if (lbpm.size() > 0) { - fbpm=tbpm->GetField(ID3FN_TEXT); - if(fbpm) - bpm=atoi(fbpm->GetRawText()); + frame = lbpm.front(); + bpm = frame->toString().toInt(); } - fld=tlen->GetField(ID3FN_TEXT); - if(fld) + frame = llen.front(); + time_secs = frame->toString().toInt(); + if(time_secs == 0) { - time_secs=atoi(fld->GetRawText())/1000; - if(time_secs == 0) - { - time_secs=-1; - } - else - { - cache->add(i.path(), bpm, time_secs); - } + time_secs=-1; + } + else + { + cache->add(i.path(), bpm, time_secs); } } #endif @@ -209,29 +207,22 @@ i.item()->setText(2, time_string); app->unlock(); usleep(SCAN_USLEEP); -#ifdef HAVE_LIBID3 +#ifdef HAVE_LIBTAG if(info.isWritable()) { - ID3_Frame tl(ID3FID_SONGLEN); - tag.SetUnsync(true); - QString fld_string; - fld_string.sprintf("%d", time_secs*1000); - if(!tlen) - { - tlen=&tl; - if(!fld) - fld=tlen->GetField(ID3FN_TEXT); - if(fld) - fld->Set(fld_string); - tag.AddFrame(tlen); - } - else + TagLib::ID3v2::Frame *frame; + int fld_int = time_secs*1000; + + if (llen.size() < 1) { - if(!fld) - fld=tlen->GetField(ID3FN_TEXT); - fld->Set(fld_string); + frame = new TagLib::ID3v2::TextIdentificationFrame("TLEN"); + frame->setText(TagLib::String::number(fld_int)); + tag->addFrame(frame); + } else { + frame = llen.front(); + frame->setText(TagLib::String::number(fld_int)); } - tag.Update(); + f.save(); } #endif }