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
3b0bf856
Commit
3b0bf856
authored
May 30, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/vorbis: move code to vorbis_open_stream()
parent
28f5803d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
vorbis_decoder_plugin.c
src/decoder/vorbis_decoder_plugin.c
+23
-19
No files found.
src/decoder/vorbis_decoder_plugin.c
View file @
3b0bf856
...
...
@@ -128,6 +128,28 @@ vorbis_strerror(int code)
}
}
static
bool
vorbis_is_open
(
struct
vorbis_input_stream
*
vis
,
OggVorbis_File
*
vf
,
struct
decoder
*
decoder
,
struct
input_stream
*
input_stream
)
{
vis
->
decoder
=
decoder
;
vis
->
input_stream
=
input_stream
;
vis
->
seekable
=
input_stream
->
seekable
&&
(
input_stream
->
uri
==
NULL
||
!
uri_has_scheme
(
input_stream
->
uri
));
int
ret
=
ov_open_callbacks
(
vis
,
vf
,
NULL
,
0
,
vorbis_is_callbacks
);
if
(
ret
<
0
)
{
if
(
decoder
==
NULL
||
decoder_get_command
(
decoder
)
==
DECODE_COMMAND_NONE
)
g_warning
(
"Failed to open Ogg Vorbis stream: %s"
,
vorbis_strerror
(
ret
));
return
false
;
}
return
true
;
}
static
const
char
*
vorbis_comment_value
(
const
char
*
comment
,
const
char
*
needle
)
{
...
...
@@ -244,13 +266,6 @@ vorbis_send_comments(struct decoder *decoder, struct input_stream *is,
tag_free
(
tag
);
}
static
bool
oggvorbis_seekable
(
const
struct
input_stream
*
is
)
{
return
is
->
seekable
&&
(
is
->
uri
==
NULL
||
!
uri_has_scheme
(
is
->
uri
));
}
/* public */
static
void
vorbis_stream_decode
(
struct
decoder
*
decoder
,
...
...
@@ -277,19 +292,8 @@ vorbis_stream_decode(struct decoder *decoder,
moved it */
input_stream_seek
(
input_stream
,
0
,
SEEK_SET
,
NULL
);
vis
.
decoder
=
decoder
;
vis
.
input_stream
=
input_stream
;
vis
.
seekable
=
oggvorbis_seekable
(
input_stream
);
if
((
ret
=
ov_open_callbacks
(
&
vis
,
&
vf
,
NULL
,
0
,
vorbis_is_callbacks
))
<
0
)
{
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_NONE
)
return
;
g_warning
(
"Error decoding Ogg Vorbis stream: %s"
,
vorbis_strerror
(
ret
));
if
(
!
vorbis_is_open
(
&
vis
,
&
vf
,
decoder
,
input_stream
))
return
;
}
vi
=
ov_info
(
&
vf
,
-
1
);
if
(
vi
==
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