Lines Matching refs:aspect
50 FLAC__bool FLAC__ogg_decoder_aspect_init(FLAC__OggDecoderAspect *aspect) in FLAC__ogg_decoder_aspect_init() argument
53 if(ogg_stream_init(&aspect->stream_state, aspect->serial_number) != 0) in FLAC__ogg_decoder_aspect_init()
56 if(ogg_sync_init(&aspect->sync_state) != 0) in FLAC__ogg_decoder_aspect_init()
59 aspect->version_major = ~(0u); in FLAC__ogg_decoder_aspect_init()
60 aspect->version_minor = ~(0u); in FLAC__ogg_decoder_aspect_init()
62 aspect->need_serial_number = aspect->use_first_serial_number; in FLAC__ogg_decoder_aspect_init()
64 aspect->end_of_stream = false; in FLAC__ogg_decoder_aspect_init()
65 aspect->have_working_page = false; in FLAC__ogg_decoder_aspect_init()
70 void FLAC__ogg_decoder_aspect_finish(FLAC__OggDecoderAspect *aspect) in FLAC__ogg_decoder_aspect_finish() argument
72 (void)ogg_sync_clear(&aspect->sync_state); in FLAC__ogg_decoder_aspect_finish()
73 (void)ogg_stream_clear(&aspect->stream_state); in FLAC__ogg_decoder_aspect_finish()
76 void FLAC__ogg_decoder_aspect_set_serial_number(FLAC__OggDecoderAspect *aspect, long value) in FLAC__ogg_decoder_aspect_set_serial_number() argument
78 aspect->use_first_serial_number = false; in FLAC__ogg_decoder_aspect_set_serial_number()
79 aspect->serial_number = value; in FLAC__ogg_decoder_aspect_set_serial_number()
82 void FLAC__ogg_decoder_aspect_set_defaults(FLAC__OggDecoderAspect *aspect) in FLAC__ogg_decoder_aspect_set_defaults() argument
84 aspect->use_first_serial_number = true; in FLAC__ogg_decoder_aspect_set_defaults()
87 void FLAC__ogg_decoder_aspect_flush(FLAC__OggDecoderAspect *aspect) in FLAC__ogg_decoder_aspect_flush() argument
89 (void)ogg_stream_reset(&aspect->stream_state); in FLAC__ogg_decoder_aspect_flush()
90 (void)ogg_sync_reset(&aspect->sync_state); in FLAC__ogg_decoder_aspect_flush()
91 aspect->end_of_stream = false; in FLAC__ogg_decoder_aspect_flush()
92 aspect->have_working_page = false; in FLAC__ogg_decoder_aspect_flush()
95 void FLAC__ogg_decoder_aspect_reset(FLAC__OggDecoderAspect *aspect) in FLAC__ogg_decoder_aspect_reset() argument
97 FLAC__ogg_decoder_aspect_flush(aspect); in FLAC__ogg_decoder_aspect_reset()
99 if(aspect->use_first_serial_number) in FLAC__ogg_decoder_aspect_reset()
100 aspect->need_serial_number = true; in FLAC__ogg_decoder_aspect_reset()
103 …s FLAC__ogg_decoder_aspect_read_callback_wrapper(FLAC__OggDecoderAspect *aspect, FLAC__byte buffer… in FLAC__ogg_decoder_aspect_read_callback_wrapper() argument
135 while (*bytes < bytes_requested && !aspect->end_of_stream) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()
136 if (aspect->have_working_page) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()
137 if (aspect->have_working_packet) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()
139 if ((size_t)aspect->working_packet.bytes <= n) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()
141 n = aspect->working_packet.bytes; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
142 memcpy(buffer, aspect->working_packet.packet, n); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
145 aspect->have_working_packet = false; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
149 memcpy(buffer, aspect->working_packet.packet, n); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
152 aspect->working_packet.packet += n; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
153 aspect->working_packet.bytes -= n; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
158 const int ret = ogg_stream_packetout(&aspect->stream_state, &aspect->working_packet); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
160 aspect->have_working_packet = true; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
162 …if (aspect->working_packet.bytes > 0 && aspect->working_packet.packet[0] == FLAC__OGG_MAPPING_FIRS… in FLAC__ogg_decoder_aspect_read_callback_wrapper()
163 const FLAC__byte *b = aspect->working_packet.packet; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
170 if (aspect->working_packet.bytes < (long)header_length) in FLAC__ogg_decoder_aspect_read_callback_wrapper()
176 aspect->version_major = (uint32_t)(*b); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
178 aspect->version_minor = (uint32_t)(*b); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
179 if (aspect->version_major != 1) in FLAC__ogg_decoder_aspect_read_callback_wrapper()
181 aspect->working_packet.packet += header_length; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
182 aspect->working_packet.bytes -= header_length; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
186 aspect->have_working_page = false; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
196 const int ret = ogg_sync_pageout(&aspect->sync_state, &aspect->working_page); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
199 if(aspect->need_serial_number) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()
200 … aspect->stream_state.serialno = aspect->serial_number = ogg_page_serialno(&aspect->working_page); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
201 aspect->need_serial_number = false; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
203 if(ogg_stream_pagein(&aspect->stream_state, &aspect->working_page) == 0) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()
204 aspect->have_working_page = true; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
205 aspect->have_working_packet = false; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
212 char *oggbuf = ogg_sync_buffer(&aspect->sync_state, ogg_bytes_to_read); in FLAC__ogg_decoder_aspect_read_callback_wrapper()
224 aspect->end_of_stream = true; in FLAC__ogg_decoder_aspect_read_callback_wrapper()
232 if(ogg_sync_wrote(&aspect->sync_state, ogg_bytes_read) < 0) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()
246 if (aspect->end_of_stream && *bytes == 0) { in FLAC__ogg_decoder_aspect_read_callback_wrapper()