-
When an application sets a device for a newly created stream, we treat that as a temporary setting, and don't save it as the preferred device for future streams. The handling for this was broken, however: if the stream already had a preferred device saved in the stream-restore database, that was unset. This was a regression introduced in bc0e7283 and 70bbbcdc. These commits tried to detect in subscribe_callback() when the preferred device is cleared, but as a side effect the preferred device started to get cleared from the database also when a stream was created with a device set by the application. There's no way for subscribe_callback() to distinguish the different cases of the preferred device being NULL. This problem is solved by using the PREFERRED_SINK/SOURCE_CHANGED hooks. The hooks are only called when the preferred device really changes. Fixes: pulseaudio/pulseaudio#1063 Part-of: <pulseaudio/pulseaudio!535>
8a87af38