stream.c File Reference

Implementation of the mad_stream methods, which handle the input stream buffer which is to be decoded. More...

#include "global.h"
#include <stdlib.h>
#include "bit.h"
#include "stream.h"

Include dependency graph for stream.c:

Go to the source code of this file.

Functions

void mad_stream_init (struct mad_stream *stream)
 Initializes stream struct.
void mad_stream_finish (struct mad_stream *stream)
 Deallocates any dynamic memory associated with stream.
void mad_stream_buffer (struct mad_stream *stream, unsigned char const *buffer, unsigned long length)
 Sets stream buffer pointers.
void mad_stream_skip (struct mad_stream *stream, unsigned long length)
 Arranges to skip bytes before the next frame.
int mad_stream_sync (struct mad_stream *stream)
 Locates the next stream sync word.
char const * mad_stream_errorstr (struct mad_stream const *stream)
 Returns a string description of the current error condition.


Detailed Description

Implementation of the mad_stream methods, which handle the input stream buffer which is to be decoded.

Definition in file stream.c.


Function Documentation

void mad_stream_buffer ( struct mad_stream stream,
unsigned char const *  buffer,
unsigned long  length 
)

Sets stream buffer pointers.

Definition at line 80 of file stream.c.

References mad_stream::bufend, mad_stream::buffer, mad_bit_init(), mad_stream::next_frame, mad_stream::ptr, mad_stream::sync, and mad_stream::this_frame.

Referenced by input().

Here is the call graph for this function:

char const* mad_stream_errorstr ( struct mad_stream const *  stream  ) 

void mad_stream_finish ( struct mad_stream stream  ) 

Deallocates any dynamic memory associated with stream.

Definition at line 66 of file stream.c.

References mad_stream::anc_ptr, mad_bit_finish, mad_stream::main_data, and mad_stream::ptr.

Referenced by run_sync().

void mad_stream_init ( struct mad_stream stream  ) 

void mad_stream_skip ( struct mad_stream stream,
unsigned long  length 
)

Arranges to skip bytes before the next frame.

Definition at line 97 of file stream.c.

References mad_stream::skiplen.

int mad_stream_sync ( struct mad_stream stream  ) 

Locates the next stream sync word.

Definition at line 105 of file stream.c.

References mad_stream::bufend, mad_bit_init(), mad_bit_nextbyte(), MAD_BUFFER_GUARD, and mad_stream::ptr.

Referenced by free_bitrate(), and mad_header_decode().

Here is the call graph for this function:


Generated on Tue Jun 10 12:14:18 2008 for libmad by  doxygen 1.5.5