Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 494398
Collapse All | Expand All

(-)a/build/Makefile.am (+3 lines)
Lines 18-23 libmediatomb_a_CXXFLAGS = \ Link Here
18
                     $(ICONV_CXXFLAGS) \
18
                     $(ICONV_CXXFLAGS) \
19
					 $(LIBMAGIC_CFLAGS) \
19
					 $(LIBMAGIC_CFLAGS) \
20
                     $(ID3LIB_CFLAGS) \
20
                     $(ID3LIB_CFLAGS) \
21
                     $(FLAC_CFLAGS) \
21
                     $(LIBEXIF_CFLAGS) \
22
                     $(LIBEXIF_CFLAGS) \
22
                     $(ZLIB_CFLAGS) \
23
                     $(ZLIB_CFLAGS) \
23
                     $(PTHREAD_CFLAGS) \
24
                     $(PTHREAD_CFLAGS) \
Lines 44-49 mediatomb_CXXFLAGS = -I$(top_srcdir)/src Link Here
44
                     $(ICONV_CXXFLAGS) \
45
                     $(ICONV_CXXFLAGS) \
45
					 $(LIBMAGIC_CFLAGS) \
46
					 $(LIBMAGIC_CFLAGS) \
46
                     $(ID3LIB_CFLAGS) \
47
                     $(ID3LIB_CFLAGS) \
48
                     $(FLAC_CFLAGS) \
47
                     $(LIBEXIF_CFLAGS) \
49
                     $(LIBEXIF_CFLAGS) \
48
                     $(ZLIB_CFLAGS) \
50
                     $(ZLIB_CFLAGS) \
49
                     $(PTHREAD_CFLAGS) \
51
                     $(PTHREAD_CFLAGS) \
Lines 78-83 mediatomb_LDADD = \ Link Here
78
    $(JS_LIBS) \
80
    $(JS_LIBS) \
79
	$(LIBMAGIC_LIBS) \
81
	$(LIBMAGIC_LIBS) \
80
    $(ID3LIB_LIBS) \
82
    $(ID3LIB_LIBS) \
83
    $(FLAC_LIBS) \
81
    $(LIBEXIF_LIBS) \
84
    $(LIBEXIF_LIBS) \
82
    $(ZLIB_LIBS) \
85
    $(ZLIB_LIBS) \
83
    $(RT_LIBS) \
86
    $(RT_LIBS) \
(-)a/build/libmediatomb_src (+2 lines)
Lines 98-103 libmediatomb_a_SOURCES = \ Link Here
98
../src/metadata/libmp4v2_handler.h \
98
../src/metadata/libmp4v2_handler.h \
99
../src/metadata/taglib_handler.cc \
99
../src/metadata/taglib_handler.cc \
100
../src/metadata/taglib_handler.h \
100
../src/metadata/taglib_handler.h \
101
../src/metadata/flac_handler.cc \
102
../src/metadata/flac_handler.h \
101
../src/mpegdemux/buffer.c \
103
../src/mpegdemux/buffer.c \
102
../src/mpegdemux/buffer.h \
104
../src/mpegdemux/buffer.h \
103
../src/mpegdemux/mpegdemux.c \
105
../src/mpegdemux/mpegdemux.c \
(-)a/configure.ac (-1 / +31 lines)
Lines 1314-1319 LDFLAGS="$LDFLAGS_SAVE" Link Here
1314
LIBS="$LIBS_SAVE"
1314
LIBS="$LIBS_SAVE"
1315
CXXFLAGS="$CXXFLAGS_SAVE"
1315
CXXFLAGS="$CXXFLAGS_SAVE"
1316
CPPFLAGS="$CPPFLAGS_SAVE"
1316
CPPFLAGS="$CPPFLAGS_SAVE"
1317
1318
######### FLAC
1319
1320
FLAC_STATUS=
1321
1322
MT_OPTION([FLAC], [enable],
1323
          [FLAC metadata extraction with the help of FLAC],[],[])
1324
1325
if test "x$FLAC_OPTION_ENABLED" = xyes; then
1326
    MT_CHECK_PACKAGE([FLAC],
1327
                     [FLAC/metadata],
1328
                     [FLAC], [main])
1329
else
1330
    FLAC_STATUS=disabled
