From 5534828032730762f8c1e4daf924b466fffb8be0 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 16 Oct 2018 23:09:18 +0800 Subject: =?UTF-8?q?*=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Audio/Source.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/libjin/Audio/Source.cpp') diff --git a/src/libjin/Audio/Source.cpp b/src/libjin/Audio/Source.cpp index 1dcd482..306d93f 100644 --- a/src/libjin/Audio/Source.cpp +++ b/src/libjin/Audio/Source.cpp @@ -6,24 +6,24 @@ namespace jin { -namespace audio -{ + namespace audio + { - static int check_header(const void *data, int size, const char *str, int offset) { - int len = strlen(str); - return (size >= offset + len) && !memcmp((char*)data + offset, str, len); - } + static int check_header(const void *data, int size, const char *str, int offset) { + int len = strlen(str); + return (size >= offset + len) && !memcmp((char*)data + offset, str, len); + } - SourceType Source::getType(const void* mem, int size) - { - if(check_header(mem, size, "WAVE", 8)) - return SourceType::WAV; - if(check_header(mem, size, "OggS", 0)) - return SourceType::OGG; - return SourceType::INVALID; - } + SourceType Source::getType(const void* mem, int size) + { + if(check_header(mem, size, "WAVE", 8)) + return SourceType::WAV; + if(check_header(mem, size, "OggS", 0)) + return SourceType::OGG; + return SourceType::INVALID; + } -} // audio + } // audio } // jin #endif // LIBJIN_MODULES_AUDIO -- cgit v1.1-26-g67d0