decoder/flac: use C++ compiler
This commit is contained in:
parent
a9419da09c
commit
cbdd042adc
13
Makefile.am
13
Makefile.am
@ -98,8 +98,6 @@ mpd_headers = \
|
|||||||
src/gcc.h \
|
src/gcc.h \
|
||||||
src/decoder_list.h \
|
src/decoder_list.h \
|
||||||
src/decoder_print.h \
|
src/decoder_print.h \
|
||||||
src/decoder/flac_metadata.h \
|
|
||||||
src/decoder/flac_pcm.h \
|
|
||||||
src/decoder/pcm_decoder_plugin.h \
|
src/decoder/pcm_decoder_plugin.h \
|
||||||
src/input_init.h \
|
src/input_init.h \
|
||||||
src/input_plugin.h \
|
src/input_plugin.h \
|
||||||
@ -620,10 +618,11 @@ endif
|
|||||||
|
|
||||||
if HAVE_FLAC
|
if HAVE_FLAC
|
||||||
libdecoder_plugins_a_SOURCES += \
|
libdecoder_plugins_a_SOURCES += \
|
||||||
src/decoder/flac_metadata.c \
|
src/decoder/FLACMetaData.cxx src/decoder/FLACMetaData.hxx \
|
||||||
src/decoder/flac_pcm.c \
|
src/decoder/FLAC_PCM.cxx src/decoder/FLAC_PCM.hxx \
|
||||||
src/decoder/flac_common.c src/decoder/flac_common.h \
|
src/decoder/FLACCommon.cxx src/decoder/FLACCommon.hxx \
|
||||||
src/decoder/flac_decoder_plugin.c
|
src/decoder/FLACDecoderPlugin.cxx \
|
||||||
|
src/decoder/FLACDecoderPlugin.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if HAVE_AUDIOFILE
|
if HAVE_AUDIOFILE
|
||||||
@ -1145,7 +1144,7 @@ test_dump_playlist_SOURCES = test/dump_playlist.c \
|
|||||||
if HAVE_FLAC
|
if HAVE_FLAC
|
||||||
test_dump_playlist_SOURCES += \
|
test_dump_playlist_SOURCES += \
|
||||||
src/replay_gain_info.c \
|
src/replay_gain_info.c \
|
||||||
src/decoder/flac_metadata.c
|
src/decoder/FLACMetaData.cxx
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test_run_decoder_LDADD = \
|
test_run_decoder_LDADD = \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
* http://www.musicpd.org
|
* http://www.musicpd.org
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -22,10 +22,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "flac_common.h"
|
#include "FLACCommon.hxx"
|
||||||
#include "flac_metadata.h"
|
#include "FLACMetaData.hxx"
|
||||||
#include "flac_pcm.h"
|
#include "FLAC_PCM.hxx"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
#include "audio_check.h"
|
#include "audio_check.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
@ -46,7 +49,7 @@ flac_data_init(struct flac_data *data, struct decoder * decoder,
|
|||||||
data->position = 0;
|
data->position = 0;
|
||||||
data->decoder = decoder;
|
data->decoder = decoder;
|
||||||
data->input_stream = input_stream;
|
data->input_stream = input_stream;
|
||||||
data->tag = NULL;
|
data->tag = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -54,7 +57,7 @@ flac_data_deinit(struct flac_data *data)
|
|||||||
{
|
{
|
||||||
pcm_buffer_deinit(&data->buffer);
|
pcm_buffer_deinit(&data->buffer);
|
||||||
|
|
||||||
if (data->tag != NULL)
|
if (data->tag != nullptr)
|
||||||
tag_free(data->tag);
|
tag_free(data->tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +89,7 @@ flac_got_stream_info(struct flac_data *data,
|
|||||||
if (data->initialized || data->unsupported)
|
if (data->initialized || data->unsupported)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GError *error = NULL;
|
GError *error = nullptr;
|
||||||
if (!audio_format_init_checked(&data->audio_format,
|
if (!audio_format_init_checked(&data->audio_format,
|
||||||
stream_info->sample_rate,
|
stream_info->sample_rate,
|
||||||
flac_sample_format(stream_info->bits_per_sample),
|
flac_sample_format(stream_info->bits_per_sample),
|
||||||
@ -129,8 +132,8 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
|
|||||||
decoder_mixramp(data->decoder, replay_gain_db,
|
decoder_mixramp(data->decoder, replay_gain_db,
|
||||||
mixramp_start, mixramp_end);
|
mixramp_start, mixramp_end);
|
||||||
|
|
||||||
if (data->tag != NULL)
|
if (data->tag != nullptr)
|
||||||
flac_vorbis_comments_to_tag(data->tag, NULL,
|
flac_vorbis_comments_to_tag(data->tag, nullptr,
|
||||||
&block->data.vorbis_comment);
|
&block->data.vorbis_comment);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -160,7 +163,7 @@ flac_got_first_frame(struct flac_data *data, const FLAC__FrameHeader *header)
|
|||||||
if (data->unsupported)
|
if (data->unsupported)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
GError *error = NULL;
|
GError *error = nullptr;
|
||||||
if (!audio_format_init_checked(&data->audio_format,
|
if (!audio_format_init_checked(&data->audio_format,
|
||||||
header->sample_rate,
|
header->sample_rate,
|
||||||
flac_sample_format(header->bits_per_sample),
|
flac_sample_format(header->bits_per_sample),
|
||||||
@ -199,7 +202,7 @@ flac_common_write(struct flac_data *data, const FLAC__Frame * frame,
|
|||||||
buffer = pcm_buffer_get(&data->buffer, buffer_size);
|
buffer = pcm_buffer_get(&data->buffer, buffer_size);
|
||||||
|
|
||||||
flac_convert(buffer, frame->header.channels,
|
flac_convert(buffer, frame->header.channels,
|
||||||
data->audio_format.format, buf,
|
(enum sample_format)data->audio_format.format, buf,
|
||||||
0, frame->header.blocksize);
|
0, frame->header.blocksize);
|
||||||
|
|
||||||
if (nbytes > 0)
|
if (nbytes > 0)
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
* http://www.musicpd.org
|
* http://www.musicpd.org
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -21,11 +21,13 @@
|
|||||||
* Common data structures and functions used by FLAC and OggFLAC
|
* Common data structures and functions used by FLAC and OggFLAC
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MPD_FLAC_COMMON_H
|
#ifndef MPD_FLAC_COMMON_HXX
|
||||||
#define MPD_FLAC_COMMON_H
|
#define MPD_FLAC_COMMON_HXX
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
#include "decoder_api.h"
|
#include "decoder_api.h"
|
||||||
#include "pcm_buffer.h"
|
#include "pcm_buffer.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include <FLAC/stream_decoder.h>
|
#include <FLAC/stream_decoder.h>
|
||||||
#include <FLAC/metadata.h>
|
#include <FLAC/metadata.h>
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
* http://www.musicpd.org
|
* http://www.musicpd.org
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -18,9 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h" /* must be first for large file support */
|
#include "config.h" /* must be first for large file support */
|
||||||
#include "flac_common.h"
|
#include "FLACDecoderPlugin.h"
|
||||||
#include "flac_metadata.h"
|
#include "FLACCommon.hxx"
|
||||||
|
#include "FLACMetaData.hxx"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
#include "ogg_codec.h"
|
#include "ogg_codec.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
@ -41,7 +45,7 @@ flac_read_cb(G_GNUC_UNUSED const FLAC__StreamDecoder *fd,
|
|||||||
FLAC__byte buf[], size_t *bytes,
|
FLAC__byte buf[], size_t *bytes,
|
||||||
void *fdata)
|
void *fdata)
|
||||||
{
|
{
|
||||||
struct flac_data *data = fdata;
|
struct flac_data *data = (struct flac_data *)fdata;
|
||||||
size_t r;
|
size_t r;
|
||||||
|
|
||||||
r = decoder_read(data->decoder, data->input_stream,
|
r = decoder_read(data->decoder, data->input_stream,
|
||||||
@ -69,7 +73,7 @@ flac_seek_cb(G_GNUC_UNUSED const FLAC__StreamDecoder *fd,
|
|||||||
return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
|
return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
|
||||||
|
|
||||||
if (!input_stream_lock_seek(data->input_stream, offset, SEEK_SET,
|
if (!input_stream_lock_seek(data->input_stream, offset, SEEK_SET,
|
||||||
NULL))
|
nullptr))
|
||||||
return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
|
return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
|
||||||
|
|
||||||
return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
|
return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
|
||||||
@ -172,7 +176,7 @@ static bool
|
|||||||
flac_scan_file(const char *file,
|
flac_scan_file(const char *file,
|
||||||
const struct tag_handler *handler, void *handler_ctx)
|
const struct tag_handler *handler, void *handler_ctx)
|
||||||
{
|
{
|
||||||
return flac_scan_file2(file, NULL, handler, handler_ctx);
|
return flac_scan_file2(file, nullptr, handler, handler_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -182,9 +186,9 @@ static FLAC__StreamDecoder *
|
|||||||
flac_decoder_new(void)
|
flac_decoder_new(void)
|
||||||
{
|
{
|
||||||
FLAC__StreamDecoder *sd = FLAC__stream_decoder_new();
|
FLAC__StreamDecoder *sd = FLAC__stream_decoder_new();
|
||||||
if (sd == NULL) {
|
if (sd == nullptr) {
|
||||||
g_warning("FLAC__stream_decoder_new() failed");
|
g_warning("FLAC__stream_decoder_new() failed");
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!FLAC__stream_decoder_set_metadata_respond(sd, FLAC__METADATA_TYPE_VORBIS_COMMENT))
|
if(!FLAC__stream_decoder_set_metadata_respond(sd, FLAC__METADATA_TYPE_VORBIS_COMMENT))
|
||||||
@ -234,7 +238,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
|
|||||||
data->first_frame = t_start;
|
data->first_frame = t_start;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (data->tag != NULL && !tag_is_empty(data->tag)) {
|
if (data->tag != nullptr && !tag_is_empty(data->tag)) {
|
||||||
cmd = decoder_tag(data->decoder, data->input_stream,
|
cmd = decoder_tag(data->decoder, data->input_stream,
|
||||||
data->tag);
|
data->tag);
|
||||||
tag_free(data->tag);
|
tag_free(data->tag);
|
||||||
@ -316,7 +320,7 @@ flac_decode_internal(struct decoder * decoder,
|
|||||||
struct flac_data data;
|
struct flac_data data;
|
||||||
|
|
||||||
flac_dec = flac_decoder_new();
|
flac_dec = flac_decoder_new();
|
||||||
if (flac_dec == NULL)
|
if (flac_dec == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flac_data_init(&data, decoder, input_stream);
|
flac_data_init(&data, decoder, input_stream);
|
||||||
@ -378,7 +382,7 @@ oggflac_scan_file(const char *file,
|
|||||||
if (!(block = FLAC__metadata_iterator_get_block(it)))
|
if (!(block = FLAC__metadata_iterator_get_block(it)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
flac_scan_metadata(NULL, block,
|
flac_scan_metadata(nullptr, block,
|
||||||
handler, handler_ctx);
|
handler, handler_ctx);
|
||||||
} while (FLAC__metadata_iterator_next(it));
|
} while (FLAC__metadata_iterator_next(it));
|
||||||
FLAC__metadata_iterator_delete(it);
|
FLAC__metadata_iterator_delete(it);
|
||||||
@ -395,43 +399,52 @@ oggflac_decode(struct decoder *decoder, struct input_stream *input_stream)
|
|||||||
|
|
||||||
/* rewind the stream, because ogg_codec_detect() has
|
/* rewind the stream, because ogg_codec_detect() has
|
||||||
moved it */
|
moved it */
|
||||||
input_stream_lock_seek(input_stream, 0, SEEK_SET, NULL);
|
input_stream_lock_seek(input_stream, 0, SEEK_SET, nullptr);
|
||||||
|
|
||||||
flac_decode_internal(decoder, input_stream, true);
|
flac_decode_internal(decoder, input_stream, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *const oggflac_suffixes[] = { "ogg", "oga", NULL };
|
static const char *const oggflac_suffixes[] = { "ogg", "oga", nullptr };
|
||||||
static const char *const oggflac_mime_types[] = {
|
static const char *const oggflac_mime_types[] = {
|
||||||
"application/ogg",
|
"application/ogg",
|
||||||
"application/x-ogg",
|
"application/x-ogg",
|
||||||
"audio/ogg",
|
"audio/ogg",
|
||||||
"audio/x-flac+ogg",
|
"audio/x-flac+ogg",
|
||||||
"audio/x-ogg",
|
"audio/x-ogg",
|
||||||
NULL
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin oggflac_decoder_plugin = {
|
const struct decoder_plugin oggflac_decoder_plugin = {
|
||||||
.name = "oggflac",
|
"oggflac",
|
||||||
.init = oggflac_init,
|
oggflac_init,
|
||||||
.stream_decode = oggflac_decode,
|
nullptr,
|
||||||
.scan_file = oggflac_scan_file,
|
oggflac_decode,
|
||||||
.suffixes = oggflac_suffixes,
|
nullptr,
|
||||||
.mime_types = oggflac_mime_types
|
oggflac_scan_file,
|
||||||
|
nullptr,
|
||||||
|
nullptr,
|
||||||
|
oggflac_suffixes,
|
||||||
|
oggflac_mime_types,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *const flac_suffixes[] = { "flac", NULL };
|
static const char *const flac_suffixes[] = { "flac", nullptr };
|
||||||
static const char *const flac_mime_types[] = {
|
static const char *const flac_mime_types[] = {
|
||||||
"application/flac",
|
"application/flac",
|
||||||
"application/x-flac",
|
"application/x-flac",
|
||||||
"audio/flac",
|
"audio/flac",
|
||||||
"audio/x-flac",
|
"audio/x-flac",
|
||||||
NULL
|
nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct decoder_plugin flac_decoder_plugin = {
|
const struct decoder_plugin flac_decoder_plugin = {
|
||||||
.name = "flac",
|
"flac",
|
||||||
.stream_decode = flac_decode,
|
nullptr,
|
||||||
.scan_file = flac_scan_file,
|
nullptr,
|
||||||
.suffixes = flac_suffixes,
|
flac_decode,
|
||||||
.mime_types = flac_mime_types,
|
nullptr,
|
||||||
|
flac_scan_file,
|
||||||
|
nullptr,
|
||||||
|
nullptr,
|
||||||
|
flac_suffixes,
|
||||||
|
flac_mime_types,
|
||||||
};
|
};
|
26
src/decoder/FLACDecoderPlugin.h
Normal file
26
src/decoder/FLACDecoderPlugin.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
|
* http://www.musicpd.org
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MPD_DECODER_FLAC_H
|
||||||
|
#define MPD_DECODER_FLAC_H
|
||||||
|
|
||||||
|
extern const struct decoder_plugin flac_decoder_plugin;
|
||||||
|
extern const struct decoder_plugin oggflac_decoder_plugin;
|
||||||
|
|
||||||
|
#endif
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
* http://www.musicpd.org
|
* http://www.musicpd.org
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -18,10 +18,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "flac_metadata.h"
|
#include "FLACMetaData.hxx"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
#include "XiphTags.h"
|
#include "XiphTags.h"
|
||||||
#include "replay_gain_info.h"
|
#include "replay_gain_info.h"
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
|
}
|
||||||
|
|
||||||
#include "tag_handler.h"
|
#include "tag_handler.h"
|
||||||
#include "tag_table.h"
|
#include "tag_table.h"
|
||||||
|
|
||||||
@ -92,7 +96,7 @@ flac_find_string_comment(const FLAC__StreamMetadata *block,
|
|||||||
int len;
|
int len;
|
||||||
const unsigned char *p;
|
const unsigned char *p;
|
||||||
|
|
||||||
*str = NULL;
|
*str = nullptr;
|
||||||
offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, 0,
|
offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, 0,
|
||||||
cmnt);
|
cmnt);
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
@ -137,9 +141,9 @@ flac_comment_value(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
|||||||
|
|
||||||
if (entry->length <= name_length ||
|
if (entry->length <= name_length ||
|
||||||
g_ascii_strncasecmp(comment, name, name_length) != 0)
|
g_ascii_strncasecmp(comment, name, name_length) != 0)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
if (char_tnum != NULL) {
|
if (char_tnum != nullptr) {
|
||||||
char_tnum_length = strlen(char_tnum);
|
char_tnum_length = strlen(char_tnum);
|
||||||
if (entry->length > name_length + char_tnum_length + 2 &&
|
if (entry->length > name_length + char_tnum_length + 2 &&
|
||||||
comment[name_length] == '[' &&
|
comment[name_length] == '[' &&
|
||||||
@ -158,7 +162,7 @@ flac_comment_value(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
|||||||
return comment + name_length + 1;
|
return comment + name_length + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -175,7 +179,7 @@ flac_copy_comment(const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
|||||||
size_t value_length;
|
size_t value_length;
|
||||||
|
|
||||||
value = flac_comment_value(entry, name, char_tnum, &value_length);
|
value = flac_comment_value(entry, name, char_tnum, &value_length);
|
||||||
if (value != NULL) {
|
if (value != nullptr) {
|
||||||
char *p = g_strndup(value, value_length);
|
char *p = g_strndup(value, value_length);
|
||||||
tag_handler_invoke_tag(handler, handler_ctx, tag_type, p);
|
tag_handler_invoke_tag(handler, handler_ctx, tag_type, p);
|
||||||
g_free(p);
|
g_free(p);
|
||||||
@ -190,11 +194,11 @@ flac_scan_comment(const char *char_tnum,
|
|||||||
const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
const FLAC__StreamMetadata_VorbisComment_Entry *entry,
|
||||||
const struct tag_handler *handler, void *handler_ctx)
|
const struct tag_handler *handler, void *handler_ctx)
|
||||||
{
|
{
|
||||||
if (handler->pair != NULL) {
|
if (handler->pair != nullptr) {
|
||||||
char *name = g_strdup((const char*)entry->entry);
|
char *name = g_strdup((const char*)entry->entry);
|
||||||
char *value = strchr(name, '=');
|
char *value = strchr(name, '=');
|
||||||
|
|
||||||
if (value != NULL && value > name) {
|
if (value != nullptr && value > name) {
|
||||||
*value++ = 0;
|
*value++ = 0;
|
||||||
tag_handler_invoke_pair(handler, handler_ctx,
|
tag_handler_invoke_pair(handler, handler_ctx,
|
||||||
name, value);
|
name, value);
|
||||||
@ -203,14 +207,15 @@ flac_scan_comment(const char *char_tnum,
|
|||||||
g_free(name);
|
g_free(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const struct tag_table *i = xiph_tags; i->name != NULL; ++i)
|
for (const struct tag_table *i = xiph_tags; i->name != nullptr; ++i)
|
||||||
if (flac_copy_comment(entry, i->name, i->type, char_tnum,
|
if (flac_copy_comment(entry, i->name, i->type, char_tnum,
|
||||||
handler, handler_ctx))
|
handler, handler_ctx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i)
|
for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i)
|
||||||
if (flac_copy_comment(entry,
|
if (flac_copy_comment(entry,
|
||||||
tag_item_names[i], i, char_tnum,
|
tag_item_names[i], (enum tag_type)i,
|
||||||
|
char_tnum,
|
||||||
handler, handler_ctx))
|
handler, handler_ctx))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -260,7 +265,7 @@ flac_scan_file2(const char *file, const char *char_tnum,
|
|||||||
const struct tag_handler *handler, void *handler_ctx)
|
const struct tag_handler *handler, void *handler_ctx)
|
||||||
{
|
{
|
||||||
FLAC__Metadata_SimpleIterator *it;
|
FLAC__Metadata_SimpleIterator *it;
|
||||||
FLAC__StreamMetadata *block = NULL;
|
FLAC__StreamMetadata *block = nullptr;
|
||||||
|
|
||||||
it = FLAC__metadata_simple_iterator_new();
|
it = FLAC__metadata_simple_iterator_new();
|
||||||
if (!FLAC__metadata_simple_iterator_init(it, file, 1, 0)) {
|
if (!FLAC__metadata_simple_iterator_init(it, file, 1, 0)) {
|
||||||
@ -310,7 +315,7 @@ flac_tag_load(const char *file, const char *char_tnum)
|
|||||||
if (!flac_scan_file2(file, char_tnum, &add_tag_handler, tag) ||
|
if (!flac_scan_file2(file, char_tnum, &add_tag_handler, tag) ||
|
||||||
tag_is_empty(tag)) {
|
tag_is_empty(tag)) {
|
||||||
tag_free(tag);
|
tag_free(tag);
|
||||||
tag = NULL;
|
tag = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tag;
|
return tag;
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
* http://www.musicpd.org
|
* http://www.musicpd.org
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
* http://www.musicpd.org
|
* http://www.musicpd.org
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "flac_pcm.h"
|
#include "FLAC_PCM.hxx"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2003-2011 The Music Player Daemon Project
|
* Copyright (C) 2003-2012 The Music Player Daemon Project
|
||||||
* http://www.musicpd.org
|
* http://www.musicpd.org
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -17,8 +17,8 @@
|
|||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MPD_FLAC_PCM_H
|
#ifndef MPD_FLAC_PCM_HXX
|
||||||
#define MPD_FLAC_PCM_H
|
#define MPD_FLAC_PCM_HXX
|
||||||
|
|
||||||
#include "audio_format.h"
|
#include "audio_format.h"
|
||||||
|
|
@ -26,6 +26,7 @@
|
|||||||
#include "decoder/pcm_decoder_plugin.h"
|
#include "decoder/pcm_decoder_plugin.h"
|
||||||
#include "decoder/dsdiff_decoder_plugin.h"
|
#include "decoder/dsdiff_decoder_plugin.h"
|
||||||
#include "decoder/dsf_decoder_plugin.h"
|
#include "decoder/dsf_decoder_plugin.h"
|
||||||
|
#include "decoder/FLACDecoderPlugin.h"
|
||||||
#include "decoder/OpusDecoderPlugin.h"
|
#include "decoder/OpusDecoderPlugin.h"
|
||||||
#include "decoder/AdPlugDecoderPlugin.h"
|
#include "decoder/AdPlugDecoderPlugin.h"
|
||||||
|
|
||||||
@ -36,8 +37,6 @@
|
|||||||
extern const struct decoder_plugin mad_decoder_plugin;
|
extern const struct decoder_plugin mad_decoder_plugin;
|
||||||
extern const struct decoder_plugin mpg123_decoder_plugin;
|
extern const struct decoder_plugin mpg123_decoder_plugin;
|
||||||
extern const struct decoder_plugin vorbis_decoder_plugin;
|
extern const struct decoder_plugin vorbis_decoder_plugin;
|
||||||
extern const struct decoder_plugin flac_decoder_plugin;
|
|
||||||
extern const struct decoder_plugin oggflac_decoder_plugin;
|
|
||||||
extern const struct decoder_plugin sndfile_decoder_plugin;
|
extern const struct decoder_plugin sndfile_decoder_plugin;
|
||||||
extern const struct decoder_plugin audiofile_decoder_plugin;
|
extern const struct decoder_plugin audiofile_decoder_plugin;
|
||||||
extern const struct decoder_plugin mp4ff_decoder_plugin;
|
extern const struct decoder_plugin mp4ff_decoder_plugin;
|
||||||
|
Loading…
Reference in New Issue
Block a user