File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -36,21 +36,14 @@ namespace core {
36
36
return FLAC__stream_decoder_seek_absolute (m_flac, pcm_frame);
37
37
}
38
38
bool AudioDecodeFLAC::seekByTime (double const sec) {
39
- if (FLAC__STREAM_DECODER_SEEK_ERROR == FLAC__stream_decoder_get_state (m_flac)) {
40
- if (!FLAC__stream_decoder_flush (m_flac)) {
41
- return false ;
42
- }
43
- }
44
- FLAC__uint64 const pcm_frame = static_cast <FLAC__uint64>(sec * static_cast <double >(m_info.sample_rate ));
45
- m_current_pcm_frame = static_cast <uint32_t >(pcm_frame);
46
- m_flac_frame_data.clear ();
47
- return FLAC__stream_decoder_seek_absolute (m_flac, pcm_frame);
39
+ auto const pcm_frame = static_cast <uint64_t >(sec * static_cast <double >(m_info.sample_rate ));
40
+ return seek (static_cast <uint32_t >(pcm_frame));
48
41
}
49
- bool AudioDecodeFLAC::tell (uint32_t * pcm_frame) {
42
+ bool AudioDecodeFLAC::tell (uint32_t * const pcm_frame) {
50
43
*pcm_frame = m_current_pcm_frame;
51
44
return true ;
52
45
}
53
- bool AudioDecodeFLAC::tellAsTime (double * sec) {
46
+ bool AudioDecodeFLAC::tellAsTime (double * const sec) {
54
47
*sec = static_cast <double >(m_current_pcm_frame) / static_cast <double >(m_info.sample_rate );
55
48
return true ;
56
49
}
You can’t perform that action at this time.
0 commit comments