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