Lines Matching refs:ctx
118 SCDDemuxContext *ctx = s->priv_data;
124 ctx->hdr.table0.count = AV_RB16(buf + 0);
125 ctx->hdr.table1.count = AV_RB16(buf + 2);
126 ctx->hdr.table2.count = AV_RB16(buf + 4);
127 ctx->hdr.unk2 = AV_RB16(buf + 6);
128 ctx->hdr.table0.offset = AV_RB32(buf + 8);
129 ctx->hdr.table1.offset = AV_RB32(buf + 12);
130 ctx->hdr.table2.offset = AV_RB32(buf + 16);
131 ctx->hdr.unk3 = AV_RB32(buf + 20);
132 ctx->hdr.unk4 = AV_RB32(buf + 24);
134 if ((ret = scd_read_table(s, &ctx->hdr.table0)) < 0)
137 if ((ret = scd_read_table(s, &ctx->hdr.table1)) < 0)
140 if ((ret = scd_read_table(s, &ctx->hdr.table2)) < 0)
152 SCDDemuxContext *ctx = s->priv_data;
163 hoffset = ctx->hdr.table1.entries[index];
240 SCDDemuxContext *ctx = s->priv_data;
246 ctx->hdr.magic = AV_RB64(buf + 0);
247 ctx->hdr.version = AV_RB32(buf + 8);
248 ctx->hdr.unk1 = AV_RB16(buf + 12);
249 ctx->hdr.header_size = AV_RB16(buf + 14);
250 ctx->hdr.file_size = AV_RB32(buf + 16);
252 if (ctx->hdr.magic != SCD_MAGIC)
255 if (ctx->hdr.version != 3) {
256 avpriv_request_sample(s, "SCD version %u", ctx->hdr.version);
260 if (ctx->hdr.header_size < SCD_MIN_HEADER_SIZE)
263 if ((ret = avio_skip(s->pb, ctx->hdr.header_size - SCD_MIN_HEADER_SIZE)) < 0)
269 ctx->tracks = av_calloc(ctx->hdr.table1.count, sizeof(SCDTrackHeader));
270 if (ctx->tracks == NULL)
273 for (int i = 0; i < ctx->hdr.table1.count; i++) {
274 if ((ret = scd_read_track(s, ctx->tracks + i, i)) < 0)
278 if (ctx->hdr.table1.count == 0)
281 if ((ret = avio_seek(s->pb, ctx->tracks[0].absolute_offset, SEEK_SET)) < 0)
289 SCDDemuxContext *ctx = s->priv_data;
293 for (int i = 0; i < ctx->hdr.table1.count; i++) {
298 ctx->current_track %= ctx->hdr.table1.count;
300 trk = ctx->tracks + ctx->current_track;
301 par = s->streams[ctx->current_track]->codecpar;
334 pkt->stream_index = ctx->current_track;
336 ctx->current_track++;
346 SCDDemuxContext *ctx = s->priv_data;
351 for(int i = 0; i < ctx->hdr.table1.count; ++i)
352 ctx->tracks[i].bytes_read = 0;
359 SCDDemuxContext *ctx = s->priv_data;
361 av_freep(&ctx->hdr.table0.entries);
362 av_freep(&ctx->hdr.table1.entries);
363 av_freep(&ctx->hdr.table2.entries);
364 av_freep(&ctx->tracks);