Commit 4dd2f5c6 authored by Thomas Guillem's avatar Thomas Guillem

input: set the thread priority from the thread callback

input_Read() doesn't create any threads and run the Init() function that could
change the priority of an uninitialized thread.

This could happen when running ./vlc --sout from Windows.
parent 4757ae1a
......@@ -479,6 +479,13 @@ static void *Run( void *obj )
if( !Init( p_input ) )
{
if( p_input->p->b_can_pace_control && p_input->p->b_out_pace_control )
{
/* We don't want a high input priority here or we'll
* end-up sucking up all the CPU time */
vlc_set_priority( p_input->p->thread, VLC_THREAD_PRIORITY_LOW );
}
MainLoop( p_input, true ); /* FIXME it can be wrong (like with VLM) */
/* Clean up */
......@@ -1202,13 +1209,6 @@ static int Init( input_thread_t * p_input )
{
p_input->p->b_out_pace_control = (p_input->p->p_sout->i_out_pace_nocontrol > 0);
if( p_input->p->b_can_pace_control && p_input->p->b_out_pace_control )
{
/* We don't want a high input priority here or we'll
* end-up sucking up all the CPU time */
vlc_set_priority( p_input->p->thread, VLC_THREAD_PRIORITY_LOW );
}
msg_Dbg( p_input, "starting in %s mode",
p_input->p->b_out_pace_control ? "async" : "sync" );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment