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
Xiph.Org
flac
Commits
25da0d9a
Commit
25da0d9a
authored
Dec 04, 2001
by
Josh Coalson
Browse files
simplify decoder finishing
parent
07d255b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/flac/decode.c
View file @
25da0d9a
...
...
@@ -213,8 +213,7 @@ int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool
#ifdef FLAC__HAS_OGG
if
(
stream_info
.
is_ogg
)
{
if
(
stream_info
.
decoder
.
stream
)
{
if
(
FLAC__stream_decoder_get_state
(
stream_info
.
decoder
.
stream
)
!=
FLAC__STREAM_DECODER_UNINITIALIZED
)
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
md5_failure
=
false
;
print_stats
(
&
stream_info
);
FLAC__stream_decoder_delete
(
stream_info
.
decoder
.
stream
);
...
...
@@ -224,8 +223,7 @@ int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool
#endif
{
if
(
stream_info
.
decoder
.
file
)
{
if
(
FLAC__file_decoder_get_state
(
stream_info
.
decoder
.
file
)
!=
FLAC__FILE_DECODER_UNINITIALIZED
)
md5_failure
=
!
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
md5_failure
=
!
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
print_stats
(
&
stream_info
);
FLAC__file_decoder_delete
(
stream_info
.
decoder
.
file
);
}
...
...
@@ -252,8 +250,7 @@ wav_abort_:
#ifdef FLAC__HAS_OGG
if
(
stream_info
.
is_ogg
)
{
if
(
stream_info
.
decoder
.
stream
)
{
if
(
FLAC__stream_decoder_get_state
(
stream_info
.
decoder
.
stream
)
!=
FLAC__STREAM_DECODER_UNINITIALIZED
)
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
FLAC__stream_decoder_delete
(
stream_info
.
decoder
.
stream
);
}
}
...
...
@@ -261,8 +258,7 @@ wav_abort_:
#endif
{
if
(
stream_info
.
decoder
.
file
)
{
if
(
FLAC__file_decoder_get_state
(
stream_info
.
decoder
.
file
)
!=
FLAC__FILE_DECODER_UNINITIALIZED
)
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
FLAC__file_decoder_delete
(
stream_info
.
decoder
.
file
);
}
}
...
...
@@ -403,8 +399,7 @@ int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool
#ifdef FLAC__HAS_OGG
if
(
stream_info
.
is_ogg
)
{
if
(
stream_info
.
decoder
.
stream
)
{
if
(
FLAC__stream_decoder_get_state
(
stream_info
.
decoder
.
stream
)
!=
FLAC__STREAM_DECODER_UNINITIALIZED
)
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
md5_failure
=
false
;
print_stats
(
&
stream_info
);
FLAC__stream_decoder_delete
(
stream_info
.
decoder
.
stream
);
...
...
@@ -414,8 +409,7 @@ int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool
#endif
{
if
(
stream_info
.
decoder
.
file
)
{
if
(
FLAC__file_decoder_get_state
(
stream_info
.
decoder
.
file
)
!=
FLAC__FILE_DECODER_UNINITIALIZED
)
md5_failure
=
!
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
md5_failure
=
!
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
print_stats
(
&
stream_info
);
FLAC__file_decoder_delete
(
stream_info
.
decoder
.
file
);
}
...
...
@@ -442,8 +436,7 @@ raw_abort_:
#ifdef FLAC__HAS_OGG
if
(
stream_info
.
is_ogg
)
{
if
(
stream_info
.
decoder
.
stream
)
{
if
(
FLAC__stream_decoder_get_state
(
stream_info
.
decoder
.
stream
)
!=
FLAC__STREAM_DECODER_UNINITIALIZED
)
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
FLAC__stream_decoder_finish
(
stream_info
.
decoder
.
stream
);
FLAC__stream_decoder_delete
(
stream_info
.
decoder
.
stream
);
}
}
...
...
@@ -451,8 +444,7 @@ raw_abort_:
#endif
{
if
(
stream_info
.
decoder
.
file
)
{
if
(
FLAC__file_decoder_get_state
(
stream_info
.
decoder
.
file
)
!=
FLAC__FILE_DECODER_UNINITIALIZED
)
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
FLAC__file_decoder_finish
(
stream_info
.
decoder
.
file
);
FLAC__file_decoder_delete
(
stream_info
.
decoder
.
file
);
}
}
...
...
src/plugin_winamp3/flacpcm.cpp
View file @
25da0d9a
...
...
@@ -204,8 +204,7 @@ int FlacPcm::corecb_onSeeked(int newpos)
void
FlacPcm
::
cleanup
()
{
if
(
decoder
)
{
if
(
FLAC__seekable_stream_decoder_get_state
(
decoder
)
!=
FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
)
FLAC__seekable_stream_decoder_finish
(
decoder
);
FLAC__seekable_stream_decoder_finish
(
decoder
);
FLAC__seekable_stream_decoder_delete
(
decoder
);
decoder
=
0
;
}
...
...
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