Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Strogin
flac
Commits
9c82c174
Commit
9c82c174
authored
Jul 22, 2004
by
Josh Coalson
Browse files
add more informative error info for some common errors
parent
9af9519a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/flac/encode.c
View file @
9c82c174
...
...
@@ -1963,7 +1963,7 @@ void print_error_with_state(const EncoderSession *e, const char *message)
const
int
ilen
=
strlen
(
e
->
inbasefilename
)
+
1
;
const
char
*
state_string
;
fprintf
(
stderr
,
"
\n
%s: %s
\n
"
,
e
->
inbasefilename
,
message
);
f
lac__utils_
printf
(
stderr
,
1
,
"
\n
%s: %s
\n
"
,
e
->
inbasefilename
,
message
);
#ifdef FLAC__HAS_OGG
if
(
e
->
use_ogg
)
{
...
...
@@ -1984,6 +1984,30 @@ void print_error_with_state(const EncoderSession *e, const char *message)
}
flac__utils_printf
(
stderr
,
1
,
"%*s state = %s
\n
"
,
ilen
,
""
,
state_string
);
/* print out some more info for some errors: */
if
(
0
==
strcmp
(
state_string
,
FLAC__StreamEncoderStateString
[
FLAC__STREAM_ENCODER_NOT_STREAMABLE
]))
{
flac__utils_printf
(
stderr
,
1
,
"
\n
"
"The encoding parameters specified do not conform to the FLAC Subset and may not
\n
"
"be streamable or playable in hardware devices. Add --lax to the command-line
\n
"
"options to encode with these parameters.
\n
"
);
}
else
if
(
0
==
strcmp
(
state_string
,
FLAC__FileEncoderStateString
[
FLAC__FILE_ENCODER_FATAL_ERROR_WHILE_WRITING
])
||
0
==
strcmp
(
state_string
,
OggFLAC__FileEncoderStateString
[
OggFLAC__FILE_ENCODER_FATAL_ERROR_WHILE_WRITING
]))
{
flac__utils_printf
(
stderr
,
1
,
"
\n
"
"An error occurred while writing; the most common cause is that the disk is full.
\n
"
);
}
else
if
(
0
==
strcmp
(
state_string
,
FLAC__FileEncoderStateString
[
FLAC__FILE_ENCODER_ERROR_OPENING_FILE
])
||
0
==
strcmp
(
state_string
,
OggFLAC__FileEncoderStateString
[
OggFLAC__FILE_ENCODER_ERROR_OPENING_FILE
]))
{
flac__utils_printf
(
stderr
,
1
,
"
\n
"
"An error occurred opening the output file; it is likely that the output
\n
"
"directory does not exist or is not writable, the output file already exists and
\n
"
"is not writable, or the disk is full.
\n
"
);
}
}
void
print_verify_error
(
EncoderSession
*
e
)
...
...
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