Unified · Split
| @@ -157,8 +157,6 @@ static int config_input(AVFilterLink *inlink) · 156 unmodified lines | ||
| 157 | 157 | return 0; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | −static int null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { return 0; } | |
| 161 | − | |
| 162 | 160 | /* libass stores an RGBA color in the format RRGGBBTT, where TT is the transparency level */ |
| 163 | 161 | #define AR(c) ( (c)>>24) |
| 164 | 162 | #define AG(c) (((c)>>16)&0xFF) |
| @@ -180,12 +178,11 @@ static void overlay_ass_image(AssContext *ass, AVFilterBufferRef *picref, · 15 unmodified lines | ||
| 180 | 178 | } |
| 181 | 179 | } |
| 182 | 180 | |
| 183 | −static int end_frame(AVFilterLink *inlink) | |
| 181 | +static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) | |
| 184 | 182 | { |
| 185 | 183 | AVFilterContext *ctx = inlink->dst; |
| 186 | 184 | AVFilterLink *outlink = ctx->outputs[0]; |
| 187 | 185 | AssContext *ass = ctx->priv; |
| 188 | − AVFilterBufferRef *picref = inlink->cur_buf; | |
| 189 | 186 | int detect_change = 0; |
| 190 | 187 | double time_ms = picref->pts * av_q2d(inlink->time_base) * 1000; |
| 191 | 188 | ASS_Image *image = ass_render_frame(ass->renderer, ass->track, |
| @@ -196,20 +193,16 @@ static int end_frame(AVFilterLink *inlink) · 4 unmodified lines | ||
| 196 | 193 | |
| 197 | 194 | overlay_ass_image(ass, picref, image); |
| 198 | 195 | |
| 199 | − ff_draw_slice(outlink, 0, picref->video->h, 1); | |
| 200 | − return ff_end_frame(outlink); | |
| 196 | + return ff_filter_frame(outlink, picref); | |
| 201 | 197 | } |
| 202 | 198 | |
| 203 | 199 | static const AVFilterPad ass_inputs[] = { |
| 204 | 200 | { |
| 205 | 201 | .name = "default", |
| 206 | 202 | .type = AVMEDIA_TYPE_VIDEO, |
| 207 | − .get_video_buffer = ff_null_get_video_buffer, | |
| 208 | − .start_frame = ff_null_start_frame, | |
| 209 | − .draw_slice = null_draw_slice, | |
| 210 | − .end_frame = end_frame, | |
| 203 | + .filter_frame = filter_frame, | |
| 211 | 204 | .config_props = config_input, |
| 212 | − .min_perms = AV_PERM_WRITE | AV_PERM_READ, | |
| 205 | + .min_perms = AV_PERM_READ | AV_PERM_WRITE, | |
| 213 | 206 | }, |
| 214 | 207 | { NULL } |
| 215 | 208 | }; |