MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ssa_work

Function ssa_work

libhb/rendersub.c:846–890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

844}
845
846static int ssa_work(hb_filter_object_t *filter,
847 hb_buffer_t **buf_in,
848 hb_buffer_t **buf_out)
849{
850 hb_filter_private_t *pv = filter->private_data;
851 hb_buffer_t *in = *buf_in;
852 hb_buffer_t *sub;
853
854 if (!pv->script_initialized)
855 {
856 ssa_work_init(pv, filter->subtitle->extradata);
857 pv->script_initialized = 1;
858 }
859 if (in->s.flags & HB_BUF_FLAG_EOF)
860 {
861 *buf_in = NULL;
862 *buf_out = in;
863 return HB_FILTER_DONE;
864 }
865
866 // Get any pending subtitles and add them to the active
867 // subtitle list
868 while ((sub = hb_fifo_get(filter->subtitle->fifo_out)))
869 {
870 if (sub->s.flags & HB_BUF_FLAG_EOF)
871 {
872 hb_buffer_close(&sub);
873 break;
874 }
875 // Parse MKV-SSA packet
876 // SSA subtitles always have an explicit stop time, so we
877 // do not need to do special processing for stop == AV_NOPTS_VALUE
878 ass_process_chunk(pv->ssa_track, (char *)sub->data, sub->size,
879 sub->s.start / 90,
880 (sub->s.stop - sub->s.start) / 90);
881 hb_buffer_close(&sub);
882 }
883
884 render_ssa_subs(pv, in->s.start);
885
886 *buf_in = NULL;
887 *buf_out = pv->blend->work(pv->blend, in, &pv->rendered_sub_list, pv->changed);
888
889 return HB_FILTER_OK;
890}
891
892static int cc608sub_post_init(hb_filter_object_t *filter, hb_job_t *job)
893{

Callers 1

hb_rendersub_workFunction · 0.85

Calls 4

ssa_work_initFunction · 0.85
hb_fifo_getFunction · 0.85
hb_buffer_closeFunction · 0.85
render_ssa_subsFunction · 0.85

Tested by

no test coverage detected