| 230 | } |
| 231 | |
| 232 | static hb_buffer_t* filterFrame( hb_filter_private_t * pv, hb_buffer_t ** buf_in ) |
| 233 | { |
| 234 | hb_buffer_list_t list; |
| 235 | hb_buffer_t * buf = NULL, * next = NULL; |
| 236 | |
| 237 | hb_avfilter_add_buf(pv->graph, buf_in); |
| 238 | buf = hb_avfilter_get_buf(pv->graph); |
| 239 | |
| 240 | while (buf != NULL) |
| 241 | { |
| 242 | hb_buffer_list_append(&pv->list, buf); |
| 243 | buf = hb_avfilter_get_buf(pv->graph); |
| 244 | } |
| 245 | // Delay one frame so we can set the stop time of the output buffer |
| 246 | hb_buffer_list_clear(&list); |
| 247 | while (hb_buffer_list_count(&pv->list) > 1) |
| 248 | { |
| 249 | buf = hb_buffer_list_rem_head(&pv->list); |
| 250 | next = hb_buffer_list_head(&pv->list); |
| 251 | |
| 252 | buf->s.stop = next->s.start; |
| 253 | buf->s.duration = buf->s.stop - buf->s.start; |
| 254 | hb_buffer_list_append(&list, buf); |
| 255 | } |
| 256 | |
| 257 | return hb_buffer_list_head(&list); |
| 258 | } |
| 259 | |
| 260 | static int avfilter_work( hb_filter_object_t * filter, |
| 261 | hb_buffer_t ** buf_in, hb_buffer_t ** buf_out ) |
no test coverage detected