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
...
@@ -141,35 +141,22 @@ struct encoder_sys_t
HANDLE_AACENCODER
handle
;
HANDLE_AACENCODER
handle
;
};
};
static
const
char
*
aac_get_errorstring
(
AACENC_ERROR
erraac
)
static
const
char
*
fdkaac_error
(
AACENC_ERROR
erraac
)
{
{
switch
(
erraac
)
{
switch
(
erraac
)
{
case
AACENC_OK
:
case
AACENC_OK
:
return
"No error"
;
return
"No error"
;
case
AACENC_INVALID_HANDLE
:
return
"Invalid handle"
;
case
AACENC_INVALID_HANDLE
:
case
AACENC_MEMORY_ERROR
:
return
"Memory allocation error"
;
return
"Invalid handle"
;
case
AACENC_UNSUPPORTED_PARAMETER
:
return
"Unsupported parameter"
;
case
AACENC_MEMORY_ERROR
:
case
AACENC_INVALID_CONFIG
:
return
"Invalid config"
;
return
"Memory allocation error"
;
case
AACENC_INIT_ERROR
:
return
"Initialization error"
;
case
AACENC_UNSUPPORTED_PARAMETER
:
case
AACENC_INIT_AAC_ERROR
:
return
"AAC library initialization error"
;
return
"Unsupported parameter"
;
case
AACENC_INIT_SBR_ERROR
:
return
"SBR library initialization error"
;
case
AACENC_INVALID_CONFIG
:
case
AACENC_INIT_TP_ERROR
:
return
"Transport library initialization error"
;
return
"Invalid config"
;
case
AACENC_INIT_META_ERROR
:
return
"Metadata library initialization error"
;
case
AACENC_INIT_ERROR
:
case
AACENC_ENCODE_ERROR
:
return
"Encoding error"
;
return
"Initialization error"
;
case
AACENC_ENCODE_EOF
:
return
"End of file"
;
case
AACENC_INIT_AAC_ERROR
:
default:
return
"Unknown 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)
...
@@ -240,7 +227,7 @@ static int OpenEncoder(vlc_object_t *p_this)
AACENC_ERROR
erraac
;
AACENC_ERROR
erraac
;
erraac
=
aacEncOpen
(
&
p_sys
->
handle
,
0
,
p_enc
->
fmt_in
.
audio
.
i_channels
);
erraac
=
aacEncOpen
(
&
p_sys
->
handle
,
0
,
p_enc
->
fmt_in
.
audio
.
i_channels
);
if
(
erraac
!=
AACENC_OK
)
{
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
);
free
(
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -248,7 +235,7 @@ static int OpenEncoder(vlc_object_t *p_this)
...
@@ -248,7 +235,7 @@ static int OpenEncoder(vlc_object_t *p_this)
#define SET_PARAM(P, V) do { \
#define SET_PARAM(P, V) do { \
AACENC_ERROR err = aacEncoder_SetParam(p_sys->handle, AACENC_ ## P, V); \
AACENC_ERROR err = aacEncoder_SetParam(p_sys->handle, AACENC_ ## P, V); \
if (err != AACENC_OK) { \
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; \
goto error; \
} \
} \
} while(0)
} while(0)
...
@@ -286,14 +273,14 @@ static int OpenEncoder(vlc_object_t *p_this)
...
@@ -286,14 +273,14 @@ static int OpenEncoder(vlc_object_t *p_this)
erraac
=
aacEncEncode
(
p_sys
->
handle
,
NULL
,
NULL
,
NULL
,
NULL
);
erraac
=
aacEncEncode
(
p_sys
->
handle
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
erraac
!=
AACENC_OK
)
{
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
;
goto
error
;
}
}
AACENC_InfoStruct
info
=
{
0
};
AACENC_InfoStruct
info
=
{
0
};
erraac
=
aacEncInfo
(
p_sys
->
handle
,
&
info
);
erraac
=
aacEncInfo
(
p_sys
->
handle
,
&
info
);
if
(
erraac
!=
AACENC_OK
)
{
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
;
goto
error
;
}
}
...
@@ -398,7 +385,7 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf)
...
@@ -398,7 +385,7 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf)
if
(
erraac
==
AACENC_ENCODE_EOF
)
{
if
(
erraac
==
AACENC_ENCODE_EOF
)
{
msg_Info
(
p_enc
,
"Encoding final bytes (EOF)"
);
msg_Info
(
p_enc
,
"Encoding final bytes (EOF)"
);
}
else
{
}
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
);
block_Release
(
p_block
);
break
;
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