summaryrefslogtreecommitdiff
path: root/apps/codecs/libmad/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libmad/stream.c')
-rw-r--r--apps/codecs/libmad/stream.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/apps/codecs/libmad/stream.c b/apps/codecs/libmad/stream.c
index 69c963bb0d..2936736f76 100644
--- a/apps/codecs/libmad/stream.c
+++ b/apps/codecs/libmad/stream.c
@@ -29,8 +29,8 @@
29# include "stream.h" 29# include "stream.h"
30 30
31/* 31/*
32 * NAME: stream->init() 32 * NAME: stream->init()
33 * DESCRIPTION: initialize stream struct 33 * DESCRIPTION: initialize stream struct
34 */ 34 */
35void mad_stream_init(struct mad_stream *stream) 35void mad_stream_init(struct mad_stream *stream)
36{ 36{
@@ -56,8 +56,8 @@ void mad_stream_init(struct mad_stream *stream)
56} 56}
57 57
58/* 58/*
59 * NAME: stream->finish() 59 * NAME: stream->finish()
60 * DESCRIPTION: deallocate any dynamic memory associated with stream 60 * DESCRIPTION: deallocate any dynamic memory associated with stream
61 */ 61 */
62void mad_stream_finish(struct mad_stream *stream) 62void mad_stream_finish(struct mad_stream *stream)
63{ 63{
@@ -71,11 +71,11 @@ void mad_stream_finish(struct mad_stream *stream)
71} 71}
72 72
73/* 73/*
74 * NAME: stream->buffer() 74 * NAME: stream->buffer()
75 * DESCRIPTION: set stream buffer pointers 75 * DESCRIPTION: set stream buffer pointers
76 */ 76 */
77void mad_stream_buffer(struct mad_stream *stream, 77void mad_stream_buffer(struct mad_stream *stream,
78 unsigned char const *buffer, unsigned long length) 78 unsigned char const *buffer, unsigned long length)
79{ 79{
80 stream->buffer = buffer; 80 stream->buffer = buffer;
81 stream->bufend = buffer + length; 81 stream->bufend = buffer + length;
@@ -89,8 +89,8 @@ void mad_stream_buffer(struct mad_stream *stream,
89} 89}
90 90
91/* 91/*
92 * NAME: stream->skip() 92 * NAME: stream->skip()
93 * DESCRIPTION: arrange to skip bytes before the next frame 93 * DESCRIPTION: arrange to skip bytes before the next frame
94 */ 94 */
95void mad_stream_skip(struct mad_stream *stream, unsigned long length) 95void mad_stream_skip(struct mad_stream *stream, unsigned long length)
96{ 96{
@@ -98,8 +98,8 @@ void mad_stream_skip(struct mad_stream *stream, unsigned long length)
98} 98}
99 99
100/* 100/*
101 * NAME: stream->sync() 101 * NAME: stream->sync()
102 * DESCRIPTION: locate the next stream sync word 102 * DESCRIPTION: locate the next stream sync word
103 */ 103 */
104int mad_stream_sync(struct mad_stream *stream) 104int mad_stream_sync(struct mad_stream *stream)
105{ 105{
@@ -109,7 +109,7 @@ int mad_stream_sync(struct mad_stream *stream)
109 end = stream->bufend; 109 end = stream->bufend;
110 110
111 while (ptr < end - 1 && 111 while (ptr < end - 1 &&
112 !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0)) 112 !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0))
113 ++ptr; 113 ++ptr;
114 114
115 if (end - ptr < MAD_BUFFER_GUARD) 115 if (end - ptr < MAD_BUFFER_GUARD)
@@ -121,38 +121,38 @@ int mad_stream_sync(struct mad_stream *stream)
121} 121}
122 122
123/* 123/*
124 * NAME: stream->errorstr() 124 * NAME: stream->errorstr()
125 * DESCRIPTION: return a string description of the current error condition 125 * DESCRIPTION: return a string description of the current error condition
126 */ 126 */
127char const *mad_stream_errorstr(struct mad_stream const *stream) 127char const *mad_stream_errorstr(struct mad_stream const *stream)
128{ 128{
129 switch (stream->error) { 129 switch (stream->error) {
130 case MAD_ERROR_NONE: return "no error"; 130 case MAD_ERROR_NONE: return "no error";
131 131
132 case MAD_ERROR_BUFLEN: return "input buffer too small (or EOF)"; 132 case MAD_ERROR_BUFLEN: return "input buffer too small (or EOF)";
133 case MAD_ERROR_BUFPTR: return "invalid (null) buffer pointer"; 133 case MAD_ERROR_BUFPTR: return "invalid (null) buffer pointer";
134 134
135 case MAD_ERROR_NOMEM: return "not enough memory"; 135 case MAD_ERROR_NOMEM: return "not enough memory";
136 136
137 case MAD_ERROR_LOSTSYNC: return "lost synchronization"; 137 case MAD_ERROR_LOSTSYNC: return "lost synchronization";
138 case MAD_ERROR_BADLAYER: return "reserved header layer value"; 138 case MAD_ERROR_BADLAYER: return "reserved header layer value";
139 case MAD_ERROR_BADBITRATE: return "forbidden bitrate value"; 139 case MAD_ERROR_BADBITRATE: return "forbidden bitrate value";
140 case MAD_ERROR_BADSAMPLERATE: return "reserved sample frequency value"; 140 case MAD_ERROR_BADSAMPLERATE: return "reserved sample frequency value";
141 case MAD_ERROR_BADEMPHASIS: return "reserved emphasis value"; 141 case MAD_ERROR_BADEMPHASIS: return "reserved emphasis value";
142 142
143 case MAD_ERROR_BADCRC: return "CRC check failed"; 143 case MAD_ERROR_BADCRC: return "CRC check failed";
144 case MAD_ERROR_BADBITALLOC: return "forbidden bit allocation value"; 144 case MAD_ERROR_BADBITALLOC: return "forbidden bit allocation value";
145 case MAD_ERROR_BADSCALEFACTOR: return "bad scalefactor index"; 145 case MAD_ERROR_BADSCALEFACTOR: return "bad scalefactor index";
146 case MAD_ERROR_BADMODE: return "bad bitrate/mode combination"; 146 case MAD_ERROR_BADMODE: return "bad bitrate/mode combination";
147 case MAD_ERROR_BADFRAMELEN: return "bad frame length"; 147 case MAD_ERROR_BADFRAMELEN: return "bad frame length";
148 case MAD_ERROR_BADBIGVALUES: return "bad big_values count"; 148 case MAD_ERROR_BADBIGVALUES: return "bad big_values count";
149 case MAD_ERROR_BADBLOCKTYPE: return "reserved block_type"; 149 case MAD_ERROR_BADBLOCKTYPE: return "reserved block_type";
150 case MAD_ERROR_BADSCFSI: return "bad scalefactor selection info"; 150 case MAD_ERROR_BADSCFSI: return "bad scalefactor selection info";
151 case MAD_ERROR_BADDATAPTR: return "bad main_data_begin pointer"; 151 case MAD_ERROR_BADDATAPTR: return "bad main_data_begin pointer";
152 case MAD_ERROR_BADPART3LEN: return "bad audio data length"; 152 case MAD_ERROR_BADPART3LEN: return "bad audio data length";
153 case MAD_ERROR_BADHUFFTABLE: return "bad Huffman table select"; 153 case MAD_ERROR_BADHUFFTABLE: return "bad Huffman table select";
154 case MAD_ERROR_BADHUFFDATA: return "Huffman data overrun"; 154 case MAD_ERROR_BADHUFFDATA: return "Huffman data overrun";
155 case MAD_ERROR_BADSTEREO: return "incompatible block_type for JS"; 155 case MAD_ERROR_BADSTEREO: return "incompatible block_type for JS";
156 } 156 }
157 157
158 return 0; 158 return 0;