paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Functions
wma_common.c File Reference

Functions used by both the WMA afh and decoder. More...

#include <sys/types.h>
#include "para.h"
#include "error.h"
#include "afh.h"
#include "portable_io.h"
#include "imdct.h"
#include "wma.h"

Functions

const char * search_pattern (const char *pattern, int pattern_len, const char *buf, int buf_size)
 Find the first occurrence of the given pattern. More...
 
int read_asf_header (const char *buf, int loaded, struct asf_header_info *ahi)
 Read an asf audio file header. More...
 
__a_const int wma_log2 (unsigned int v)
 Compute the base-2 logarithm. More...
 

Detailed Description

Functions used by both the WMA afh and decoder.

Function Documentation

◆ search_pattern()

const char* search_pattern ( const char *  pattern,
int  pattern_len,
const char *  buf,
int  buf_size 
)

Find the first occurrence of the given pattern.

Parameters
patternThe pattern to search for.
pattern_lenThe length of the pattern in bytes.
bufThe buffer to search for the pattern.
buf_sizeThe number of bytes in buf.
Returns
A pointer into buf or NULL if the pattern was not found.

References PARA_DEBUG_LOG, and PARA_NOTICE_LOG.

◆ read_asf_header()

int read_asf_header ( const char *  buf,
int  loaded,
struct asf_header_info ahi 
)

Read an asf audio file header.

Parameters
bufThe input buffer.
loadedNumber of bytes in buf.
ahiResult pointer.
Returns
Negative on errors, zero if more data is needed in order to read the full header, 1 on success.

References asf_header_info::header_len.

◆ wma_log2()

__a_const int wma_log2 ( unsigned int  v)

Compute the base-2 logarithm.

Parameters
vThe value to compute the logarithm of.
Returns
An integer approximation of log2(v).