mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 00:58:12 -04:00
WAV: Avoid using a magic number.
This commit is contained in:
parent
9c8e36d3be
commit
801c9db810
@ -29,6 +29,16 @@
|
||||
|
||||
using namespace TagLib;
|
||||
|
||||
namespace
|
||||
{
|
||||
// Quoted from RFC 2361.
|
||||
enum WaveFormat
|
||||
{
|
||||
FORMAT_UNKNOWN = 0x0000,
|
||||
FORMAT_PCM = 0x0001
|
||||
};
|
||||
}
|
||||
|
||||
class RIFF::WAV::Properties::PropertiesPrivate
|
||||
{
|
||||
public:
|
||||
@ -173,7 +183,7 @@ void RIFF::WAV::Properties::read(File *file)
|
||||
}
|
||||
|
||||
d->format = data.toShort(0, false);
|
||||
if(d->format != 1 && totalSamples == 0) {
|
||||
if(d->format != FORMAT_PCM && totalSamples == 0) {
|
||||
debug("RIFF::WAV::Properties::read() - Non-PCM format, but 'fact' chunk not found.");
|
||||
return;
|
||||
}
|
||||
|
@ -139,9 +139,11 @@ namespace TagLib {
|
||||
|
||||
/*!
|
||||
* Returns the format ID of the file.
|
||||
* 0 for unknown, 1 for PCM, 2 for ADPCM, 3 for 32/64-bit IEEE754, and so forth.
|
||||
* 0 for unknown, 1 for PCM, 2 for ADPCM, 3 for 32/64-bit IEEE754, and
|
||||
* so forth.
|
||||
*
|
||||
* \note For further information, refer to RFC 2361.
|
||||
* \note For further information, refer to the WAVE Form Registration
|
||||
* Numbers in RFC 2361.
|
||||
*/
|
||||
int format() const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user