Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
39060b52
Commit
39060b52
authored
Jan 07, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/vorbis: convert to C++
parent
4a36323f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
23 deletions
+58
-23
Makefile.am
Makefile.am
+2
-3
VorbisComments.cxx
src/decoder/VorbisComments.cxx
+3
-3
VorbisComments.hxx
src/decoder/VorbisComments.hxx
+3
-3
VorbisDecoderPlugin.cxx
src/decoder/VorbisDecoderPlugin.cxx
+24
-13
VorbisDecoderPlugin.h
src/decoder/VorbisDecoderPlugin.h
+25
-0
decoder_list.c
src/decoder_list.c
+1
-1
No files found.
Makefile.am
View file @
39060b52
...
...
@@ -566,9 +566,8 @@ endif
if
ENABLE_VORBIS_DECODER
libdecoder_plugins_a_SOURCES
+=
\
src/decoder/vorbis_comments.c
\
src/decoder/vorbis_comments.h
\
src/decoder/vorbis_decoder_plugin.c
src/decoder/VorbisComments.cxx src/decoder/VorbisComments.hxx
\
src/decoder/VorbisDecoderPlugin.cxx src/decoder/VorbisDecoderPlugin.h
endif
if
HAVE_FLAC
...
...
src/decoder/
vorbis_comments.c
→
src/decoder/
VorbisComments.cxx
View file @
39060b52
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
vorbis_comments.h
"
#include "
VorbisComments.hxx
"
#include "XiphTags.h"
#include "tag.h"
#include "tag_table.h"
...
...
@@ -120,7 +120,7 @@ vorbis_scan_comment(const char *comment,
for
(
unsigned
i
=
0
;
i
<
TAG_NUM_OF_ITEM_TYPES
;
++
i
)
if
(
vorbis_copy_comment
(
comment
,
tag_item_names
[
i
],
i
,
tag_item_names
[
i
],
tag_type
(
i
)
,
handler
,
handler_ctx
))
return
;
}
...
...
src/decoder/
vorbis_comments.h
→
src/decoder/
VorbisComments.hxx
View file @
39060b52
/*
* Copyright (C) 2003-201
2
The Music Player Daemon Project
* Copyright (C) 2003-201
3
The Music Player Daemon Project
* http://www.musicpd.org
*
* 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.
*/
#ifndef MPD_VORBIS_COMMENTS_H
#define MPD_VORBIS_COMMENTS_H
#ifndef MPD_VORBIS_COMMENTS_H
XX
#define MPD_VORBIS_COMMENTS_H
XX
#include "check.h"
...
...
src/decoder/
vorbis_decoder_plugin.c
→
src/decoder/
VorbisDecoderPlugin.cxx
View file @
39060b52
...
...
@@ -18,10 +18,16 @@
*/
#include "config.h"
#include "vorbis_comments.h"
#include "VorbisDecoderPlugin.h"
#include "VorbisComments.hxx"
#include "decoder_api.h"
extern
"C"
{
#include "ogg_codec.h"
#include "audio_check.h"
#include "uri.h"
}
#include "tag_handler.h"
#ifndef HAVE_TREMOR
...
...
@@ -64,7 +70,7 @@ struct vorbis_input_stream {
static
size_t
ogg_read_cb
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
void
*
data
)
{
struct
vorbis_input_stream
*
vis
=
data
;
struct
vorbis_input_stream
*
vis
=
(
struct
vorbis_input_stream
*
)
data
;
size_t
ret
=
decoder_read
(
vis
->
decoder
,
vis
->
input_stream
,
ptr
,
size
*
nmemb
);
...
...
@@ -75,7 +81,7 @@ static size_t ogg_read_cb(void *ptr, size_t size, size_t nmemb, void *data)
static
int
ogg_seek_cb
(
void
*
data
,
ogg_int64_t
offset
,
int
whence
)
{
struct
vorbis_input_stream
*
vis
=
data
;
struct
vorbis_input_stream
*
vis
=
(
struct
vorbis_input_stream
*
)
data
;
return
vis
->
seekable
&&
(
!
vis
->
decoder
||
decoder_get_command
(
vis
->
decoder
)
!=
DECODE_COMMAND_STOP
)
&&
...
...
@@ -91,16 +97,16 @@ static int ogg_close_cb(G_GNUC_UNUSED void *data)
static
long
ogg_tell_cb
(
void
*
data
)
{
const
struct
vorbis_input_stream
*
vis
=
data
;
struct
vorbis_input_stream
*
vis
=
(
struct
vorbis_input_stream
*
)
data
;
return
(
long
)
vis
->
input_stream
->
offset
;
}
static
const
ov_callbacks
vorbis_is_callbacks
=
{
.
read_func
=
ogg_read_cb
,
.
seek_func
=
ogg_seek_cb
,
.
close_func
=
ogg_close_cb
,
.
tell_func
=
ogg_tell_cb
,
ogg_read_cb
,
ogg_seek_cb
,
ogg_close_cb
,
ogg_tell_cb
,
};
static
const
char
*
...
...
@@ -343,9 +349,14 @@ static const char *const vorbis_mime_types[] = {
};
const
struct
decoder_plugin
vorbis_decoder_plugin
=
{
.
name
=
"vorbis"
,
.
stream_decode
=
vorbis_stream_decode
,
.
scan_stream
=
vorbis_scan_stream
,
.
suffixes
=
vorbis_suffixes
,
.
mime_types
=
vorbis_mime_types
"vorbis"
,
nullptr
,
nullptr
,
vorbis_stream_decode
,
nullptr
,
nullptr
,
vorbis_scan_stream
,
nullptr
,
vorbis_suffixes
,
vorbis_mime_types
};
src/decoder/VorbisDecoderPlugin.h
0 → 100644
View file @
39060b52
/*
* 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_VORBIS_H
#define MPD_DECODER_VORBIS_H
extern
const
struct
decoder_plugin
vorbis_decoder_plugin
;
#endif
src/decoder_list.c
View file @
39060b52
...
...
@@ -28,6 +28,7 @@
#include "decoder/dsf_decoder_plugin.h"
#include "decoder/FLACDecoderPlugin.h"
#include "decoder/OpusDecoderPlugin.h"
#include "decoder/VorbisDecoderPlugin.h"
#include "decoder/AdPlugDecoderPlugin.h"
#include <glib.h>
...
...
@@ -36,7 +37,6 @@
extern
const
struct
decoder_plugin
mad_decoder_plugin
;
extern
const
struct
decoder_plugin
mpg123_decoder_plugin
;
extern
const
struct
decoder_plugin
vorbis_decoder_plugin
;
extern
const
struct
decoder_plugin
sndfile_decoder_plugin
;
extern
const
struct
decoder_plugin
audiofile_decoder_plugin
;
extern
const
struct
decoder_plugin
mp4ff_decoder_plugin
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment