File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
src/AudioTools/AudioCodecs Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -34,24 +34,21 @@ class FLACDecoderFoxen : public AudioDecoder {
34
34
bool begin () {
35
35
TRACEI ();
36
36
is_active = false ;
37
- if (flac == nullptr ) {
38
- size_t foxen_size = fx_flac_size (max_block_size, max_channels);
39
- if (foxen_size > 0 ) {
40
- foxen_data.resize (foxen_size);
41
- }
42
- if (foxen_data.data () != nullptr ) {
43
- flac = fx_flac_init (foxen_data.data (), max_block_size, max_channels);
44
- }
37
+ size_t foxen_size = fx_flac_size (max_block_size, max_channels);
38
+ foxen_data.resize (foxen_size);
39
+
40
+ if (foxen_data.data () != nullptr ) {
41
+ flac = fx_flac_init (foxen_data.data (), max_block_size, max_channels);
45
42
}
43
+
46
44
if (flac != nullptr ) {
47
45
is_active = true ;
46
+ write_buffer.resize (in_buffer_size);
47
+ out.resize (out_buffer_size);
48
48
} else {
49
49
LOGE (" not enough memory" );
50
50
if (is_stop_on_error) stop ();
51
51
}
52
-
53
- write_buffer.resize (in_buffer_size);
54
- out.resize (out_buffer_size);
55
52
56
53
return is_active;
57
54
}
You can’t perform that action at this time.
0 commit comments