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
6b6d9e64
Commit
6b6d9e64
authored
Jul 28, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/pcm: convert to C++
parent
f016a99f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
18 deletions
+28
-18
Makefile.am
Makefile.am
+2
-2
DecoderList.cxx
src/DecoderList.cxx
+1
-1
PcmDecoderPlugin.cxx
src/decoder/PcmDecoderPlugin.cxx
+22
-12
PcmDecoderPlugin.hxx
src/decoder/PcmDecoderPlugin.hxx
+3
-3
No files found.
Makefile.am
View file @
6b6d9e64
...
...
@@ -68,7 +68,6 @@ mpd_headers = \
src/gerror.h
\
src/glib_compat.h
\
src/gcc.h
\
src/decoder/pcm_decoder_plugin.h
\
src/input_stream.h
\
src/TextInputStream.hxx
\
src/ls.h
\
...
...
@@ -447,7 +446,8 @@ endif
# decoder plugins
libdecoder_plugins_a_SOURCES
=
\
src/decoder/pcm_decoder_plugin.c
\
src/decoder/PcmDecoderPlugin.cxx
\
src/decoder/PcmDecoderPlugin.hxx
\
src/decoder/DsdiffDecoderPlugin.cxx
\
src/decoder/DsdiffDecoderPlugin.hxx
\
src/decoder/DsfDecoderPlugin.cxx
\
...
...
src/DecoderList.cxx
View file @
6b6d9e64
...
...
@@ -23,7 +23,7 @@
#include "conf.h"
#include "mpd_error.h"
#include "decoder/AudiofileDecoderPlugin.hxx"
#include "decoder/
pcm_decoder_plugin.h
"
#include "decoder/
PcmDecoderPlugin.hxx
"
#include "decoder/DsdiffDecoderPlugin.hxx"
#include "decoder/DsfDecoderPlugin.hxx"
#include "decoder/FlacDecoderPlugin.h"
...
...
src/decoder/
pcm_decoder_plugin.c
→
src/decoder/
PcmDecoderPlugin.cxx
View file @
6b6d9e64
/*
* Copyright (C) 2003-201
1
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,9 +18,12 @@
*/
#include "config.h"
#include "decoder/
pcm_decoder_plugin.h
"
#include "decoder/
PcmDecoderPlugin.hxx
"
#include "decoder_api.h"
extern
"C"
{
#include "util/byte_reverse.h"
}
#include <glib.h>
#include <unistd.h>
...
...
@@ -32,17 +35,17 @@
static
void
pcm_stream_decode
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
)
{
static
const
struct
audio_format
audio_format
=
{
.
sample_rate
=
44100
,
.
format
=
SAMPLE_FORMAT_S16
,
.
channels
=
2
,
static
const
expr
struct
audio_format
audio_format
=
{
44100
,
SAMPLE_FORMAT_S16
,
2
,
};
const
char
*
const
mime
=
input_stream_get_mime_type
(
is
);
const
bool
reverse_endian
=
mime
!=
NULL
&&
const
bool
reverse_endian
=
mime
!=
nullptr
&&
strcmp
(
mime
,
"audio/x-mpd-cdda-pcm-reverse"
)
==
0
;
GError
*
error
=
NULL
;
GError
*
error
=
nullptr
;
enum
decoder_command
cmd
;
double
time_to_size
=
audio_format_time_to_size
(
&
audio_format
);
...
...
@@ -98,11 +101,18 @@ static const char *const pcm_mime_types[] = {
/* same as above, but with reverse byte order */
"audio/x-mpd-cdda-pcm-reverse"
,
NULL
nullptr
};
const
struct
decoder_plugin
pcm_decoder_plugin
=
{
.
name
=
"pcm"
,
.
stream_decode
=
pcm_stream_decode
,
.
mime_types
=
pcm_mime_types
,
"pcm"
,
nullptr
,
nullptr
,
pcm_stream_decode
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
nullptr
,
pcm_mime_types
,
};
src/decoder/
pcm_decoder_plugin.h
→
src/decoder/
PcmDecoderPlugin.hxx
View file @
6b6d9e64
/*
* Copyright (C) 2003-201
1
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
...
...
@@ -25,8 +25,8 @@
* which does not need a decoder.
*/
#ifndef MPD_DECODER_PCM_H
#define MPD_DECODER_PCM_H
#ifndef MPD_DECODER_PCM_H
XX
#define MPD_DECODER_PCM_H
XX
extern
const
struct
decoder_plugin
pcm_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