Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
7a903c93
Commit
7a903c93
authored
May 02, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fdkaac error strings: compactify
parent
590285cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
32 deletions
+19
-32
modules/codec/fdkaac.c
modules/codec/fdkaac.c
+19
-32
No files found.
modules/codec/fdkaac.c
View file @
7a903c93
...
...
@@ -141,35 +141,22 @@ struct encoder_sys_t
HANDLE_AACENCODER
handle
;
};
static
const
char
*
aac_get_errorstring
(
AACENC_ERROR
erraac
)
static
const
char
*
fdkaac_error
(
AACENC_ERROR
erraac
)
{
switch
(
erraac
)
{
case
AACENC_OK
:
return
"No error"
;
case
AACENC_INVALID_HANDLE
:
return
"Invalid handle"
;
case
AACENC_MEMORY_ERROR
:
return
"Memory allocation error"
;
case
AACENC_UNSUPPORTED_PARAMETER
:
return
"Unsupported parameter"
;
case
AACENC_INVALID_CONFIG
:
return
"Invalid config"
;
case
AACENC_INIT_ERROR
:
return
"Initialization error"
;
case
AACENC_INIT_AAC_ERROR
:
return
"AAC library initialization error"
;
case
AACENC_INIT_SBR_ERROR
:
return
"SBR library initialization error"
;
case
AACENC_INIT_TP_ERROR
:
return
"Transport library initialization error"
;
case
AACENC_INIT_META_ERROR
:
return
"Metadata library initialization error"
;
case
AACENC_ENCODE_ERROR
:
return
"Encoding error"
;
case
AACENC_ENCODE_EOF
:
return
"End of file"
;
default:
return
"Unknown error"
;
case
AACENC_OK
:
return
"No error"
;
case
AACENC_INVALID_HANDLE
:
return
"Invalid handle"
;
case
AACENC_MEMORY_ERROR
:
return
"Memory allocation error"
;
case
AACENC_UNSUPPORTED_PARAMETER
:
return
"Unsupported parameter"
;
case
AACENC_INVALID_CONFIG
:
return
"Invalid config"
;
case
AACENC_INIT_ERROR
:
return
"Initialization error"
;
case
AACENC_INIT_AAC_ERROR
:
return
"AAC library initialization error"
;
case
AACENC_INIT_SBR_ERROR
:
return
"SBR library initialization error"
;
case
AACENC_INIT_TP_ERROR
:
return
"Transport library initialization error"
;
case
AACENC_INIT_META_ERROR
:
return
"Metadata library initialization error"
;
case
AACENC_ENCODE_ERROR
:
return
"Encoding error"
;
case
AACENC_ENCODE_EOF
:
return
"End of file"
;
default:
return
"Unknown error"
;
}
}
...
...
@@ -240,7 +227,7 @@ static int OpenEncoder(vlc_object_t *p_this)
AACENC_ERROR
erraac
;
erraac
=
aacEncOpen
(
&
p_sys
->
handle
,
0
,
p_enc
->
fmt_in
.
audio
.
i_channels
);
if
(
erraac
!=
AACENC_OK
)
{
msg_Err
(
p_enc
,
"Unable to open encoder: %s"
,
aac_get_errorstring
(
erraac
));
msg_Err
(
p_enc
,
"Unable to open encoder: %s"
,
fdkaac_error
(
erraac
));
free
(
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -248,7 +235,7 @@ static int OpenEncoder(vlc_object_t *p_this)
#define SET_PARAM(P, V) do { \
AACENC_ERROR err = aacEncoder_SetParam(p_sys->handle, AACENC_ ## P, V); \
if (err != AACENC_OK) { \
msg_Err(p_enc, "Couldn't set " #P " to value %d: %s", V,
aac_get_errorstring
(err)); \
msg_Err(p_enc, "Couldn't set " #P " to value %d: %s", V,
fdkaac_error
(err)); \
goto error; \
} \
} while(0)
...
...
@@ -286,14 +273,14 @@ static int OpenEncoder(vlc_object_t *p_this)
erraac
=
aacEncEncode
(
p_sys
->
handle
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
erraac
!=
AACENC_OK
)
{
msg_Err
(
p_enc
,
"Unable to initialize the encoder: %s"
,
aac_get_errorstring
(
erraac
));
msg_Err
(
p_enc
,
"Unable to initialize the encoder: %s"
,
fdkaac_error
(
erraac
));
goto
error
;
}
AACENC_InfoStruct
info
=
{
0
};
erraac
=
aacEncInfo
(
p_sys
->
handle
,
&
info
);
if
(
erraac
!=
AACENC_OK
)
{
msg_Err
(
p_enc
,
"Unable to get the encoder info: %s"
,
aac_get_errorstring
(
erraac
));
msg_Err
(
p_enc
,
"Unable to get the encoder info: %s"
,
fdkaac_error
(
erraac
));
goto
error
;
}
...
...
@@ -398,7 +385,7 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf)
if
(
erraac
==
AACENC_ENCODE_EOF
)
{
msg_Info
(
p_enc
,
"Encoding final bytes (EOF)"
);
}
else
{
msg_Err
(
p_enc
,
"Encoding failed: %s"
,
aac_get_errorstring
(
erraac
));
msg_Err
(
p_enc
,
"Encoding failed: %s"
,
fdkaac_error
(
erraac
));
block_Release
(
p_block
);
break
;
}
...
...
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