]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - wma_common.c
Various wma fixes.
[paraslash.git] / wma_common.c
index 9a7a22acf30bd310f2dd14f8494f93cff5adc070..c4d96ad0f62c396cac54e3fcdabca87974f241d6 100644 (file)
@@ -46,10 +46,8 @@ static int find_audio_stream_info(const char *buf, int len)
        const char pattern[] = {0x40, 0x9e, 0x69, 0xf8};
        const char *p = search_pattern(pattern, sizeof(pattern), buf, len);
 
-       if (!p) {
-               PARA_NOTICE_LOG("audio stream guid not found");
-               return -1;
-       }
+       if (!p)
+               return -E_WMA_NO_GUID;
        PARA_DEBUG_LOG("found audio stream guid@%0zx\n", p - buf);
        return p - buf;
 }
@@ -58,11 +56,9 @@ static int read_header_len(char *buf, int len)
 {
        uint16_t header_len;
 
-       if (len < 18)
-               return -1;
        header_len = read_u16(buf + 16) + 46;
        if (header_len > len)
-               return -2;
+               return -E_WMA_BAD_ASF_HEADER;
        PARA_DEBUG_LOG("header_len: %d\n", header_len);
        return header_len;
 }