1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
6 * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 *
9 * by Stan Seibert <volsung@xiph.org> AND OTHER CONTRIBUTORS *
10 * http://www.xiph.org/ *
12 ********************************************************************
14 last mod: $Id: format.c,v 1.5 2003/01/12 20:19:22 volsung Exp $
16 ********************************************************************/
25 #include "transport.h"
29 extern format_t oggvorbis_format
;
30 extern format_t speex_format
;
33 extern format_t flac_format
;
34 extern format_t oggflac_format
;
38 extern format_t speex_format
;
41 format_t
*formats
[] = {
53 format_t
*get_format_by_name (char *name
)
57 while (formats
[i
] != NULL
&& strcmp(name
, formats
[i
]->name
) != 0)
64 format_t
*select_format (data_source_t
*source
)
68 while (formats
[i
] != NULL
&& !formats
[i
]->can_decode(source
))
75 decoder_stats_t
*malloc_decoder_stats (decoder_stats_t
*to_copy
)
77 decoder_stats_t
*new_stats
;
79 new_stats
= malloc(sizeof(decoder_stats_t
));
81 if (new_stats
== NULL
) {
82 fprintf(stderr
, _("Error: Could not allocate memory in malloc_decoder_stats()\n"));
86 *new_stats
= *to_copy
; /* Copy the data */