1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-02-02 15:07:36 -05:00
icecast-server/src/format.h
Jack Moffitt 6c0132596f Thanks to Ciaran for realizing that we werne't freeing the format plugins
memory on source exits.  This caused a small but noticable memory leak.

The fix was to add a new method to the format_plugin object -
free_plugin() - and have the source thread call this on shutdown.

svn path=/trunk/icecast/; revision=2946
2002-01-05 00:29:27 +00:00

42 lines
719 B
C

/* format.h
**
** format plugin header
**
*/
#ifndef __FORMAT_H__
#define __FORMAT_H__
typedef enum _format_type_tag
{
FORMAT_TYPE_VORBIS,
FORMAT_TYPE_MP3
} format_type_t;
typedef struct _format_plugin_tag
{
format_type_t type;
/* set this is the data format has a header that
** we must send before regular data
*/
int has_predata;
refbuf_t *(*get_buffer)(struct _format_plugin_tag *self, char *data, unsigned long len);
refbuf_queue_t *(*get_predata)(struct _format_plugin_tag *self);
void (*free_plugin)(struct _format_plugin_tag *self);
/* for internal state management */
void *_state;
} format_plugin_t;
format_plugin_t *format_get_plugin(format_type_t type);
#endif /* __FORMAT_H__ */