-#ifdef WIN32
- if( vlc_thread_create( p_sys->p_thread, "sout write thread", ThreadWrite,
- VLC_THREAD_PRIORITY_HIGHEST, VLC_FALSE ) )
-#else
- if( vlc_thread_create( p_sys->p_thread, "sout write thread", ThreadWrite,
- VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE ) )
-#endif
+ if (net_GetPeerAddress (i_handle, addr, &port) == 0)
+ {
+ msg_Dbg (p_access, "destination: %s port %d", addr, port);
+ var_SetString (p_access, "dst-addr", addr);
+ var_SetInteger (p_access, "dst-port", port);
+ }
+ }
+ shutdown( i_handle, SHUT_RD );
+
+ p_sys->i_caching = UINT64_C(1000)
+ * var_GetInteger( p_access, SOUT_CFG_PREFIX "caching");
+ p_sys->i_handle = i_handle;
+ p_sys->i_mtu = var_CreateGetInteger( p_this, "mtu" );
+ p_sys->b_mtu_warning = false;
+ p_sys->p_fifo = block_FifoNew();
+ p_sys->p_empty_blocks = block_FifoNew();
+ p_sys->p_buffer = NULL;
+
+ if( vlc_clone( &p_sys->thread, ThreadWrite, p_access,
+ VLC_THREAD_PRIORITY_HIGHEST ) )