1331
fi
1332
1333
if test "x$FLAC_STATUS" != xyes; then
1334
    if (test "x$FLAC_OPTION_REQUESTED" = xyes) &&
1335
       (test "x$FLAC_OPTION_ENABLED" = xyes); then
1336
        AC_MSG_ERROR([unable to configure FLAC support])
1337
    fi
1338
else
1339
    CFLAGS="$CFLAGS $FLAC_CFLAGS"
1340
    CXXFLAGS="$CXXFLAGS $FLAC_CFLAGS"
1341
    LDFLAGS="$LDFLAGS $FLAC_LDFLAGS $FLAC_LIBS"
1342
    AC_LANG_SAVE
1343
    AC_LANG_CPLUSPLUS
1344
fi
1345
1317
######## curl
1346
######## curl
1318
1347
1319
CURL_PROG_FOUND=0
1348
CURL_PROG_FOUND=0
Lines 1914-1920 if (test "x$SOPCAST_OPTION_ENABLED" = xy Link Here
1914
    AC_DEFINE([SOPCAST], [1], [Enable support for the SopCast service])
1943
    AC_DEFINE([SOPCAST], [1], [Enable support for the SopCast service])
1915
fi
1944
fi
1916
1945
1917
AC_DEFINE_UNQUOTED([COMPILE_INFO], "\thost:\t\t\t$host\n\tsqlite3:\t\t$SQLITE3_STATUS\n\tmysql:\t\t\t$MYSQL_STATUS\n\tlibjs:\t\t\t$JS_OK\n\tlibmagic:\t\t$LIBMAGIC_STATUS\n\tinotify:\t\t$INOTIFY_STATUS\n\tlibexif:\t\t$LIBEXIF_STATUS\n\tid3lib:\t\t\t$ID3LIB_STATUS\n\ttaglib:\t\t\t$TAGLIB_STATUS\n\tffmpeg\t\t\t$FFMPEG_STATUS\n\tlibmp4v2:\t\t$LIBMP4V2_STATUS\n\texternal transcoding:\t$EXTERNAL_TRANSCODING_OPTION_ENABLED\n\tcurl:\t\t\t$CURL_OK\n\tYouTube:\t\t$YOUTUBE_OPTION_ENABLED\n\tlibextractor\t\t$LIBEXTRACTOR_STATUS\n\tdb-autocreate:\t\t$DB_AUTOCREATE_OPTION_ENABLED\n\tdebug log:\t\t$DEBUG_LOG_OPTION_ENABLED\n\tprotocol info extension:$PROTOCOLINFO_EXTENSION_OPTION_ENABLED\n\tffmpegthumbnailer:\t$FFMPEGTHUMBNAILER_STATUS\n\tlastfmlib:\t\t$LASTFMLIB_STATUS\n\tdata directory:\t\t$PACKAGE_DATADIR", [compile option summary])
1946
AC_DEFINE_UNQUOTED([COMPILE_INFO], "\thost:\t\t\t$host\n\tsqlite3:\t\t$SQLITE3_STATUS\n\tmysql:\t\t\t$MYSQL_STATUS\n\tlibjs:\t\t\t$JS_OK\n\tlibmagic:\t\t$LIBMAGIC_STATUS\n\tinotify:\t\t$INOTIFY_STATUS\n\tlibexif:\t\t$LIBEXIF_STATUS\n\tid3lib:\t\t\t$ID3LIB_STATUS\n\ttaglib:\t\t\t$TAGLIB_STATUS\n\tFLAC:\t\t\t$FLAC_STATUS\n\tffmpeg\t\t\t$FFMPEG_STATUS\n\tlibmp4v2:\t\t$LIBMP4V2_STATUS\n\texternal transcoding:\t$EXTERNAL_TRANSCODING_OPTION_ENABLED\n\tcurl:\t\t\t$CURL_OK\n\tYouTube:\t\t$YOUTUBE_OPTION_ENABLED\n\tlibextractor\t\t$LIBEXTRACTOR_STATUS\n\tdb-autocreate:\t\t$DB_AUTOCREATE_OPTION_ENABLED\n\tdebug log:\t\t$DEBUG_LOG_OPTION_ENABLED\n\tprotocol info extension:$PROTOCOLINFO_EXTENSION_OPTION_ENABLED\n\tffmpegthumbnailer:\t$FFMPEGTHUMBNAILER_STATUS\n\tlastfmlib:\t\t$LASTFMLIB_STATUS\n\tdata directory:\t\t$PACKAGE_DATADIR", [compile option summary])
1918
1947
1919
###############
1948
###############
1920
AC_CONFIG_FILES([
1949
AC_CONFIG_FILES([
Lines 1946-1951 echo "inotify : $INOTIFY_S Link Here
1946
echo "libexif               : $LIBEXIF_STATUS"
1975
echo "libexif               : $LIBEXIF_STATUS"
1947
echo "id3lib                : $ID3LIB_STATUS"
1976
echo "id3lib                : $ID3LIB_STATUS"
1948
echo "taglib                : $TAGLIB_STATUS"
1977
echo "taglib                : $TAGLIB_STATUS"
1978
echo "FLAC                  : $FLAC_STATUS"
1949
echo "libmp4v2              : $LIBMP4V2_STATUS"
1979
echo "libmp4v2              : $LIBMP4V2_STATUS"
1950
echo "ffmpeg                : $FFMPEG_STATUS"
1980
echo "ffmpeg                : $FFMPEG_STATUS"
1951
echo "ffmpegthumbnailer     : $FFMPEGTHUMBNAILER_STATUS"
1981
echo "ffmpegthumbnailer     : $FFMPEGTHUMBNAILER_STATUS"
(-)a/src/cds_resource_manager.cc (+1 lines)
Lines 372-377 void CdsResourceManager::addResources(Re Link Here
372
        // only add upnp:AlbumArtURI if we have an AA, skip the resource
372
        // only add upnp:AlbumArtURI if we have an AA, skip the resource
373
        if ((i > 0) && ((item->getResource(i)->getHandlerType() == CH_ID3) ||
373
        if ((i > 0) && ((item->getResource(i)->getHandlerType() == CH_ID3) ||
374
                        (item->getResource(i)->getHandlerType() == CH_MP4) ||
374
                        (item->getResource(i)->getHandlerType() == CH_MP4) ||
375
                        (item->getResource(i)->getHandlerType() == CH_FLAC) ||
375
                        (item->getResource(i)->getHandlerType() == CH_EXTURL)))
376
                        (item->getResource(i)->getHandlerType() == CH_EXTURL)))
376
        {
377
        {
377
            String rct;
378
            String rct;
(-)a/src/config_manager.cc (+4 lines)
Lines 624-629 String ConfigManager::createDefaultConfi Link Here
624
                                           _(CONTENT_TYPE_OGG)));
624
                                           _(CONTENT_TYPE_OGG)));
625
    mtcontent->appendElementChild(treat_as(_("audio/x-flac"), 
625
    mtcontent->appendElementChild(treat_as(_("audio/x-flac"), 
626
                                           _(CONTENT_TYPE_FLAC)));
626
                                           _(CONTENT_TYPE_FLAC)));
627
    mtcontent->appendElementChild(treat_as(_("audio/x-ms-wma"), 
628
                                           _(CONTENT_TYPE_WMA)));
629
    mtcontent->appendElementChild(treat_as(_("audio/x-wavpack"), 
630
                                           _(CONTENT_TYPE_WAVPACK)));
627
    mtcontent->appendElementChild(treat_as(_("image/jpeg"), 
631
    mtcontent->appendElementChild(treat_as(_("image/jpeg"), 
628
                                           _(CONTENT_TYPE_JPG)));
632
                                           _(CONTENT_TYPE_JPG)));
629
    mtcontent->appendElementChild(treat_as(_("audio/x-mpegurl"),
633
    mtcontent->appendElementChild(treat_as(_("audio/x-mpegurl"),
(-)a/src/metadata/flac_handler.cc (+204 lines)
Line 0 Link Here
1
/*MT*
2
    
3
    MediaTomb - http://www.mediatomb.cc/
4
    
5
    flac_handler.cc - this file is part of MediaTomb.
6
    
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
    
10
    Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
                            Leonhard Wimmer <leo@mediatomb.cc>
13
    
14
    MediaTomb is free software; you can redistribute it and/or modify
15
    it under the terms of the GNU General Public License version 2
16
    as published by the Free Software Foundation.
17
    
18
    MediaTomb is distributed in the hope that it will be useful,
19
    but WITHOUT ANY WARRANTY; without even the implied warranty of
20
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
    GNU General Public License for more details.
22
    
23
    You should have received a copy of the GNU General Public License
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
    
27
    $Id: flac_handler.cc 2032 2009-12-21 22:58:57Z lww $
28
*/
29
30
/// \file flac_handler.cc
31
/// \brief Implementeation of the FlacHandler class.
32
33
#ifdef HAVE_CONFIG_H
34
    #include "autoconfig.h"
35
#endif
36
37
#ifdef HAVE_FLAC
38
39
#include <FLAC/all.h>
40
41
#include "flac_handler.h"
42
#include "string_converter.h"
43
#include "config_manager.h"
44
#include "common.h"
45
#include "tools.h"
46
#include "mem_io_handler.h"
47
48
#include "content_manager.h"
49
50
using namespace zmm;
51
52
FlacHandler::FlacHandler() : MetadataHandler()
53
{
54
}
55
56
static void addField(metadata_fields_t field, const FLAC__StreamMetadata* tags, Ref<CdsItem> item)
57
{
58
    String value;
59
    int i;
60
61
	Ref<StringConverter> sc = StringConverter::i2i(); // sure is sure 
62
	
63
    switch (field)
64
    {
65
        case M_TITLE:
66
			i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "TITLE");
67
            break;
68
        case M_ARTIST:
69
            i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "ARTIST");
70
            break;
71
        case M_ALBUM:
72
            i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "ALBUM");
73
            break;
74
        case M_DATE:
75
            i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "DATE");
76
            break;
77
        case M_GENRE:
78
            i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "GENRE");
79
            break;
80
        case M_DESCRIPTION:
81
            i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "DESCRIPTION");
82
            break;
83
        case M_TRACKNUMBER:
84
            i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "TRACKNUMBER");
85
            break;
86
        default:
87
            return;
88
    }
89
90
	if( 0 <= i )
91
		value = strchr((const char *)tags->data.vorbis_comment.comments[i].entry, '=') + 1;
92
	else
93
		return;
94
95
    value = trim_string(value);
96
97
    if (string_ok(value))
98
    {
99
        item->setMetadata(MT_KEYS[field].upnp, sc->convert(value));
100
        log_debug("Setting metadata on item: %d, %s\n", field, sc->convert(value).c_str());
101
    }
102
}
103
104
void FlacHandler::fillMetadata(Ref<CdsItem> item)
105
{
106
	FLAC__StreamMetadata* tags = NULL;
107
	FLAC__StreamMetadata streaminfo;
108
	Ref<StringConverter> sc = StringConverter::i2i(); // sure is sure 
109
	
110
	if( !FLAC__metadata_get_tags(item->getLocation().c_str(), &tags) )
111
		return;
112
		
113
	if( FLAC__METADATA_TYPE_VORBIS_COMMENT == tags->type )
114
	{
115
		for (int i = 0; i < M_MAX; i++)
116
			addField((metadata_fields_t) i, tags, item);
117
	}
118
		
119
	FLAC__metadata_object_delete(tags);
120
	tags = NULL;
121
	
122
	if( !FLAC__metadata_get_streaminfo(item->getLocation().c_str(), &streaminfo) )
123
		return;
124
	
125
	if( FLAC__METADATA_TYPE_STREAMINFO == streaminfo.type )
126
	{
127
		// note: UPnP requires bytes/second
128
		item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from((unsigned)((streaminfo.data.stream_info.bits_per_sample * streaminfo.data.stream_info.sample_rate) / 8)));
129
		// note: UPnP requires HMS
130
		item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_DURATION), secondsToHMS((unsigned)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate)));
