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;
|
||||
}
|
||||
|
||||
AtScopeExit(wpc) {
|
||||
WavpackCloseFile(wpc);
|
||||
};
|
||||
|
||||
const auto duration =
|
||||
SongTime::FromScale<uint64_t>(WavpackGetNumSamples(wpc),
|
||||
WavpackGetSampleRate(wpc));
|
||||
|
@ -312,8 +316,6 @@ wavpack_scan_file(Path path_fs,
|
|||
}
|
||||
}
|
||||
|
||||
WavpackCloseFile(wpc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -561,13 +563,15 @@ wavpack_filedecode(DecoderClient &client, Path path_fs)
|
|||
return;
|
||||
}
|
||||
|
||||
AtScopeExit(wpc) {
|
||||
WavpackCloseFile(wpc);
|
||||
};
|
||||
|
||||
ReplayGainInfo rgi;
|
||||
if (wavpack_replaygain(rgi, wpc))
|
||||
client.SubmitReplayGain(&rgi);
|
||||
|
||||
wavpack_decode(client, wpc, true);
|
||||
|
||||
WavpackCloseFile(wpc);
|
||||
}
|
||||
|
||||
static char const *const wavpack_suffixes[] = {
|
||||
|
|
Loading…
Reference in New Issue