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
4f38cc9c
Commit
4f38cc9c
authored
Nov 11, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/vorbis: moved error strings to vorbis_strerror()
parent
dfc09a37
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
24 deletions
+26
-24
vorbis_plugin.c
src/decoder/vorbis_plugin.c
+26
-24
No files found.
src/decoder/vorbis_plugin.c
View file @
4f38cc9c
...
@@ -101,6 +101,30 @@ static long ogg_tell_cb(void *vdata)
...
@@ -101,6 +101,30 @@ static long ogg_tell_cb(void *vdata)
}
}
static
const
char
*
static
const
char
*
vorbis_strerror
(
int
code
)
{
switch
(
code
)
{
case
OV_EREAD
:
return
"read error"
;
case
OV_ENOTVORBIS
:
return
"not vorbis stream"
;
case
OV_EVERSION
:
return
"vorbis version mismatch"
;
case
OV_EBADHEADER
:
return
"invalid vorbis header"
;
case
OV_EFAULT
:
return
"internal logic error"
;
default:
return
"unknown error"
;
}
}
static
const
char
*
vorbis_comment_value
(
const
char
*
comment
,
const
char
*
needle
)
vorbis_comment_value
(
const
char
*
comment
,
const
char
*
needle
)
{
{
size_t
len
=
strlen
(
needle
);
size_t
len
=
strlen
(
needle
);
...
@@ -274,33 +298,11 @@ vorbis_stream_decode(struct decoder *decoder,
...
@@ -274,33 +298,11 @@ vorbis_stream_decode(struct decoder *decoder,
callbacks
.
close_func
=
ogg_close_cb
;
callbacks
.
close_func
=
ogg_close_cb
;
callbacks
.
tell_func
=
ogg_tell_cb
;
callbacks
.
tell_func
=
ogg_tell_cb
;
if
((
ret
=
ov_open_callbacks
(
&
data
,
&
vf
,
NULL
,
0
,
callbacks
))
<
0
)
{
if
((
ret
=
ov_open_callbacks
(
&
data
,
&
vf
,
NULL
,
0
,
callbacks
))
<
0
)
{
const
char
*
error
;
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_NONE
)
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_NONE
)
return
;
return
;
switch
(
ret
)
{
g_warning
(
"Error decoding Ogg Vorbis stream: %s"
,
case
OV_EREAD
:
vorbis_strerror
(
ret
));
error
=
"read error"
;
break
;
case
OV_ENOTVORBIS
:
error
=
"not vorbis stream"
;
break
;
case
OV_EVERSION
:
error
=
"vorbis version mismatch"
;
break
;
case
OV_EBADHEADER
:
error
=
"invalid vorbis header"
;
break
;
case
OV_EFAULT
:
error
=
"internal logic error"
;
break
;
default:
error
=
"unknown error"
;
break
;
}
g_warning
(
"Error decoding Ogg Vorbis stream: %s"
,
error
);
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