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
f016a99f
Commit
f016a99f
authored
Jul 28, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mpcdec: convert to C++
parent
2eed9d64
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
12 deletions
+46
-12
Makefile.am
Makefile.am
+3
-1
DecoderList.cxx
src/DecoderList.cxx
+1
-1
MpcdecDecoderPlugin.cxx
src/decoder/MpcdecDecoderPlugin.cxx
+17
-10
MpcdecDecoderPlugin.hxx
src/decoder/MpcdecDecoderPlugin.hxx
+25
-0
No files found.
Makefile.am
View file @
f016a99f
...
...
@@ -510,7 +510,9 @@ libdecoder_plugins_a_SOURCES += \
endif
if
HAVE_MPCDEC
libdecoder_plugins_a_SOURCES
+=
src/decoder/mpcdec_decoder_plugin.c
libdecoder_plugins_a_SOURCES
+=
\
src/decoder/MpcdecDecoderPlugin.cxx
\
src/decoder/MpcdecDecoderPlugin.hxx
endif
if
HAVE_OPUS
...
...
src/DecoderList.cxx
View file @
f016a99f
...
...
@@ -40,12 +40,12 @@
#include "decoder/WildmidiDecoderPlugin.hxx"
#include "decoder/MikmodDecoderPlugin.hxx"
#include "decoder/ModplugDecoderPlugin.hxx"
#include "decoder/MpcdecDecoderPlugin.hxx"
#include <glib.h>
#include <string.h>
extern
const
struct
decoder_plugin
mpcdec_decoder_plugin
;
extern
const
struct
decoder_plugin
sidplay_decoder_plugin
;
extern
const
struct
decoder_plugin
fluidsynth_decoder_plugin
;
...
...
src/decoder/
mpcdec_decoder_plugin.c
→
src/decoder/
MpcdecDecoderPlugin.cxx
View file @
f016a99f
...
...
@@ -18,6 +18,7 @@
*/
#include "config.h"
#include "MpcdecDecoderPlugin.hxx"
#include "decoder_api.h"
#include "audio_check.h"
#include "tag_handler.h"
...
...
@@ -62,7 +63,7 @@ mpc_seek_cb(cb_first_arg, mpc_int32_t offset)
{
struct
mpc_decoder_data
*
data
=
(
struct
mpc_decoder_data
*
)
cb_data
;
return
input_stream_lock_seek
(
data
->
is
,
offset
,
SEEK_SET
,
NULL
);
return
input_stream_lock_seek
(
data
->
is
,
offset
,
SEEK_SET
,
nullptr
);
}
static
mpc_int32_t
...
...
@@ -144,7 +145,7 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
#endif
mpc_reader
reader
;
mpc_streaminfo
info
;
GError
*
error
=
NULL
;
GError
*
error
=
nullptr
;
struct
audio_format
audio_format
;
struct
mpc_decoder_data
data
;
...
...
@@ -185,7 +186,7 @@ mpcdec_decode(struct decoder *mpd_decoder, struct input_stream *is)
}
#else
demux
=
mpc_demux_init
(
&
reader
);
if
(
demux
==
NULL
)
{
if
(
demux
==
nullptr
)
{
if
(
decoder_get_command
(
mpd_decoder
)
!=
DECODE_COMMAND_STOP
)
g_warning
(
"Not a valid musepack stream"
);
return
;
...
...
@@ -296,7 +297,7 @@ mpcdec_get_file_duration(struct input_stream *is)
struct
mpc_decoder_data
data
;
data
.
is
=
is
;
data
.
decoder
=
NULL
;
data
.
decoder
=
nullptr
;
reader
.
read
=
mpc_read_cb
;
reader
.
seek
=
mpc_seek_cb
;
...
...
@@ -312,7 +313,7 @@ mpcdec_get_file_duration(struct input_stream *is)
return
-
1
;
#else
demux
=
mpc_demux_init
(
&
reader
);
if
(
demux
==
NULL
)
if
(
demux
==
nullptr
)
return
-
1
;
mpc_demux_get_info
(
demux
,
&
info
);
...
...
@@ -337,11 +338,17 @@ mpcdec_scan_stream(struct input_stream *is,
return
true
;
}
static
const
char
*
const
mpcdec_suffixes
[]
=
{
"mpc"
,
NULL
};
static
const
char
*
const
mpcdec_suffixes
[]
=
{
"mpc"
,
nullptr
};
const
struct
decoder_plugin
mpcdec_decoder_plugin
=
{
.
name
=
"mpcdec"
,
.
stream_decode
=
mpcdec_decode
,
.
scan_stream
=
mpcdec_scan_stream
,
.
suffixes
=
mpcdec_suffixes
,
"mpcdec"
,
nullptr
,
nullptr
,
mpcdec_decode
,
nullptr
,
nullptr
,
mpcdec_scan_stream
,
nullptr
,
mpcdec_suffixes
,
nullptr
,
};
src/decoder/MpcdecDecoderPlugin.hxx
0 → 100644
View file @
f016a99f
/*
* Copyright (C) 2003-2013 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_MPCDEC_HXX
#define MPD_DECODER_MPCDEC_HXX
extern
const
struct
decoder_plugin
mpcdec_decoder_plugin
;
#endif
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