131
		item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from(streaminfo.data.stream_info.sample_rate));
132
		item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(streaminfo.data.stream_info.channels));
133
	}
134
	
135
	if( !FLAC__metadata_get_picture(item->getLocation().c_str(), 
136
									&tags, 
137
									FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER,
138
									NULL,
139
									NULL,
140
									(unsigned)-1,
141
									(unsigned)-1,
142
									(unsigned)-1,
143
									(unsigned)-1 ) )
144
		return;
145
	
146
	if( FLAC__METADATA_TYPE_PICTURE == tags->type )
147
	{
148
		String art_mimetype = tags->data.picture.mime_type;
149
		log_debug("Mime type : %s\n", sc->convert(art_mimetype).c_str());
150
		
151
		// saw that simply "PNG" was used with some mp3's, so mimetype setting
152
        // was probably invalid
153
        if (!string_ok(art_mimetype) || (art_mimetype.index('/') == -1))
154
        {
155
#ifdef HAVE_MAGIC
156
            art_mimetype =  ContentManager::getInstance()->getMimeTypeFromBuffer((void *)tags->data.picture.data, tags->data.picture.data_length);
157
            if (!string_ok(art_mimetype))
158
#endif
159
				art_mimetype = _(MIMETYPE_DEFAULT);
160
			
161
			log_debug("Mime type via magic: %s\n", sc->convert(art_mimetype).c_str());
162
        }
163
		
164
		// if we could not determine the mimetype, then there is no
165
        // point to add the resource - it's probably garbage
166
        if (art_mimetype != _(MIMETYPE_DEFAULT))
167
        {
168
            Ref<CdsResource> resource(new CdsResource(CH_FLAC));
169
            resource->addAttribute(MetadataHandler::getResAttrName(R_PROTOCOLINFO), renderProtocolInfo(art_mimetype));
170
            resource->addParameter(_(RESOURCE_CONTENT_TYPE), _(ID3_ALBUM_ART));
171
            item->addResource(resource);
172
        }
173
	}
