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
5036368f
Commit
5036368f
authored
Nov 01, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: return const decoder_plugin structs
The decoder_plugin structs must never change. Don't work with non-const pointers.
parent
83f6222a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
20 deletions
+24
-20
decoder_internal.h
src/decoder_internal.h
+1
-1
decoder_list.c
src/decoder_list.c
+8
-7
decoder_list.h
src/decoder_list.h
+8
-7
decoder_thread.c
src/decoder_thread.c
+1
-1
ls.c
src/ls.c
+3
-2
ls.h
src/ls.h
+2
-1
song.c
src/song.c
+1
-1
No files found.
src/decoder_internal.h
View file @
5036368f
...
...
@@ -23,7 +23,7 @@
#include "pcm_utils.h"
struct
decoder
{
struct
decoder_plugin
*
plugin
;
const
struct
decoder_plugin
*
plugin
;
struct
pcm_convert_state
conv_state
;
...
...
src/decoder_list.c
View file @
5036368f
...
...
@@ -65,12 +65,12 @@ static int stringFoundInStringArray(const char *const*array, const char *suffix)
return
0
;
}
struct
decoder_plugin
*
decoder_plugin_from_suffix
(
const
char
*
suffix
,
unsigned
int
next
)
const
struct
decoder_plugin
*
decoder_plugin_from_suffix
(
const
char
*
suffix
,
unsigned
int
next
)
{
static
ListNode
*
pos
;
ListNode
*
node
;
struct
decoder_plugin
*
plugin
;
const
struct
decoder_plugin
*
plugin
;
if
(
suffix
==
NULL
)
return
NULL
;
...
...
@@ -95,8 +95,8 @@ struct decoder_plugin *decoder_plugin_from_suffix(const char *suffix,
return
NULL
;
}
struct
decoder_plugin
*
decoder_plugin_from_mime_type
(
const
char
*
mimeType
,
unsigned
int
next
)
const
struct
decoder_plugin
*
decoder_plugin_from_mime_type
(
const
char
*
mimeType
,
unsigned
int
next
)
{
static
ListNode
*
pos
;
ListNode
*
node
;
...
...
@@ -119,13 +119,14 @@ struct decoder_plugin *decoder_plugin_from_mime_type(const char *mimeType,
return
NULL
;
}
struct
decoder_plugin
*
decoder_plugin_from_name
(
const
char
*
name
)
const
struct
decoder_plugin
*
decoder_plugin_from_name
(
const
char
*
name
)
{
void
*
plugin
=
NULL
;
findInList
(
inputPlugin_list
,
name
,
&
plugin
);
return
(
struct
decoder_plugin
*
)
plugin
;
return
(
const
struct
decoder_plugin
*
)
plugin
;
}
void
decoder_plugin_print_all_suffixes
(
FILE
*
fp
)
...
...
src/decoder_list.h
View file @
5036368f
...
...
@@ -24,18 +24,19 @@
struct
decoder_plugin
;
/* individual functions to load/unload plugins */
void
decoder_plugin_load
(
struct
decoder_plugin
*
inputPlugin
);
void
decoder_plugin_unload
(
struct
decoder_plugin
*
inputPlugin
);
void
decoder_plugin_load
(
struct
decoder_plugin
*
inputPlugin
);
void
decoder_plugin_unload
(
struct
decoder_plugin
*
inputPlugin
);
/* interface for using plugins */
struct
decoder_plugin
*
decoder_plugin_from_suffix
(
const
char
*
suffix
,
unsigned
int
next
);
const
struct
decoder_plugin
*
decoder_plugin_from_suffix
(
const
char
*
suffix
,
unsigned
int
next
);
struct
decoder_plugin
*
decoder_plugin_from_mime_type
(
const
char
*
mimeType
,
unsigned
int
next
);
const
struct
decoder_plugin
*
decoder_plugin_from_mime_type
(
const
char
*
mimeType
,
unsigned
int
next
);
struct
decoder_plugin
*
decoder_plugin_from_name
(
const
char
*
name
);
const
struct
decoder_plugin
*
decoder_plugin_from_name
(
const
char
*
name
);
void
decoder_plugin_print_all_suffixes
(
FILE
*
fp
);
...
...
src/decoder_thread.c
View file @
5036368f
...
...
@@ -37,7 +37,7 @@ static void decodeStart(void)
int
ret
;
bool
close_instream
=
true
;
struct
input_stream
inStream
;
struct
decoder_plugin
*
plugin
=
NULL
;
const
struct
decoder_plugin
*
plugin
;
if
(
song_is_file
(
song
))
uri
=
map_song_fs
(
song
,
buffer
);
...
...
src/ls.c
View file @
5036368f
...
...
@@ -113,9 +113,10 @@ const char *getSuffix(const char *utf8file)
return
ret
;
}
struct
decoder_plugin
*
hasMusicSuffix
(
const
char
*
utf8file
,
unsigned
int
next
)
const
struct
decoder_plugin
*
hasMusicSuffix
(
const
char
*
utf8file
,
unsigned
int
next
)
{
struct
decoder_plugin
*
ret
=
NULL
;
const
struct
decoder_plugin
*
ret
=
NULL
;
const
char
*
s
=
getSuffix
(
utf8file
);
if
(
s
)
{
...
...
src/ls.h
View file @
5036368f
...
...
@@ -32,7 +32,8 @@ int isValidRemoteUtf8Url(const char *utf8url);
int
isRemoteUrl
(
const
char
*
url
);
struct
decoder_plugin
*
hasMusicSuffix
(
const
char
*
utf8file
,
unsigned
int
next
);
const
struct
decoder_plugin
*
hasMusicSuffix
(
const
char
*
utf8file
,
unsigned
int
next
);
int
printRemoteUrlHandlers
(
struct
client
*
client
);
...
...
src/song.c
View file @
5036368f
...
...
@@ -96,7 +96,7 @@ song_file_update(struct song *song)
{
char
buffer
[
MPD_PATH_MAX
];
const
char
*
path_fs
;
struct
decoder_plugin
*
plugin
;
const
struct
decoder_plugin
*
plugin
;
unsigned
int
next
=
0
;
struct
stat
st
;
...
...
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