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
ca1fc131
Commit
ca1fc131
authored
Jan 18, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder_api: removed function decoder_get_uri()
Use input_stream.uri.
parent
9cb7760c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
54 deletions
+11
-54
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+5
-6
vorbis_decoder_plugin.c
src/decoder/vorbis_decoder_plugin.c
+4
-13
wavpack_decoder_plugin.c
src/decoder/wavpack_decoder_plugin.c
+2
-7
decoder_api.c
src/decoder_api.c
+0
-9
decoder_api.h
src/decoder_api.h
+0
-9
read_tags.c
test/read_tags.c
+0
-5
run_decoder.c
test/run_decoder.c
+0
-5
No files found.
src/decoder/ffmpeg_decoder_plugin.c
View file @
ca1fc131
...
...
@@ -162,7 +162,7 @@ append_uri_suffix(struct ffmpeg_stream *stream, const char *uri)
}
static
bool
ffmpeg_helper
(
const
char
*
uri
,
struct
input_stream
*
input
,
ffmpeg_helper
(
struct
input_stream
*
input
,
bool
(
*
callback
)(
struct
ffmpeg_context
*
ctx
),
struct
ffmpeg_context
*
ctx
)
{
...
...
@@ -175,8 +175,8 @@ ffmpeg_helper(const char *uri, struct input_stream *input,
};
bool
ret
;
if
(
uri
!=
NULL
)
append_uri_suffix
(
&
stream
,
uri
);
if
(
input
->
uri
!=
NULL
)
append_uri_suffix
(
&
stream
,
input
->
uri
);
stream
.
input
=
input
;
if
(
ctx
&&
ctx
->
decoder
)
{
...
...
@@ -385,8 +385,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
ctx
.
input
=
input
;
ctx
.
decoder
=
decoder
;
ffmpeg_helper
(
decoder_get_uri
(
decoder
),
input
,
ffmpeg_decode_internal
,
&
ctx
);
ffmpeg_helper
(
input
,
ffmpeg_decode_internal
,
&
ctx
);
}
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
...
...
@@ -459,7 +458,7 @@ ffmpeg_stream_tag(struct input_stream *is)
ctx
.
decoder
=
NULL
;
ctx
.
tag
=
tag_new
();
ret
=
ffmpeg_helper
(
NULL
,
is
,
ffmpeg_tag_internal
,
&
ctx
);
ret
=
ffmpeg_helper
(
is
,
ffmpeg_tag_internal
,
&
ctx
);
if
(
!
ret
)
{
tag_free
(
ctx
.
tag
);
ctx
.
tag
=
NULL
;
...
...
src/decoder/vorbis_decoder_plugin.c
View file @
ca1fc131
...
...
@@ -245,19 +245,10 @@ vorbis_send_comments(struct decoder *decoder, struct input_stream *is,
}
static
bool
oggvorbis_seekable
(
struct
decoder
*
decoder
)
oggvorbis_seekable
(
const
struct
input_stream
*
is
)
{
char
*
uri
;
bool
seekable
;
uri
=
decoder_get_uri
(
decoder
);
/* disable seeking on remote streams, because libvorbis seeks
around like crazy, and due to being very expensive, this
delays song playback by 10 or 20 seconds */
seekable
=
!
uri_has_scheme
(
uri
);
g_free
(
uri
);
return
seekable
;
return
is
->
seekable
&&
(
is
->
uri
==
NULL
||
!
uri_has_scheme
(
is
->
uri
));
}
/* public */
...
...
@@ -289,7 +280,7 @@ vorbis_stream_decode(struct decoder *decoder,
data
.
decoder
=
decoder
;
data
.
input_stream
=
input_stream
;
data
.
seekable
=
input_stream
->
seekable
&&
oggvorbis_seekable
(
decoder
);
data
.
seekable
=
oggvorbis_seekable
(
input_stream
);
callbacks
.
read_func
=
ogg_read_cb
;
callbacks
.
seek_func
=
ogg_seek_cb
;
...
...
src/decoder/wavpack_decoder_plugin.c
View file @
ca1fc131
...
...
@@ -466,7 +466,6 @@ static struct input_stream *
wavpack_open_wvc
(
struct
decoder
*
decoder
,
struct
wavpack_input
*
wpi
)
{
struct
input_stream
*
is_wvc
;
char
*
utf8url
;
char
*
wvc_url
=
NULL
;
char
first_byte
;
size_t
nbytes
;
...
...
@@ -475,14 +474,10 @@ wavpack_open_wvc(struct decoder *decoder, struct wavpack_input *wpi)
* As we use dc->utf8url, this function will be bad for
* single files. utf8url is not absolute file path :/
*/
utf8url
=
decoder_get_uri
(
decoder
);
if
(
utf8url
==
NULL
)
{
if
(
wpi
->
is
->
uri
==
NULL
)
return
false
;
}
wvc_url
=
g_strconcat
(
utf8url
,
"c"
,
NULL
);
g_free
(
utf8url
);
wvc_url
=
g_strconcat
(
wpi
->
is
->
uri
,
"c"
,
NULL
);
is_wvc
=
input_stream_open
(
wvc_url
,
NULL
);
g_free
(
wvc_url
);
...
...
src/decoder_api.c
View file @
ca1fc131
...
...
@@ -79,15 +79,6 @@ decoder_initialized(struct decoder *decoder,
&
af_string
));
}
char
*
decoder_get_uri
(
G_GNUC_UNUSED
struct
decoder
*
decoder
)
{
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
assert
(
dc
->
pipe
!=
NULL
);
return
song_get_uri
(
dc
->
song
);
}
enum
decoder_command
decoder_get_command
(
G_GNUC_UNUSED
struct
decoder
*
decoder
)
{
const
struct
decoder_control
*
dc
=
decoder
->
dc
;
...
...
src/decoder_api.h
View file @
ca1fc131
...
...
@@ -54,15 +54,6 @@ decoder_initialized(struct decoder *decoder,
bool
seekable
,
float
total_time
);
/**
* Returns the URI of the current song in UTF-8 encoding.
*
* @param decoder the decoder object
* @return an allocated string which must be freed with g_free()
*/
char
*
decoder_get_uri
(
struct
decoder
*
decoder
);
/**
* Determines the pending decoder command.
*
* @param decoder the decoder object
...
...
test/read_tags.c
View file @
ca1fc131
...
...
@@ -64,11 +64,6 @@ decoder_initialized(G_GNUC_UNUSED struct decoder *decoder,
{
}
char
*
decoder_get_uri
(
G_GNUC_UNUSED
struct
decoder
*
decoder
)
{
return
NULL
;
}
enum
decoder_command
decoder_get_command
(
G_GNUC_UNUSED
struct
decoder
*
decoder
)
{
...
...
test/run_decoder.c
View file @
ca1fc131
...
...
@@ -85,11 +85,6 @@ decoder_initialized(struct decoder *decoder,
decoder
->
initialized
=
true
;
}
char
*
decoder_get_uri
(
struct
decoder
*
decoder
)
{
return
g_strdup
(
decoder
->
uri
);
}
enum
decoder_command
decoder_get_command
(
G_GNUC_UNUSED
struct
decoder
*
decoder
)
{
...
...
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