174
175
	FLAC__metadata_object_delete(tags);
176
}
177
178
Ref<IOHandler> FlacHandler::serveContent(Ref<CdsItem> item, int resNum, off_t *data_size)
179
{
180
	FLAC__StreamMetadata* picture = NULL;
181
	
182
	if( !FLAC__metadata_get_picture(item->getLocation().c_str(), 
183
									&picture, 
184
									FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER,
185
									NULL,
186
									NULL,
187
									(unsigned)-1,
188
									(unsigned)-1,
189
									(unsigned)-1,
190
									(unsigned)-1 ) )
191
		throw _Exception(_("FlacHandler: could not exctract cover from: ") + item->getLocation());
192
	
193
	if( FLAC__METADATA_TYPE_PICTURE != picture->type )
194
		throw _Exception(_("TagHandler: resource has no album information"));
195
	
196
	Ref<IOHandler> h(new MemIOHandler((void *)picture->data.picture.data, picture->data.picture.data_length));
197
	*data_size = picture->data.picture.data_length;
198
	
199
	FLAC__metadata_object_delete(picture);
200
		
201
    return h;
202
}
203
204
#endif // HAVE_FLAC
(-)a/src/metadata/flac_handler.h (+47 lines)
Line 0 Link Here
1
/*MT*
2
    
3
    MediaTomb - http://www.mediatomb.cc/
4
    
5
    flac_handler.h - this file is part of MediaTomb.
6
    
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
    
10
    Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
                            Leonhard Wimmer <leo@mediatomb.cc>
13
    
14
    MediaTomb is free software; you can redistribute it and/or modify
15
    it under the terms of the GNU General Public License version 2
16
    as published by the Free Software Foundation.
17
    
18
    MediaTomb is distributed in the hope that it will be useful,
19
    but WITHOUT ANY WARRANTY; without even the implied warranty of
20
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
    GNU General Public License for more details.
22
    
23
    You should have received a copy of the GNU General Public License
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
    
27
    $Id: flac_handler.h 2010 2009-01-11 19:10:43Z lww $
28
*/
29
30
/// \file flac_handler.h
31
/// \brief Definition of the FlacHandler class.
32
33
#ifndef __METADATA_FLAC_H__
34
#define __METADATA_FLAC_H__
35
36
#include "metadata_handler.h"
37
38
/// \brief This class is responsible for reading FLAC metadata
39
class FlacHandler : public MetadataHandler
40
{
41
public:
42
    FlacHandler();
43
    virtual void fillMetadata(zmm::Ref<CdsItem> item);
44
    virtual zmm::Ref<IOHandler> serveContent(zmm::Ref<CdsItem> item, int resNum, off_t *data_size);
45
};
46
47
#endif // __METADATA_FLAC_H__
(-)a/src/metadata_handler.cc (-2 / +17 lines)
Lines 51-56 Link Here
51
#endif // HAVE_ID3LIB
51
#endif // HAVE_ID3LIB
52
#endif // HAVE_TAGLIB
52
#endif // HAVE_TAGLIB
53
53
54
#ifdef HAVE_FLAC
55
#include "metadata/flac_handler.h"
56
#endif
57
54
#ifdef HAVE_LIBMP4V2
58
#ifdef HAVE_LIBMP4V2
55
#include "metadata/libmp4v2_handler.h"
59
#include "metadata/libmp4v2_handler.h"
56
#endif
60
#endif
Lines 140-146 void MetadataHandler::setMetadata(Ref<Cd Link Here
140
        if ((content_type == CONTENT_TYPE_MP3) || 
144
        if ((content_type == CONTENT_TYPE_MP3) || 
141
           ((content_type == CONTENT_TYPE_OGG) && 
145
           ((content_type == CONTENT_TYPE_OGG) && 
142
            (!item->getFlag(OBJECT_FLAG_OGG_THEORA))) ||
146
            (!item->getFlag(OBJECT_FLAG_OGG_THEORA))) ||
143
            (content_type == CONTENT_TYPE_FLAC))
147
            (content_type == CONTENT_TYPE_WMA) ||
148
            (content_type == CONTENT_TYPE_WAVPACK))
144
        {
149
        {
145
            handler = Ref<MetadataHandler>(new TagHandler());
150
            handler = Ref<MetadataHandler>(new TagHandler());
146
            break;
151
            break;
Lines 155-161 void MetadataHandler::setMetadata(Ref<Cd Link Here
155
#endif // HAVE_ID3LIB
160
#endif // HAVE_ID3LIB
156
#endif // HAVE_TAGLIB
161
#endif // HAVE_TAGLIB
157
162
158
163
#ifdef HAVE_FLAC
164
        if (content_type == CONTENT_TYPE_FLAC)
165
        {
166
            handler = Ref<MetadataHandler>(new FlacHandler());
167
            break;
168
        }
169
#endif
159
170
160
#ifdef HAVE_EXIV2
171
#ifdef HAVE_EXIV2
161
/*        
172
/*        
Lines 277-282 Ref<MetadataHandler> MetadataHandler::cr Link Here
277
        case CH_FFTH:
288
        case CH_FFTH:
278
            return Ref<MetadataHandler>(new FfmpegHandler());
289
            return Ref<MetadataHandler>(new FfmpegHandler());
279
#endif
290
#endif
291
#ifdef HAVE_FLAC
292
        case CH_FLAC:
293
            return Ref<MetadataHandler>(new FlacHandler());
294
#endif
280
        default:
295
        default:
281
            throw _Exception(_("unknown content handler ID: ") + handlerType);
296
            throw _Exception(_("unknown content handler ID: ") + handlerType);
282
    }
297
    }
(-)a/src/metadata_handler.h (+3 lines)
Lines 45-54 Link Here
45
#define CH_EXTURL    4
45
#define CH_EXTURL    4
46
#define CH_MP4       5
46
#define CH_MP4       5
47
#define CH_FFTH      6
47
#define CH_FFTH      6
48
#define CH_FLAC      7
48
49
49
#define CONTENT_TYPE_MP3        "mp3"
50
#define CONTENT_TYPE_MP3        "mp3"
50
#define CONTENT_TYPE_OGG        "ogg"
51
#define CONTENT_TYPE_OGG        "ogg"
51
#define CONTENT_TYPE_FLAC       "flac"
52
#define CONTENT_TYPE_FLAC       "flac"
53
#define CONTENT_TYPE_WMA        "wma"
54
#define CONTENT_TYPE_WAVPACK    "wv"
52
#define CONTENT_TYPE_JPG        "jpg"
55
#define CONTENT_TYPE_JPG        "jpg"
53
#define CONTENT_TYPE_PLAYLIST   "playlist"
56
#define CONTENT_TYPE_PLAYLIST   "playlist"
54
#define CONTENT_TYPE_MP4        "mp4"
57
#define CONTENT_TYPE_MP4        "mp4"

Return to bug 494398