Lines Matching full:vb

46   vorbis_block vb;  member
106 priv_t * vb = (priv_t *) ft->priv; in startread() local
119 vb->vf = lsx_malloc(sizeof(OggVorbis_File)); in startread()
122 if (ov_open_callbacks(ft, vb->vf, NULL, (size_t) 0, callbacks) < 0) { in startread()
128 vi = ov_info(vb->vf, -1); in startread()
129 vc = ov_comment(vb->vf, -1); in startread()
141 ft->signal.length = ov_pcm_total(vb->vf, -1) * ft->signal.channels; in startread()
148 vb->buf_len = DEF_BUF_LEN; in startread()
149 vb->buf_len -= vb->buf_len % (vi->channels*2); /* 2 bytes per sample */ in startread()
150 vb->buf = lsx_calloc(vb->buf_len, sizeof(char)); in startread()
151 vb->start = vb->end = 0; in startread()
154 vb->eof = 0; in startread()
155 vb->current_section = -1; in startread()
164 static int refill_buffer(priv_t * vb) in refill_buffer() argument
168 if (vb->start == vb->end) /* Samples all played */ in refill_buffer()
169 vb->start = vb->end = 0; in refill_buffer()
171 while (vb->end < vb->buf_len) { in refill_buffer()
172 num_read = ov_read(vb->vf, vb->buf + vb->end, in refill_buffer()
173 (int) (vb->buf_len - vb->end), 0, 2, 1, &vb->current_section); in refill_buffer()
181 vb->end += num_read; in refill_buffer()
196 priv_t * vb = (priv_t *) ft->priv; in read_samples() local
203 if (vb->start == vb->end) { in read_samples()
204 if (vb->eof) in read_samples()
206 ret = refill_buffer(vb); in read_samples()
208 vb->eof = 1; in read_samples()
209 if (vb->end == 0) in read_samples()
214 l = (vb->buf[vb->start + 1] << 24) in read_samples()
215 | (0xffffff & (vb->buf[vb->start] << 16)); in read_samples()
217 vb->start += 2; in read_samples()
228 priv_t * vb = (priv_t *) ft->priv; in stopread() local
230 free(vb->buf); in stopread()
231 ov_clear(vb->vf); in stopread()
296 priv_t * vb = (priv_t *) ft->priv; in startwrite() local
304 ve = vb->vorbis_enc_data = lsx_malloc(sizeof(vorbis_enc_t)); in startwrite()
331 vorbis_block_init(&ve->vd, &ve->vb); in startwrite()
347 priv_t * vb = (priv_t *) ft->priv; in write_samples() local
348 vorbis_enc_t *ve = vb->vorbis_enc_data; in write_samples()
363 while (vorbis_analysis_blockout(&ve->vd, &ve->vb) == 1) { in write_samples()
365 vorbis_analysis(&ve->vb, &ve->op); in write_samples()
366 vorbis_bitrate_addblock(&ve->vb); in write_samples()
397 priv_t * vb = (priv_t *) ft->priv; in stopwrite() local
398 vorbis_enc_t *ve = vb->vorbis_enc_data; in stopwrite()
404 vorbis_block_clear(&ve->vb); in stopwrite()
413 priv_t * vb = (priv_t *) ft->priv; in seek() local
415 return ov_pcm_seek(vb->vf, (ogg_int64_t)(offset / ft->signal.channels))? SOX_EOF:SOX_SUCCESS; in seek()