History

avfilter/avfilter: Move init_state to FilterLinkInternal

Andreas Rheinhardt committed 2 years ago

Commit 40b91ea1 parent 89eea4e3 files · +11 −10Browse files

Unified · Split

3 files
  1. libavfilter/avfilter.c +4 −3
  2. libavfilter/avfilter.h +0 −7
  3. libavfilter/avfilter_internal.h +7 −0
libavfilter/avfilter.c+4−3
@@ -322,6 +322,7 @@ int avfilter_config_links(AVFilterContext *filter) · 321 unmodified lines
322 for (i = 0; i < filter->nb_inputs; i ++) {322 for (i = 0; i < filter->nb_inputs; i ++) {
323 AVFilterLink *link = filter->inputs[i];323 AVFilterLink *link = filter->inputs[i];
324 AVFilterLink *inlink;324 AVFilterLink *inlink;
325 FilterLinkInternal *li = ff_link_internal(link);
325 326
326 if (!link) continue;327 if (!link) continue;
327 if (!link->src || !link->dst) {328 if (!link->src || !link->dst) {
@@ -334,14 +335,14 @@ int avfilter_config_links(AVFilterContext *filter) · 6 unmodified lines
334 link->current_pts =335 link->current_pts =
335 link->current_pts_us = AV_NOPTS_VALUE;336 link->current_pts_us = AV_NOPTS_VALUE;
336 337
337 switch (link->init_state) {338 switch (li->init_state) {
338 case AVLINK_INIT:339 case AVLINK_INIT:
339 continue;340 continue;
340 case AVLINK_STARTINIT:341 case AVLINK_STARTINIT:
341 av_log(filter, AV_LOG_INFO, "circular filter chain detected\n");342 av_log(filter, AV_LOG_INFO, "circular filter chain detected\n");
342 return 0;343 return 0;
343 case AVLINK_UNINIT:344 case AVLINK_UNINIT:
344 link->init_state = AVLINK_STARTINIT;345 li->init_state = AVLINK_STARTINIT;
345 346
346 if ((ret = avfilter_config_links(link->src)) < 0)347 if ((ret = avfilter_config_links(link->src)) < 0)
347 return ret;348 return ret;
@@ -412,7 +413,7 @@ int avfilter_config_links(AVFilterContext *filter) · 64 unmodified lines
412 return ret;413 return ret;
413 }414 }
414 415
415 link->init_state = AVLINK_INIT;416 li->init_state = AVLINK_INIT;
416 }417 }
417 }418 }
418 419
libavfilter/avfilter.h+0−7
@@ -611,13 +611,6 @@ struct AVFilterLink { · 610 unmodified lines
611 */611 */
612 AVFilterFormatsConfig outcfg;612 AVFilterFormatsConfig outcfg;
613 613
614 /** stage of the initialization of the link properties (dimensions, etc) */
615 enum {
616 AVLINK_UNINIT = 0, ///< not started
617 AVLINK_STARTINIT, ///< started, but incomplete
618 AVLINK_INIT ///< complete
619 } init_state;
620
621 /**614 /**
622 * Graph the filter belongs to.615 * Graph the filter belongs to.
623 */616 */
libavfilter/avfilter_internal.h+7−0
@@ -63,6 +63,13 @@ typedef struct FilterLinkInternal { · 62 unmodified lines
63 * corresponding code.63 * corresponding code.
64 */64 */
65 int status_out;65 int status_out;
66
67 /** stage of the initialization of the link properties (dimensions, etc) */
68 enum {
69 AVLINK_UNINIT = 0, ///< not started
70 AVLINK_STARTINIT, ///< started, but incomplete
71 AVLINK_INIT ///< complete
72 } init_state;
66} FilterLinkInternal;73} FilterLinkInternal;
67 74
68static inline FilterLinkInternal *ff_link_internal(AVFilterLink *link)75static inline FilterLinkInternal *ff_link_internal(AVFilterLink *link)

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