• Home
  • Raw
  • Download

Lines Matching full:wc

80     WVContext *wc = ctx->priv_data;  in wv_read_block_header()  local
86 wc->pos = avio_tell(pb); in wv_read_block_header()
89 if (wc->apetag_start && wc->pos >= wc->apetag_start) in wv_read_block_header()
92 ret = avio_read(pb, wc->block_header, WV_HEADER_SIZE); in wv_read_block_header()
96 ret = ff_wv_parse_header(&wc->header, wc->block_header); in wv_read_block_header()
102 if (wc->header.version < 0x402 || wc->header.version > 0x410) { in wv_read_block_header()
104 wc->header.version); in wv_read_block_header()
110 if (!wc->header.samples) in wv_read_block_header()
113 flags = wc->header.flags; in wv_read_block_header()
119 wc->multichannel = !(wc->header.initial && wc->header.final); in wv_read_block_header()
120 if (wc->multichannel) { in wv_read_block_header()
121 chan = wc->chan; in wv_read_block_header()
122 chmask = wc->chmask; in wv_read_block_header()
124 if ((rate == -1 || !chan || flags & WV_DSD) && !wc->block_parsed) { in wv_read_block_header()
125 int64_t block_end = avio_tell(pb) + wc->header.blocksize; in wv_read_block_header()
201 avio_seek(pb, block_end - wc->header.blocksize, SEEK_SET); in wv_read_block_header()
203 if (!wc->bpp) in wv_read_block_header()
204 wc->bpp = bpp; in wv_read_block_header()
205 if (!wc->chan) in wv_read_block_header()
206 wc->chan = chan; in wv_read_block_header()
207 if (!wc->chmask) in wv_read_block_header()
208 wc->chmask = chmask; in wv_read_block_header()
209 if (!wc->rate) in wv_read_block_header()
210 wc->rate = rate * rate_x; in wv_read_block_header()
212 if (flags && bpp != wc->bpp) { in wv_read_block_header()
215 bpp, wc->bpp); in wv_read_block_header()
218 if (flags && !wc->multichannel && chan != wc->chan) { in wv_read_block_header()
221 chan, wc->chan); in wv_read_block_header()
224 if (flags && rate != -1 && !(flags & WV_DSD) && rate * rate_x != wc->rate) { in wv_read_block_header()
227 rate * rate_x, wc->rate); in wv_read_block_header()
236 WVContext *wc = s->priv_data; in wv_read_header() local
240 wc->block_parsed = 0; in wv_read_header()
244 if (!wc->header.samples) in wv_read_header()
245 avio_skip(pb, wc->header.blocksize); in wv_read_header()
256 AV_WL16(st->codecpar->extradata, wc->header.version); in wv_read_header()
259 st->codecpar->channels = wc->chan; in wv_read_header()
260 st->codecpar->channel_layout = wc->chmask; in wv_read_header()
261 st->codecpar->sample_rate = wc->rate; in wv_read_header()
262 st->codecpar->bits_per_coded_sample = wc->bpp; in wv_read_header()
263 avpriv_set_pts_info(st, 64, 1, wc->rate); in wv_read_header()
265 if (wc->header.total_samples != 0xFFFFFFFFu) in wv_read_header()
266 st->duration = wc->header.total_samples; in wv_read_header()
270 wc->apetag_start = ff_ape_parse_tag(s); in wv_read_header()
281 WVContext *wc = s->priv_data; in wv_read_packet() local
289 if (wc->block_parsed) { in wv_read_packet()
294 pos = wc->pos; in wv_read_packet()
295 if ((ret = av_new_packet(pkt, wc->header.blocksize + WV_HEADER_SIZE)) < 0) in wv_read_packet()
297 memcpy(pkt->data, wc->block_header, WV_HEADER_SIZE); in wv_read_packet()
298 ret = avio_read(s->pb, pkt->data + WV_HEADER_SIZE, wc->header.blocksize); in wv_read_packet()
299 if (ret != wc->header.blocksize) { in wv_read_packet()
302 while (!(wc->header.flags & WV_FLAG_FINAL_BLOCK)) { in wv_read_packet()
308 if ((ret = av_grow_packet(pkt, WV_HEADER_SIZE + wc->header.blocksize)) < 0) { in wv_read_packet()
311 memcpy(pkt->data + off, wc->block_header, WV_HEADER_SIZE); in wv_read_packet()
313 ret = avio_read(s->pb, pkt->data + off + WV_HEADER_SIZE, wc->header.blocksize); in wv_read_packet()
314 if (ret != wc->header.blocksize) { in wv_read_packet()
320 wc->block_parsed = 1; in wv_read_packet()
321 pkt->pts = wc->header.block_idx; in wv_read_packet()
322 block_samples = wc->header.samples; in wv_read_packet()