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
7fc25ad5
Commit
7fc25ad5
authored
Feb 09, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shout: don't postpone metadata
Don't duplicate the tag received by the send_metadata() method - send it to the shout server directly.
parent
f5c43889
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
34 deletions
+15
-34
NEWS
NEWS
+1
-0
shout_mp3.c
src/output/shout_mp3.c
+1
-1
shout_plugin.c
src/output/shout_plugin.c
+12
-32
shout_plugin.h
src/output/shout_plugin.h
+1
-1
No files found.
NEWS
View file @
7fc25ad5
...
@@ -49,6 +49,7 @@ ver 0.14.2 (2009/??/??)
...
@@ -49,6 +49,7 @@ ver 0.14.2 (2009/??/??)
- shout: fixed memory leak in the mp3 encoder
- shout: fixed memory leak in the mp3 encoder
- shout: switch to blocking mode
- shout: switch to blocking mode
- shout: use libshout's synchronization
- shout: use libshout's synchronization
- shout: don't postpone metadata
* mapper: remove trailing slashes from music_directory
* mapper: remove trailing slashes from music_directory
* player: set player error when output device fails
* player: set player error when output device fails
...
...
src/output/shout_mp3.c
View file @
7fc25ad5
...
@@ -111,7 +111,7 @@ static int shout_mp3_encoder_send_metadata(struct shout_data *sd,
...
@@ -111,7 +111,7 @@ static int shout_mp3_encoder_send_metadata(struct shout_data *sd,
char
artist
[
size
];
char
artist
[
size
];
char
title
[
size
];
char
title
[
size
];
int
i
;
int
i
;
struct
tag
*
tag
=
sd
->
tag
;
const
struct
tag
*
tag
=
sd
->
tag
;
strncpy
(
artist
,
""
,
size
);
strncpy
(
artist
,
""
,
size
);
strncpy
(
title
,
""
,
size
);
strncpy
(
title
,
""
,
size
);
...
...
src/output/shout_plugin.c
View file @
7fc25ad5
...
@@ -55,7 +55,6 @@ static struct shout_data *new_shout_data(void)
...
@@ -55,7 +55,6 @@ static struct shout_data *new_shout_data(void)
ret
->
shout_conn
=
shout_new
();
ret
->
shout_conn
=
shout_new
();
ret
->
shout_meta
=
shout_metadata_new
();
ret
->
shout_meta
=
shout_metadata_new
();
ret
->
tag
=
NULL
;
ret
->
bitrate
=
-
1
;
ret
->
bitrate
=
-
1
;
ret
->
quality
=
-
2
.
0
;
ret
->
quality
=
-
2
.
0
;
ret
->
timeout
=
DEFAULT_CONN_TIMEOUT
;
ret
->
timeout
=
DEFAULT_CONN_TIMEOUT
;
...
@@ -70,8 +69,6 @@ static void free_shout_data(struct shout_data *sd)
...
@@ -70,8 +69,6 @@ static void free_shout_data(struct shout_data *sd)
shout_metadata_free
(
sd
->
shout_meta
);
shout_metadata_free
(
sd
->
shout_meta
);
if
(
sd
->
shout_conn
)
if
(
sd
->
shout_conn
)
shout_free
(
sd
->
shout_conn
);
shout_free
(
sd
->
shout_conn
);
if
(
sd
->
tag
)
tag_free
(
sd
->
tag
);
g_free
(
sd
);
g_free
(
sd
);
}
}
...
@@ -384,33 +381,11 @@ my_shout_open_device(void *data,
...
@@ -384,33 +381,11 @@ my_shout_open_device(void *data,
return
true
;
return
true
;
}
}
static
void
send_metadata
(
struct
shout_data
*
sd
)
{
static
const
int
size
=
1024
;
char
song
[
size
];
assert
(
sd
->
tag
!=
NULL
);
if
(
sd
->
encoder
->
send_metadata_func
(
sd
,
song
,
size
))
{
shout_metadata_add
(
sd
->
shout_meta
,
"song"
,
song
);
if
(
SHOUTERR_SUCCESS
!=
shout_set_metadata
(
sd
->
shout_conn
,
sd
->
shout_meta
))
{
g_warning
(
"error setting shout metadata
\n
"
);
}
}
tag_free
(
sd
->
tag
);
sd
->
tag
=
NULL
;
}
static
bool
static
bool
my_shout_play
(
void
*
data
,
const
char
*
chunk
,
size_t
size
)
my_shout_play
(
void
*
data
,
const
char
*
chunk
,
size_t
size
)
{
{
struct
shout_data
*
sd
=
(
struct
shout_data
*
)
data
;
struct
shout_data
*
sd
=
(
struct
shout_data
*
)
data
;
if
(
sd
->
tag
!=
NULL
)
send_metadata
(
sd
);
if
(
sd
->
encoder
->
encode_func
(
sd
,
chunk
,
size
))
if
(
sd
->
encoder
->
encode_func
(
sd
,
chunk
,
size
))
return
false
;
return
false
;
...
@@ -432,15 +407,20 @@ static void my_shout_set_tag(void *data,
...
@@ -432,15 +407,20 @@ static void my_shout_set_tag(void *data,
const
struct
tag
*
tag
)
const
struct
tag
*
tag
)
{
{
struct
shout_data
*
sd
=
(
struct
shout_data
*
)
data
;
struct
shout_data
*
sd
=
(
struct
shout_data
*
)
data
;
char
song
[
1024
];
bool
ret
;
if
(
sd
->
tag
)
sd
->
tag
=
tag
;
tag_free
(
sd
->
tag
);
ret
=
sd
->
encoder
->
send_metadata_func
(
sd
,
song
,
sizeof
(
song
));
sd
->
tag
=
NULL
;
if
(
ret
)
{
shout_metadata_add
(
sd
->
shout_meta
,
"song"
,
song
);
if
(
!
tag
)
if
(
SHOUTERR_SUCCESS
!=
shout_set_metadata
(
sd
->
shout_conn
,
return
;
sd
->
shout_meta
))
{
g_warning
(
"error setting shout metadata
\n
"
);
}
}
sd
->
tag
=
tag_dup
(
tag
);
write_page
(
sd
);
}
}
const
struct
audio_output_plugin
shoutPlugin
=
{
const
struct
audio_output_plugin
shoutPlugin
=
{
...
...
src/output/shout_plugin.h
View file @
7fc25ad5
...
@@ -67,7 +67,7 @@ struct shout_data {
...
@@ -67,7 +67,7 @@ struct shout_data {
float
quality
;
float
quality
;
int
bitrate
;
int
bitrate
;
struct
tag
*
tag
;
const
struct
tag
*
tag
;
int
timeout
;
int
timeout
;
...
...
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