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
28f5803d
Commit
28f5803d
authored
May 30, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/vorbis: use single global ov_callbacks constant
Initialize the ov_callbacks struct at compile time.
parent
0b722998
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
vorbis_decoder_plugin.c
src/decoder/vorbis_decoder_plugin.c
+9
-6
No files found.
src/decoder/vorbis_decoder_plugin.c
View file @
28f5803d
...
@@ -97,6 +97,13 @@ static long ogg_tell_cb(void *data)
...
@@ -97,6 +97,13 @@ static long ogg_tell_cb(void *data)
return
(
long
)
vis
->
input_stream
->
offset
;
return
(
long
)
vis
->
input_stream
->
offset
;
}
}
static
const
ov_callbacks
vorbis_is_callbacks
=
{
.
read_func
=
ogg_read_cb
,
.
seek_func
=
ogg_seek_cb
,
.
close_func
=
ogg_close_cb
,
.
tell_func
=
ogg_tell_cb
,
};
static
const
char
*
static
const
char
*
vorbis_strerror
(
int
code
)
vorbis_strerror
(
int
code
)
{
{
...
@@ -251,7 +258,6 @@ vorbis_stream_decode(struct decoder *decoder,
...
@@ -251,7 +258,6 @@ vorbis_stream_decode(struct decoder *decoder,
{
{
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
OggVorbis_File
vf
;
OggVorbis_File
vf
;
ov_callbacks
callbacks
;
struct
vorbis_input_stream
vis
;
struct
vorbis_input_stream
vis
;
struct
audio_format
audio_format
;
struct
audio_format
audio_format
;
float
total_time
;
float
total_time
;
...
@@ -275,11 +281,8 @@ vorbis_stream_decode(struct decoder *decoder,
...
@@ -275,11 +281,8 @@ vorbis_stream_decode(struct decoder *decoder,
vis
.
input_stream
=
input_stream
;
vis
.
input_stream
=
input_stream
;
vis
.
seekable
=
oggvorbis_seekable
(
input_stream
);
vis
.
seekable
=
oggvorbis_seekable
(
input_stream
);
callbacks
.
read_func
=
ogg_read_cb
;
if
((
ret
=
ov_open_callbacks
(
&
vis
,
&
vf
,
NULL
,
0
,
callbacks
.
seek_func
=
ogg_seek_cb
;
vorbis_is_callbacks
))
<
0
)
{
callbacks
.
close_func
=
ogg_close_cb
;
callbacks
.
tell_func
=
ogg_tell_cb
;
if
((
ret
=
ov_open_callbacks
(
&
vis
,
&
vf
,
NULL
,
0
,
callbacks
))
<
0
)
{
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_NONE
)
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_NONE
)
return
;
return
;
...
...
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