Lines Matching refs:cntr
147 static int parse_riff_chunk(struct container_context *cntr,
150 struct parser_state *state = cntr->private_data;
158 memcpy(buf.chunk.id, cntr->magic, sizeof(cntr->magic));
159 err = container_recursive_read(cntr,
160 (char *)&buf.chunk + sizeof(cntr->magic),
161 sizeof(buf.chunk) - sizeof(cntr->magic));
164 if (cntr->eof)
172 err = container_recursive_read(cntr, &buf, sizeof(buf.chunk_data));
175 if (cntr->eof)
226 static int parse_wave_subchunk(struct container_context *cntr)
238 struct parser_state *state = cntr->private_data;
244 err = container_recursive_read(cntr, &buf,
248 if (cntr->eof)
283 err = container_recursive_read(cntr, &buf.subchunk.data,
287 if (cntr->eof)
315 err = container_recursive_read(cntr, &buf, consume);
318 if (cntr->eof)
327 static int parse_riff_wave_format(struct container_context *cntr)
332 err = parse_riff_chunk(cntr, &byte_count);
336 err = parse_wave_subchunk(cntr);
343 static int wave_parser_pre_process(struct container_context *cntr,
349 struct parser_state *state = cntr->private_data;
355 err = parse_riff_wave_format(cntr);
467 static int write_riff_chunk_for_wave(struct container_context *cntr,
470 struct builder_state *state = cntr->private_data;
484 if (byte_count > cntr->max_size - total_byte_count)
485 total_byte_count = cntr->max_size;
489 err = container_recursive_write(cntr, &buf, sizeof(buf.chunk));
495 err = container_recursive_write(cntr, &buf, sizeof(buf.chunk_data));
501 err = container_recursive_write(cntr, &buf, sizeof(buf.fmt_subchunk));
507 return container_recursive_write(cntr, &buf, sizeof(buf.data_subchunk));
510 static int wave_builder_pre_process(struct container_context *cntr,
516 struct builder_state *state = cntr->private_data;
535 return write_riff_chunk_for_wave(cntr, *byte_count);
538 static int wave_builder_post_process(struct container_context *cntr,
543 err = container_seek_offset(cntr, 0);
547 return write_riff_chunk_for_wave(cntr, handled_byte_count);