link: track active state of nodes

Keep track of the node active state, when both are active, we can
prepare (negotiate) the link.

After a link has been prepared we can activate it. When we deactivate
the link, we don't need to prepare again.

When a port loses buffers or format, set the link back to the
unprepared state.

This fixes the case where:
 1) a node becomes inactive and goes to suspend, the link becomes
    unprepared
 2) the node becomes active again and need to be prepared again
This commit is contained in:
Wim Taymans 2020-04-28 11:45:52 +02:00
parent 68268a0116
commit f5e4a6b225
2 changed files with 57 additions and 46 deletions

View file

@ -726,6 +726,7 @@ struct pw_impl_link {
unsigned int registered:1;
unsigned int feedback:1;
unsigned int preparing:1;
unsigned int prepared:1;
};