decoder/wavpack: use WavpackGetNumSamples64() if available
This commit is contained in:
parent
f35dab1b56
commit
544bcbe903
@ -53,10 +53,18 @@ gcc_pure
|
|||||||
static SignedSongTime
|
static SignedSongTime
|
||||||
GetDuration(WavpackContext *wpc)
|
GetDuration(WavpackContext *wpc)
|
||||||
{
|
{
|
||||||
|
#ifdef OPEN_DSD_AS_PCM
|
||||||
|
/* libWavPack 5 */
|
||||||
|
const auto n_samples = WavpackGetNumSamples64(wpc);
|
||||||
|
if (n_samples == -1)
|
||||||
|
/* unknown */
|
||||||
|
return SignedSongTime::Negative();
|
||||||
|
#else
|
||||||
const uint32_t n_samples = WavpackGetNumSamples(wpc);
|
const uint32_t n_samples = WavpackGetNumSamples(wpc);
|
||||||
if (n_samples == uint32_t(-1))
|
if (n_samples == uint32_t(-1))
|
||||||
/* unknown */
|
/* unknown */
|
||||||
return SignedSongTime::Negative();
|
return SignedSongTime::Negative();
|
||||||
|
#endif
|
||||||
|
|
||||||
return SongTime::FromScale<uint64_t>(n_samples,
|
return SongTime::FromScale<uint64_t>(n_samples,
|
||||||
WavpackGetSampleRate(wpc));
|
WavpackGetSampleRate(wpc));
|
||||||
|
Loading…
Reference in New Issue
Block a user