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
1648c7aa
Commit
1648c7aa
authored
Nov 14, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mikmod: sample rate is configurable
The new option "sample_rate" sets the sample rate for libmikmod.
parent
edaf0179
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
4 deletions
+42
-4
NEWS
NEWS
+1
-0
user.xml
doc/user.xml
+29
-1
mikmod_plugin.c
src/decoder/mikmod_plugin.c
+12
-3
No files found.
NEWS
View file @
1648c7aa
...
...
@@ -20,6 +20,7 @@ ver 0.16 (20??/??/??)
- ffmpeg: convert metadata to generic format
- sndfile: new decoder plugin based on libsndfile
- flac: load external cue sheet when no internal one
- mikmod: sample rate is configurable
- mpg123: new decoder plugin based on libmpg123
- sidplay: support sub-tunes
- sidplay: implemented songlength database
...
...
doc/user.xml
View file @
1648c7aa
...
...
@@ -590,7 +590,35 @@ cd mpd-version</programlisting>
<section>
<title>
Decoder plugins
</title>
<para></para>
<section>
<title><varname>
mikmod
</varname></title>
<para>
Module player based on MikMod.
</para>
<informaltable>
<tgroup
cols=
"2"
>
<thead>
<row>
<entry>
Setting
</entry>
<entry>
Description
</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<varname>
sample_rate
</varname>
</entry>
<entry>
Sets the sample rate generated by
<filename>
libmikmod
</filename>
. Default is 44100.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
<section>
...
...
src/decoder/mikmod_plugin.c
View file @
1648c7aa
...
...
@@ -100,11 +100,20 @@ static MDRIVER drv_mpd = {
VC_VoiceRealVolume
};
static
unsigned
mikmod_sample_rate
;
static
bool
mikmod_decoder_init
(
G_GNUC_UNUSED
const
struct
config_param
*
param
)
mikmod_decoder_init
(
const
struct
config_param
*
param
)
{
unsigned
sample_rate
;
static
char
params
[]
=
""
;
mikmod_sample_rate
=
config_get_block_unsigned
(
param
,
"sample_rate"
,
44100
);
if
(
!
audio_valid_sample_rate
(
mikmod_sample_rate
))
g_error
(
"Invalid sample rate in line %d: %u"
,
param
->
line
,
sample_rate
);
md_device
=
0
;
md_reverb
=
0
;
...
...
@@ -112,7 +121,7 @@ mikmod_decoder_init(G_GNUC_UNUSED const struct config_param *param)
MikMod_RegisterAllLoaders
();
md_pansep
=
64
;
md_mixfreq
=
44100
;
md_mixfreq
=
mikmod_sample_rate
;
md_mode
=
(
DMODE_SOFT_MUSIC
|
DMODE_INTERP
|
DMODE_STEREO
|
DMODE_16BITS
);
...
...
@@ -155,7 +164,7 @@ mikmod_decoder_file_decode(struct decoder *decoder, const char *path_fs)
/* Prevent module from looping forever */
handle
->
loop
=
0
;
audio_format_init
(
&
audio_format
,
44100
,
16
,
2
);
audio_format_init
(
&
audio_format
,
mikmod_sample_rate
,
16
,
2
);
assert
(
audio_format_valid
(
&
audio_format
));
secPerByte
=
...
...
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