History

Support filters and decoders that dont support negative linesizes. This patch is based on work by stefano.

Originally committed as revision 26108 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer committed 15 years ago

Commit 0ccabee1 parent 9e99f844 files · +15 −6Browse files

Showing the changes to libavfilter/avfilter.c (1 of 4 files). Show all

Unified · Split

libavfilter/avfilter.c+7−4
@@ -197,12 +197,13 @@ int avfilter_config_links(AVFilterContext *filter) · 196 unmodified lines
197197
198198 char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
199199 {
200− snprintf(buf, buf_size, "%s%s%s%s%s",
200+ snprintf(buf, buf_size, "%s%s%s%s%s%s",
201201 perms & AV_PERM_READ ? "r" : "",
202202 perms & AV_PERM_WRITE ? "w" : "",
203203 perms & AV_PERM_PRESERVE ? "p" : "",
204204 perms & AV_PERM_REUSE ? "u" : "",
205− perms & AV_PERM_REUSE2 ? "U" : "");
205+ perms & AV_PERM_REUSE2 ? "U" : "",
206+ perms & AV_PERM_NEG_LINESIZES ? "n" : "");
206207 return buf;
207208 }
208209
@@ -360,15 +361,17 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 151 unmodified lines
360361 {
361362 void (*start_frame)(AVFilterLink *, AVFilterBufferRef *);
362363 AVFilterPad *dst = link->dstpad;
364+ int perms = picref->perms;
363365
364366 FF_DPRINTF_START(NULL, start_frame); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " "); ff_dprintf_ref(NULL, picref, 1);
365367
366368 if (!(start_frame = dst->start_frame))
367369 start_frame = avfilter_default_start_frame;
368370
371+ if (picref->linesize[0] < 0)
372+ perms |= AV_PERM_NEG_LINESIZES;
369373 /* prepare to copy the picture if it has insufficient permissions */
370− if ((dst->min_perms & picref->perms) != dst->min_perms ||
371− dst->rej_perms & picref->perms) {
374+ if ((dst->min_perms & perms) != dst->min_perms || dst->rej_perms & perms) {
372375 av_log(link->dst, AV_LOG_DEBUG,
373376 "frame copy needed (have perms %x, need %x, reject %x)\n",
374377 picref->perms,

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