Browse Source

lavfi: detect merge failure for unknown layouts.

Detect when filtering known layouts from an explicit list
results in an empty list.

Fix erratic behavior.
tags/n2.0
Nicolas George 12 years ago
parent
commit
f810ca63f8
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavfilter/formats.c

+ 4
- 0
libavfilter/formats.c View File

@@ -184,6 +184,10 @@ AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
for (i = j = 0; i < b->nb_channel_layouts; i++) for (i = j = 0; i < b->nb_channel_layouts; i++)
if (KNOWN(b->channel_layouts[i])) if (KNOWN(b->channel_layouts[i]))
b->channel_layouts[j++] = b->channel_layouts[i]; b->channel_layouts[j++] = b->channel_layouts[i];
/* Not optimal: the unknown layouts of b may become known after
another merge. */
if (!j)
return NULL;
b->nb_channel_layouts = j; b->nb_channel_layouts = j;
} }
MERGE_REF(b, a, channel_layouts, AVFilterChannelLayouts, fail); MERGE_REF(b, a, channel_layouts, AVFilterChannelLayouts, fail);


Loading…
Cancel
Save