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
d5574080
Commit
d5574080
authored
May 31, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/gme: added constants for sample rate and channels
Move into enums.
parent
6566038d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
gme_decoder_plugin.c
src/decoder/gme_decoder_plugin.c
+12
-6
No files found.
src/decoder/gme_decoder_plugin.c
View file @
d5574080
...
...
@@ -10,10 +10,14 @@
#define GME_BUF_SIZE 4096
enum
{
GME_SAMPLE_RATE
=
44100
,
GME_CHANNELS
=
2
,
};
static
void
gme_file_decode
(
struct
decoder
*
decoder
,
const
char
*
path_fs
)
{
int
sample_rate
=
44100
;
int
track
=
0
;
/* index of track to play */
float
song_len
;
Music_Emu
*
emu
;
...
...
@@ -23,7 +27,8 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
short
buf
[
GME_BUF_SIZE
];
const
char
*
gme_err
;
if
((
gme_err
=
gme_open_file
(
path_fs
,
&
emu
,
sample_rate
))
!=
NULL
){
gme_err
=
gme_open_file
(
path_fs
,
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
NULL
)
{
g_warning
(
"%s"
,
gme_err
);
return
;
}
...
...
@@ -40,8 +45,9 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
/* initialize the MPD decoder */
GError
*
error
=
NULL
;
if
(
!
audio_format_init_checked
(
&
audio_format
,
sample_rate
,
SAMPLE_FORMAT_S16
,
2
,
&
error
)){
if
(
!
audio_format_init_checked
(
&
audio_format
,
GME_SAMPLE_RATE
,
SAMPLE_FORMAT_S16
,
GME_CHANNELS
,
&
error
))
{
g_warning
(
"%s"
,
error
->
message
);
g_error_free
(
error
);
gme_free_info
(
ti
);
...
...
@@ -80,12 +86,12 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
static
struct
tag
*
gme_tag_dup
(
const
char
*
path_fs
)
{
int
sample_rate
=
44100
;
Music_Emu
*
emu
;
gme_info_t
*
ti
;
const
char
*
gme_err
;
if
((
gme_err
=
gme_open_file
(
path_fs
,
&
emu
,
sample_rate
))
!=
NULL
){
gme_err
=
gme_open_file
(
path_fs
,
&
emu
,
GME_SAMPLE_RATE
);
if
(
gme_err
!=
NULL
)
{
g_warning
(
"%s"
,
gme_err
);
return
NULL
;
}
...
...
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