Lines Matching defs:ctx

213 static uint8_t *realloc_section_array(ASSSplitContext *ctx)
215 const ASSSection *section = &ass_sections[ctx->current_section];
216 int *count = (int *)((uint8_t *)&ctx->ass + section->offset_count);
217 void **section_ptr = (void **)((uint8_t *)&ctx->ass + section->offset);
255 static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
257 const ASSSection *section = &ass_sections[ctx->current_section];
258 int *number = &ctx->field_number[ctx->current_section];
259 int *order = ctx->field_order[ctx->current_section];
264 ctx->current_section = -1;
276 ctx->current_section = i;
277 section = &ass_sections[ctx->current_section];
278 number = &ctx->field_number[ctx->current_section];
279 order = ctx->field_order[ctx->current_section];
303 ctx->field_order[ctx->current_section] = order;
310 uint8_t *ptr, *struct_ptr = realloc_section_array(ctx);
318 ctx->field_order[ctx->current_section] = order;
342 uint8_t *ptr = (uint8_t *)&ctx->ass + section->offset;
357 static int ass_split(ASSSplitContext *ctx, const char *buf)
362 if (ctx->current_section >= 0)
363 buf = ass_split_section(ctx, buf);
371 ctx->current_section = i;
372 buf = ass_split_section(ctx, buf);
384 ASSSplitContext *ctx = av_mallocz(sizeof(*ctx));
385 if (!ctx)
389 ctx->current_section = -1;
390 if (ass_split(ctx, buf) < 0) {
391 ff_ass_split_free(ctx);
394 return ctx;
397 static void free_section(ASSSplitContext *ctx, const ASSSection *section)
399 uint8_t *ptr = (uint8_t *)&ctx->ass + section->offset;
404 count = (int *)((uint8_t *)&ctx->ass + section->offset_count);
418 av_freep((uint8_t *)&ctx->ass + section->offset);
433 ASSDialog *ff_ass_split_dialog(ASSSplitContext *ctx, const char *buf)
470 void ff_ass_split_free(ASSSplitContext *ctx)
472 if (ctx) {
475 free_section(ctx, &ass_sections[i]);
476 av_freep(&(ctx->field_order[i]));
478 av_free(ctx);
578 ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style)
580 ASS *ass = &ctx->ass;