<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - module-tunnel screws up latency calculation on suspend"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=66855#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - module-tunnel screws up latency calculation on suspend"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=66855">bug 66855</a>
              from <span class="vcard"><a class="email" href="mailto:pierre-bugzilla@ossman.eu" title="Pierre Ossman <pierre-bugzilla@ossman.eu>"> <span class="fn">Pierre Ossman</span></a>
</span></b>
        <pre>Very silly bug. The worker threads in module-tunnel looked at the wrong state
variable. Fix:

Index: src/modules/module-tunnel.c
===================================================================
--- src/modules/module-tunnel.c    (revision 27672)
+++ src/modules/module-tunnel.c    (revision 27674)
@@ -502,9 +502,9 @@
             /* First, change the state, because otherwise pa_sink_render()
would fail */
             if ((r = pa_sink_process_msg(o, code, data, offset, chunk)) >= 0)
{

-                stream_cork_within_thread(u, u->sink->state ==
PA_SINK_SUSPENDED);
+                stream_cork_within_thread(u, u->sink->thread_info.state ==
PA_SINK_SUSPENDED);

-                if (PA_SINK_IS_OPENED(u->sink->state))
+                if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
                     send_data(u);
             }

@@ -613,7 +613,7 @@
             int r;

             if ((r = pa_source_process_msg(o, code, data, offset, chunk)) >=
0)
-                stream_cork_within_thread(u, u->source->state ==
PA_SOURCE_SUSPENDED);
+                stream_cork_within_thread(u, u->source->thread_info.state ==
PA_SOURCE_SUSPENDED);

             return r;
         }</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>