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
ee16fc95
Commit
ee16fc95
authored
Feb 11, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/{mikmod,fluidsynth,mp4ff}: adapt to tag_handler API
Fixes build regression.
parent
5d73215a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
26 deletions
+28
-26
fluidsynth_decoder_plugin.c
src/decoder/fluidsynth_decoder_plugin.c
+6
-6
mikmod_decoder_plugin.c
src/decoder/mikmod_decoder_plugin.c
+9
-10
mp4ff_decoder_plugin.c
src/decoder/mp4ff_decoder_plugin.c
+13
-10
No files found.
src/decoder/fluidsynth_decoder_plugin.c
View file @
ee16fc95
...
...
@@ -219,15 +219,15 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
delete_fluid_settings
(
settings
);
}
static
struct
tag
*
fluidsynth_tag_dup
(
const
char
*
file
)
static
bool
fluidsynth_scan_file
(
const
char
*
file
,
G_GNUC_UNUSED
const
struct
tag_handler
*
handler
,
G_GNUC_UNUSED
void
*
handler_ctx
)
{
struct
tag
*
tag
=
tag_new
();
/* to be implemented */
(
void
)
file
;
return
t
ag
;
return
t
rue
;
}
static
const
char
*
const
fluidsynth_suffixes
[]
=
{
...
...
@@ -239,6 +239,6 @@ const struct decoder_plugin fluidsynth_decoder_plugin = {
.
name
=
"fluidsynth"
,
.
init
=
fluidsynth_init
,
.
file_decode
=
fluidsynth_file_decode
,
.
tag_dup
=
fluidsynth_tag_dup
,
.
scan_file
=
fluidsynth_scan_file
,
.
suffixes
=
fluidsynth_suffixes
,
};
src/decoder/mikmod_decoder_plugin.c
View file @
ee16fc95
...
...
@@ -20,6 +20,7 @@
#include "config.h"
#include "decoder_api.h"
#include "mpd_error.h"
#include "tag_handler.h"
#include <glib.h>
#include <mikmod.h>
...
...
@@ -177,8 +178,9 @@ mikmod_decoder_file_decode(struct decoder *decoder, const char *path_fs)
Player_Free
(
handle
);
}
static
struct
tag
*
mikmod_decoder_tag_dup
(
const
char
*
path_fs
)
static
bool
mikmod_decoder_scan_file
(
const
char
*
path_fs
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
char
*
path2
=
g_strdup
(
path_fs
);
MODULE
*
handle
=
Player_Load
(
path2
,
128
,
0
);
...
...
@@ -186,25 +188,22 @@ mikmod_decoder_tag_dup(const char *path_fs)
if
(
handle
==
NULL
)
{
g_free
(
path2
);
g_debug
(
"Failed to open file: %s"
,
path_fs
);
return
NULL
;
return
false
;
}
Player_Free
(
handle
);
struct
tag
*
tag
=
tag_new
();
tag
->
time
=
0
;
char
*
title
=
Player_LoadTitle
(
path2
);
g_free
(
path2
);
if
(
title
!=
NULL
)
{
tag_add_item
(
tag
,
TAG_TITLE
,
title
);
tag_handler_invoke_tag
(
handler
,
handler_ctx
,
TAG_TITLE
,
title
);
free
(
title
);
}
return
t
ag
;
return
t
rue
;
}
static
const
char
*
const
mikmod_decoder_suffixes
[]
=
{
...
...
@@ -231,6 +230,6 @@ const struct decoder_plugin mikmod_decoder_plugin = {
.
init
=
mikmod_decoder_init
,
.
finish
=
mikmod_decoder_finish
,
.
file_decode
=
mikmod_decoder_file_decode
,
.
tag_dup
=
mikmod_decoder_tag_dup
,
.
scan_file
=
mikmod_decoder_scan_file
,
.
suffixes
=
mikmod_decoder_suffixes
,
};
src/decoder/mp4ff_decoder_plugin.c
View file @
ee16fc95
...
...
@@ -21,6 +21,7 @@
#include "decoder_api.h"
#include "audio_check.h"
#include "tag_table.h"
#include "tag_handler.h"
#include <glib.h>
...
...
@@ -377,8 +378,9 @@ mp4ff_tag_name_parse(const char *name)
return
type
;
}
static
struct
tag
*
mp4_stream_tag
(
struct
input_stream
*
is
)
static
bool
mp4ff_scan_stream
(
struct
input_stream
*
is
,
const
struct
tag_handler
*
handler
,
void
*
handler_ctx
)
{
struct
mp4ff_input_stream
mis
;
int32_t
track
;
...
...
@@ -388,23 +390,23 @@ mp4_stream_tag(struct input_stream *is)
mp4ff_t
*
mp4fh
=
mp4ff_input_stream_open
(
&
mis
,
NULL
,
is
);
if
(
mp4fh
==
NULL
)
return
NULL
;
return
false
;
track
=
mp4_get_aac_track
(
mp4fh
,
NULL
,
NULL
,
NULL
);
if
(
track
<
0
)
{
mp4ff_close
(
mp4fh
);
return
NULL
;
return
false
;
}
file_time
=
mp4ff_get_track_duration_use_offsets
(
mp4fh
,
track
);
scale
=
mp4ff_time_scale
(
mp4fh
,
track
);
if
(
scale
<
0
)
{
mp4ff_close
(
mp4fh
);
return
NULL
;
return
false
;
}
struct
tag
*
tag
=
tag_new
();
tag
->
time
=
((
float
)
file_time
)
/
scale
+
0
.
5
;
tag_handler_invoke_duration
(
handler
,
handler_ctx
,
((
float
)
file_time
)
/
scale
+
0
.
5
)
;
for
(
i
=
0
;
i
<
mp4ff_meta_get_num_items
(
mp4fh
);
i
++
)
{
char
*
item
;
...
...
@@ -414,7 +416,8 @@ mp4_stream_tag(struct input_stream *is)
enum
tag_type
type
=
mp4ff_tag_name_parse
(
item
);
if
(
type
!=
TAG_NUM_OF_ITEM_TYPES
)
tag_add_item
(
tag
,
type
,
value
);
tag_handler_invoke_tag
(
handler
,
handler_ctx
,
type
,
value
);
free
(
item
);
free
(
value
);
...
...
@@ -422,7 +425,7 @@ mp4_stream_tag(struct input_stream *is)
mp4ff_close
(
mp4fh
);
return
t
ag
;
return
t
rue
;
}
static
const
char
*
const
mp4_suffixes
[]
=
{
...
...
@@ -437,7 +440,7 @@ static const char *const mp4_mime_types[] = { "audio/mp4", "audio/m4a", NULL };
const
struct
decoder_plugin
mp4ff_decoder_plugin
=
{
.
name
=
"mp4ff"
,
.
stream_decode
=
mp4_decode
,
.
s
tream_tag
=
mp4_stream_tag
,
.
s
can_stream
=
mp4ff_scan_stream
,
.
suffixes
=
mp4_suffixes
,
.
mime_types
=
mp4_mime_types
,
};
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