Lines Matching refs:mad_stream
79 struct mad_stream mad_stream; in mp3_duration() local
87 p->mad_stream_init(&mad_stream); in mp3_duration()
93 size_t leftover = mad_stream.bufend - mad_stream.next_frame; in mp3_duration()
95 memmove(p->mp3_buffer, mad_stream.this_frame, leftover); in mp3_duration()
103 p->mad_stream_buffer(&mad_stream, p->mp3_buffer + padding, leftover + read - padding); in mp3_duration()
106 mad_stream.error = MAD_ERROR_NONE; in mp3_duration()
107 if (p->mad_header_decode(&mad_header, &mad_stream) == -1) { in mp3_duration()
108 if (mad_stream.error == MAD_ERROR_BUFLEN) in mp3_duration()
110 if (!MAD_RECOVERABLE(mad_stream.error)) { in mp3_duration()
114 if (mad_stream.error == MAD_ERROR_LOSTSYNC) { in mp3_duration()
115 unsigned available = (mad_stream.bufend - mad_stream.this_frame); in mp3_duration()
116 tagsize = tagtype(mad_stream.this_frame, (size_t) available); in mp3_duration()
122 p->mad_stream_skip(&mad_stream, min(tagsize, available)); in mp3_duration()
131 consumed += mad_stream.next_frame - mad_stream.this_frame; in mp3_duration()
139 if (p->mad_frame_decode(&mad_frame, &mad_stream) == -1) in mp3_duration()
140 if (!MAD_RECOVERABLE(mad_stream.error)) { in mp3_duration()
144 if ((frames = xing_frames(p, mad_stream.anc_ptr, mad_stream.anc_bitlen))) { in mp3_duration()
161 } while (mad_stream.error == MAD_ERROR_BUFLEN); in mp3_duration()
165 p->mad_stream_finish(&mad_stream); in mp3_duration()