<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - module-rescue-streams chooses the target sink badly"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=85488">85488</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>module-rescue-streams chooses the target sink badly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>PulseAudio
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>modules
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tanuk@iki.fi
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lennart@poettering.net
          </td>
        </tr></table>
      <p>
        <div>
        <pre>module-rescue-streams uses different logic for selecting the target sink than
what the core uses for selecting the new default sink when the old default sink
disappears. This causes unexpected behaviour in the following scenario:

- there are three sinks: A, B and C
- A is the default sink
- there's a stream playing to A
- A disappears, module-rescue-stream moves the stream to B, and C becomes the
new default sink (this is already a bit unexpected, but it gets worse)
- A appears again
- module-switch-on-connect makes A the default sink. module-switch-on-connect
should also move the stream back to A, but it doesn't, because the stream is
now playing to B, which is a non-default sink, so module-switch-on-connect
assumes that the user explicitly moved the stream to B, which the user did not
do.

This problem could be avoided if module-rescue-streams used the same logic as
what is used for choosing the new default sink when the old default sink
disappears. To ensure that the logic is exactly the same, the logic should be
implemented in a shared function that is used in both cases.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>