decoder/wavpack: use AtScopeExit()
This commit is contained in:
parent
ae7e25ea65
commit
0be5fbdc35
@ -279,6 +279,10 @@ wavpack_scan_file(Path path_fs,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AtScopeExit(wpc) {
|
||||||
|
WavpackCloseFile(wpc);
|
||||||
|
};
|
||||||
|
|
||||||
const auto duration =
|
const auto duration =
|
||||||
SongTime::FromScale<uint64_t>(WavpackGetNumSamples(wpc),
|
SongTime::FromScale<uint64_t>(WavpackGetNumSamples(wpc),
|
||||||
WavpackGetSampleRate(wpc));
|
WavpackGetSampleRate(wpc));
|
||||||
@ -312,8 +316,6 @@ wavpack_scan_file(Path path_fs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WavpackCloseFile(wpc);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,13 +563,15 @@ wavpack_filedecode(DecoderClient &client, Path path_fs)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AtScopeExit(wpc) {
|
||||||
|
WavpackCloseFile(wpc);
|
||||||
|
};
|
||||||
|
|
||||||
ReplayGainInfo rgi;
|
ReplayGainInfo rgi;
|
||||||
if (wavpack_replaygain(rgi, wpc))
|
if (wavpack_replaygain(rgi, wpc))
|
||||||
client.SubmitReplayGain(&rgi);
|
client.SubmitReplayGain(&rgi);
|
||||||
|
|
||||||
wavpack_decode(client, wpc, true);
|
wavpack_decode(client, wpc, true);
|
||||||
|
|
||||||
WavpackCloseFile(wpc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char const *const wavpack_suffixes[] = {
|
static char const *const wavpack_suffixes[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user