History

The filter framework as is hangs with filters that modify the input buffer, even if it asks for the right permission. This is a fix for that. See "Box blurring with libavfilter" thread in libav-user.

Commited in SoC by Vitor Sessak on 2008-02-09 11:03:35 Originally committed as revision 12040 to svn://svn.ffmpeg.org/ffmpeg/trunk

Vitor Sessak committed 18 years ago

Commit 35db4071 parent 7b02c481 file · +8 −4Browse files

Unified · Split

libavfilter/avfilter.c+8−4
@@ -213,10 +213,12 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref) · 212 unmodified lines
213 /* prepare to copy the picture if it has insufficient permissions */213 /* prepare to copy the picture if it has insufficient permissions */
214 if((link_dpad(link).min_perms & picref->perms) != link_dpad(link).min_perms ||214 if((link_dpad(link).min_perms & picref->perms) != link_dpad(link).min_perms ||
215 link_dpad(link).rej_perms & picref->perms) {215 link_dpad(link).rej_perms & picref->perms) {
216 /*
216 av_log(link->dst, AV_LOG_INFO,217 av_log(link->dst, AV_LOG_INFO,
217 "frame copy needed (have perms %x, need %x, reject %x)\n",218 "frame copy needed (have perms %x, need %x, reject %x)\n",
218 picref->perms,219 picref->perms,
219 link_dpad(link).min_perms, link_dpad(link).rej_perms);220 link_dpad(link).min_perms, link_dpad(link).rej_perms);
221 */
220 222
221 link->cur_pic = avfilter_default_get_video_buffer(link, link_dpad(link).min_perms);223 link->cur_pic = avfilter_default_get_video_buffer(link, link_dpad(link).min_perms);
222 link->srcpic = picref;224 link->srcpic = picref;
@@ -231,6 +233,11 @@ void avfilter_end_frame(AVFilterLink *link) · 8 unmodified lines
231{233{
232 void (*end_frame)(AVFilterLink *);234 void (*end_frame)(AVFilterLink *);
233 235
236 if(!(end_frame = link_dpad(link).end_frame))
237 end_frame = avfilter_default_end_frame;
238
239 end_frame(link);
240
234 /* unreference the source picture if we're feeding the destination filter241 /* unreference the source picture if we're feeding the destination filter
235 * a copied version dues to permission issues */242 * a copied version dues to permission issues */
236 if(link->srcpic) {243 if(link->srcpic) {
@@ -238,10 +245,6 @@ void avfilter_end_frame(AVFilterLink *link) · 1 unmodified line
238 link->srcpic = NULL;245 link->srcpic = NULL;
239 }246 }
240 247
241 if(!(end_frame = link_dpad(link).end_frame))
242 end_frame = avfilter_default_end_frame;
243
244 end_frame(link);
245}248}
246 249
247void avfilter_draw_slice(AVFilterLink *link, int y, int h)250void avfilter_draw_slice(AVFilterLink *link, int y, int h)
@@ -253,6 +256,7 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h) · 5 unmodified lines
253 if(link->srcpic) {256 if(link->srcpic) {
254 avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub);257 avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub);
255 258
259 link->cur_pic->pts = link->srcpic->pts;
256 src[0] = link->srcpic-> data[0] + y * link->srcpic-> linesize[0];260 src[0] = link->srcpic-> data[0] + y * link->srcpic-> linesize[0];
257 dst[0] = link->cur_pic->data[0] + y * link->cur_pic->linesize[0];261 dst[0] = link->cur_pic->data[0] + y * link->cur_pic->linesize[0];
258 for(i = 1; i < 4; i ++) {262 for(i = 1; i < 4; i ++) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t