diff --git a/include/vlc_threads.h b/include/vlc_threads.h index 86a88938a190aa0566058283ff2b3084015e7491..20e86015930a23b3234c1a9e878118a25f9c73da 100644 --- a/include/vlc_threads.h +++ b/include/vlc_threads.h @@ -656,12 +656,11 @@ VLC_API void *vlc_threadvar_get(vlc_threadvar_t); * [OUT] * @param entry entry point for the thread * @param data data parameter given to the entry point - * @param priority thread priority value * @return 0 on success, a standard error code on error. * @note In case of error, the value of *th is undefined. */ -VLC_API int vlc_clone(vlc_thread_t *th, void *(*entry)(void *), void *data, - int priority) VLC_USED; +VLC_API int vlc_clone(vlc_thread_t *th, void *(*entry)(void *), + void *data) VLC_USED; /** * Marks a thread as cancelled. diff --git a/lib/media_list_player.c b/lib/media_list_player.c index ea52c6a2342da19beb3345e88520c692ab55d43e..b849df46198eb09af5552593fbfceb94a842c09b 100644 --- a/lib/media_list_player.c +++ b/lib/media_list_player.c @@ -490,8 +490,7 @@ libvlc_media_list_player_new(libvlc_instance_t * p_instance) goto error; install_media_player_observer(p_mlp); - if (vlc_clone(&p_mlp->thread, playlist_thread, p_mlp, - VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&p_mlp->thread, playlist_thread, p_mlp)) { libvlc_media_player_release(p_mlp->p_mi); goto error; diff --git a/modules/access/alsa.c b/modules/access/alsa.c index c8a478a2ff6db16a146ac9edb725c4034f287fae..5078df503167cbcabee3a7ad5c8200658f3479cf 100644 --- a/modules/access/alsa.c +++ b/modules/access/alsa.c @@ -498,7 +498,7 @@ static int Open (vlc_object_t *obj) sys->es = es_out_Add (demux->out, &fmt); demux->p_sys = sys; - if (vlc_clone (&sys->thread, Thread, demux, VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone (&sys->thread, Thread, demux)) { es_out_Del (demux->out, sys->es); goto error; diff --git a/modules/access/cache.c b/modules/access/cache.c index 45c47e960d449a36bb498fa1639decbad51833c4..7436715b2f4ee22366d3cb84960ca558f9f5a2f1 100644 --- a/modules/access/cache.c +++ b/modules/access/cache.c @@ -108,8 +108,7 @@ vlc_access_cache_InitOnce(void *data) vlc_mutex_lock(&cache->lock); cache->running = true; - int ret = vlc_clone(&cache->thread, vlc_access_cache_Thread, cache, - VLC_THREAD_PRIORITY_LOW); + int ret = vlc_clone(&cache->thread, vlc_access_cache_Thread, cache); if (ret != 0) cache->running = false; diff --git a/modules/access/dv.c b/modules/access/dv.c index cb993427df2e39b6e404e287745bffd4c3ba31a2..6dd16c009ac810377de420d211dbe048b0875fa6 100644 --- a/modules/access/dv.c +++ b/modules/access/dv.c @@ -209,8 +209,7 @@ static int Open( vlc_object_t *p_this ) p_sys->p_ev->pp_last = &p_sys->p_ev->p_frame; p_sys->p_ev->p_access = p_access; vlc_mutex_init( &p_sys->p_ev->lock ); - if( vlc_clone( &p_sys->p_ev->thread, Raw1394EventThread, - p_sys->p_ev, VLC_THREAD_PRIORITY_OUTPUT ) ) + if( vlc_clone( &p_sys->p_ev->thread, Raw1394EventThread, p_sys->p_ev ) ) { msg_Err( p_access, "failed to clone event thread" ); Close( p_this ); diff --git a/modules/access/http/h2conn.c b/modules/access/http/h2conn.c index d7917ec6d87385ea5e0e12200200573860abde59..fcd4715088594f992c9b85709bb7ee615943632e 100644 --- a/modules/access/http/h2conn.c +++ b/modules/access/http/h2conn.c @@ -889,8 +889,7 @@ struct vlc_http_conn *vlc_h2_conn_create(void *ctx, struct vlc_tls *tls) vlc_cond_init(&conn->send_wait); if (vlc_h2_conn_queue(conn, vlc_h2_frame_settings()) - || vlc_clone(&conn->thread, vlc_h2_recv_thread, conn, - VLC_THREAD_PRIORITY_INPUT)) + || vlc_clone(&conn->thread, vlc_h2_recv_thread, conn)) { vlc_h2_output_destroy(conn->out); goto error; diff --git a/modules/access/http/h2output.c b/modules/access/http/h2output.c index 74188ef29c452b2615c0ef547921aa46deeb1fff..a4d8c24fe65261f07f65ec11de883a2b96c1ec7d 100644 --- a/modules/access/http/h2output.c +++ b/modules/access/http/h2output.c @@ -320,7 +320,7 @@ struct vlc_h2_output *vlc_h2_output_create(struct vlc_tls *tls, bool client) void *(*cb)(void *) = client ? vlc_h2_client_output_thread : vlc_h2_output_thread; - if (vlc_clone(&out->thread, cb, out, VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone(&out->thread, cb, out)) { free(out); out = NULL; diff --git a/modules/access/http/tunnel_test.c b/modules/access/http/tunnel_test.c index 223085714e8a2c39b495efc4b13ed2aba8f117bc..27ced152f459068d755f9d2d5929da22b90fc719 100644 --- a/modules/access/http/tunnel_test.c +++ b/modules/access/http/tunnel_test.c @@ -174,7 +174,7 @@ int main(void) } vlc_thread_t th; - if (vlc_clone(&th, proxy_thread, lfd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&th, proxy_thread, lfd)) assert(!"Thread error"); /* Test proxy error */ diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c index 221bd52df48054ced08d48020e7d08b33c04a1b4..c8b47cef899b3bea3e817ee8b940f6f0b3a5e457 100644 --- a/modules/access/mms/mmstu.c +++ b/modules/access/mms/mmstu.c @@ -1603,8 +1603,7 @@ static void KeepAliveStart( stream_t *p_access ) vlc_sem_init( &p_sys->keep_alive.sem, 0 ); p_sys->b_keep_alive = !vlc_clone( &p_sys->keep_alive.thread, - KeepAliveThread, p_access, - VLC_THREAD_PRIORITY_LOW ); + KeepAliveThread, p_access ); } static void KeepAliveStop( stream_t *p_access ) diff --git a/modules/access/rdp.c b/modules/access/rdp.c index b34d7008fd7fff0a3e77095515cd94118ebc3bf4..ada9bfd5bb6dcec877de1e131013cbebb127b41e 100644 --- a/modules/access/rdp.c +++ b/modules/access/rdp.c @@ -471,7 +471,7 @@ static int Open( vlc_object_t *p_this ) goto error; } - if ( vlc_clone( &p_sys->thread, DemuxThread, p_demux, VLC_THREAD_PRIORITY_INPUT ) != VLC_SUCCESS ) + if ( vlc_clone( &p_sys->thread, DemuxThread, p_demux ) != VLC_SUCCESS ) { msg_Err( p_demux, "can't spawn thread" ); freerdp_disconnect( p_sys->p_instance ); diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c index acc03ace32cd88fcc6a24a29ccc98b12b965b94a..c665c49d1726827424436bfb3f894a1cf9e1d868 100644 --- a/modules/access/rtp/rtp.c +++ b/modules/access/rtp/rtp.c @@ -440,8 +440,7 @@ static int OpenSDP(vlc_object_t *obj) if (err > 0 && module_exists("live555")) /* Bail out to live555 */ goto error; - if (vlc_clone(&sys->thread, rtp_dgram_thread, demux, - VLC_THREAD_PRIORITY_INPUT)) { + if (vlc_clone(&sys->thread, rtp_dgram_thread, demux)) { rtp_session_destroy(demux, sys->session); goto error; } @@ -611,8 +610,7 @@ static int OpenURL(vlc_object_t *obj) } #endif - if (vlc_clone (&p_sys->thread, rtp_dgram_thread, - demux, VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone (&p_sys->thread, rtp_dgram_thread, demux)) goto error; return VLC_SUCCESS; diff --git a/modules/access/satip.c b/modules/access/satip.c index ccff005527282bd767084c3f17a13c731af05b54..49eccc55d69fafaa90da477c5bf7f41af6f45bc1 100644 --- a/modules/access/satip.c +++ b/modules/access/satip.c @@ -770,7 +770,7 @@ static int satip_open(vlc_object_t *obj) vlc_queue_Init(&sys->queue, offsetof (block_t, p_next)); - if (vlc_clone(&sys->thread, satip_thread, access, VLC_THREAD_PRIORITY_INPUT)) { + if (vlc_clone(&sys->thread, satip_thread, access)) { msg_Err(access, "Failed to create worker thread."); goto error; } diff --git a/modules/access/screen/wayland.c b/modules/access/screen/wayland.c index 459017012bf286f92cd6453e307b386b27732636..0496727f30351fb4e65f9be7325c80a6bc5839cc 100644 --- a/modules/access/screen/wayland.c +++ b/modules/access/screen/wayland.c @@ -418,7 +418,7 @@ static int Open(vlc_object_t *obj) /* Initializes demux */ sys->start = vlc_tick_now(); - if (vlc_clone(&sys->thread, Thread, demux, VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone(&sys->thread, Thread, demux)) goto error; demux->pf_demux = NULL; diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c index 5336af8fed5302393daeb0543379750b29bd1f44..48c5bc0fbd4aed6384b77aa3d23b7240fca025c5 100644 --- a/modules/access/v4l2/demux.c +++ b/modules/access/v4l2/demux.c @@ -359,7 +359,7 @@ static int InitVideo (demux_t *demux, int fd, uint32_t caps) } #endif - if (vlc_clone (&sys->thread, entry, demux, VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone (&sys->thread, entry, demux)) { #ifdef ZVBI_COMPILED if (sys->vbi != NULL) diff --git a/modules/access/vnc.c b/modules/access/vnc.c index e3035690b717e60510eff225e8a15ec95d1453ef..89b72bf5ed8bdf0425983ad1504e82d259be2471 100644 --- a/modules/access/vnc.c +++ b/modules/access/vnc.c @@ -474,7 +474,7 @@ static int Open( vlc_object_t *p_this ) p_sys->i_starttime = vlc_tick_now(); vlc_sem_init( &p_sys->closing, 0 ); - if ( vlc_clone( &p_sys->thread, DemuxThread, p_demux, VLC_THREAD_PRIORITY_INPUT ) != VLC_SUCCESS ) + if ( vlc_clone( &p_sys->thread, DemuxThread, p_demux ) != VLC_SUCCESS ) { msg_Err( p_demux, "can't spawn thread" ); return VLC_EGENERIC; diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c index 137a35c7cdc52e095356ae4d1dca600f8f3caeba..9e243f8a6560ac85199992922f9bc8141eedd461 100644 --- a/modules/audio_output/audiotrack.c +++ b/modules/audio_output/audiotrack.c @@ -1568,8 +1568,7 @@ Start( audio_output_t *p_aout, audio_sample_format_t *restrict p_fmt ) /* Run AudioTrack_Thread */ p_sys->b_thread_running = true; p_sys->b_thread_paused = false; - if ( vlc_clone( &p_sys->thread, AudioTrack_Thread, p_aout, - VLC_THREAD_PRIORITY_LOW ) ) + if ( vlc_clone( &p_sys->thread, AudioTrack_Thread, p_aout ) ) { msg_Err(p_aout, "vlc clone failed"); goto error; diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c index 73ddc38bfddd46fe922a71b52a2bca76d87c1735..eb2a1611271cdc5ca96beca98b7f22325446bc78 100644 --- a/modules/audio_output/directsound.c +++ b/modules/audio_output/directsound.c @@ -778,8 +778,7 @@ static HRESULT Start( vlc_object_t *obj, aout_stream_sys_t *sys, } } - int ret = vlc_clone(&sys->eraser_thread, PlayedDataEraser, (void*) obj, - VLC_THREAD_PRIORITY_LOW); + int ret = vlc_clone(&sys->eraser_thread, PlayedDataEraser, (void*) obj); if( unlikely( ret ) ) { if( ret != ENOMEM ) diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c index cc22828c677c7eaa9fc8eb1ffc4694c6c2611d5a..be043648f3e70c6189b34471e112e211423df457 100644 --- a/modules/audio_output/mmdevice.c +++ b/modules/audio_output/mmdevice.c @@ -1299,7 +1299,7 @@ static int Open(vlc_object_t *obj) } sys->it = pv; - if (vlc_clone(&sys->thread, MMThread, aout, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, MMThread, aout)) { IMMDeviceEnumerator_Release(sys->it); LeaveMTA(); diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c index 2aa58d8506f5007b913d90715d4350da16971330..f98490e0c8a31d2e83dcdf15631e78a854a280ab 100644 --- a/modules/codec/dmo/dmo.c +++ b/modules/codec/dmo/dmo.c @@ -265,8 +265,7 @@ found: p_sys->b_ready = false; p_sys->p_input = NULL; - if( vlc_clone( &p_sys->thread, DecoderThread, p_dec, - VLC_THREAD_PRIORITY_INPUT ) ) + if( vlc_clone( &p_sys->thread, DecoderThread, p_dec ) ) goto error; vlc_mutex_lock( &p_sys->lock ); diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c index face408ced3982332468146afc1d89695923ace5..dba6b17abd90085be3376e3cd057592ddba2431f 100644 --- a/modules/codec/omxil/mediacodec.c +++ b/modules/codec/omxil/mediacodec.c @@ -1002,8 +1002,7 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init) goto bailout; } - if (vlc_clone(&p_sys->out_thread, OutThread, p_dec, - VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&p_sys->out_thread, OutThread, p_dec)) { msg_Err(p_dec, "vlc_clone failed"); vlc_mutex_unlock(&p_sys->lock); diff --git a/modules/control/cli/cli.c b/modules/control/cli/cli.c index 1a6114e9b0fb4bc74ff50779eb94bd11faddb569..b7b31d51fb2f832df27d78583bd7d1a058eae3c0 100644 --- a/modules/control/cli/cli.c +++ b/modules/control/cli/cli.c @@ -481,7 +481,7 @@ static struct cli_client *cli_client_new(intf_thread_t *intf, int fd, cl->intf = intf; vlc_mutex_init(&cl->output_lock); - if (vlc_clone(&cl->thread, cli_client_thread, cl, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&cl->thread, cli_client_thread, cl)) { free(cl); cl = NULL; @@ -954,7 +954,7 @@ static int Activate( vlc_object_t *p_this ) intf_consoleIntroMsg( p_intf ); #endif #endif - if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Run, p_intf ) ) goto error; msg_print(p_intf, "%s", diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c index 5950145102486821aadf6db3cb08e3a8f2a0b683..7cca7f5e30ac2d2a5d0c5df85eff776af3c3252f 100644 --- a/modules/control/dbus/dbus.c +++ b/modules/control/dbus/dbus.c @@ -329,7 +329,7 @@ static int Open( vlc_object_t *p_this ) p_intf, NULL ) ) goto late_failure; - if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Run, p_intf ) ) goto late_failure; return VLC_SUCCESS; diff --git a/modules/control/globalhotkeys/win32.c b/modules/control/globalhotkeys/win32.c index 926c6fc1749becacca4f8081ea13afdf2af1c1f4..57406e148c1c03d1b008413c2d62909d056a2a27 100644 --- a/modules/control/globalhotkeys/win32.c +++ b/modules/control/globalhotkeys/win32.c @@ -75,7 +75,7 @@ static int Open( vlc_object_t *p_this ) vlc_mutex_init( &p_sys->lock ); vlc_sem_init( &p_sys->wait, 0 ); - if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Thread, p_intf ) ) return VLC_ENOMEM; vlc_sem_wait( &p_sys->wait ); diff --git a/modules/control/globalhotkeys/xcb.c b/modules/control/globalhotkeys/xcb.c index d82620954eea20475ebb7c96c4657bcef2837ac7..e50afeb9583ca88a23b859a2cfba60066e0e169b 100644 --- a/modules/control/globalhotkeys/xcb.c +++ b/modules/control/globalhotkeys/xcb.c @@ -134,7 +134,7 @@ static int Open( vlc_object_t *p_this ) } Register( p_intf ); - if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Thread, p_intf ) ) { if( p_sys->p_map ) { diff --git a/modules/control/lirc.c b/modules/control/lirc.c index dc96932e641b33f2eba1c54e11be2b6fe134f090..3ff2ed95168573c33e3106619dc8ecb480dacf3b 100644 --- a/modules/control/lirc.c +++ b/modules/control/lirc.c @@ -116,7 +116,7 @@ static int Open( vlc_object_t *p_this ) goto error; } - if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Run, p_intf ) ) { lirc_freeconfig( p_sys->config ); lirc_deinit(); diff --git a/modules/control/netsync.c b/modules/control/netsync.c index fbe448102cc7573228494bda5d05a78897184064..907a8602e00b965cd2c243a70588d0420acae7a7 100644 --- a/modules/control/netsync.c +++ b/modules/control/netsync.c @@ -304,8 +304,7 @@ static int PlaylistEvent(vlc_object_t *object, char const *cmd, sys->input = input; if (input != NULL) { - if (vlc_clone(&sys->thread, sys->is_master ? Master : Slave, intf, - VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone(&sys->thread, sys->is_master ? Master : Slave, intf)) sys->input = NULL; } return VLC_SUCCESS; diff --git a/modules/control/ntservice.c b/modules/control/ntservice.c index 25bf92adb0ae338a5391028e10de510c2ac958da..bb14f2d428a05bfa7a263a40fa3d1c6c2cac64d7 100644 --- a/modules/control/ntservice.c +++ b/modules/control/ntservice.c @@ -114,7 +114,7 @@ static int Activate( vlc_object_t *p_this ) p_intf->p_sys = p_sys; - if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Run, p_intf ) ) return VLC_ENOMEM; return VLC_SUCCESS; diff --git a/modules/control/win_msg.c b/modules/control/win_msg.c index e658efaf6781de2d5c853ccec7ee5dc74ff1f704..c0f25a17aafa0749465f6f478dfbaefda933f9a8 100644 --- a/modules/control/win_msg.c +++ b/modules/control/win_msg.c @@ -178,7 +178,7 @@ static int Open(vlc_object_t *obj) /* Run the helper thread */ sys->ready = CreateEvent(NULL, FALSE, FALSE, NULL); - if (vlc_clone(&sys->thread, HelperThread, intf, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, HelperThread, intf)) { free(sys); msg_Err(intf, "one instance mode DISABLED " diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp index c792acc0ff8a4383e49e8d44023d2c617d27295d..90e7ae2e08b36b6631c6b82e0243717f110883d5 100644 --- a/modules/demux/adaptive/PlaylistManager.cpp +++ b/modules/demux/adaptive/PlaylistManager.cpp @@ -168,8 +168,7 @@ bool PlaylistManager::start() if(b_thread || b_preparsing) return false; - b_thread = !vlc_clone(&thread, managerThread, - static_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT); + b_thread = !vlc_clone(&thread, managerThread, static_cast<void *>(this)); if(!b_thread) return false; diff --git a/modules/demux/adaptive/http/Downloader.cpp b/modules/demux/adaptive/http/Downloader.cpp index 8aa76914688abf3302449d3395f67e7a7fb4889a..56bd7c05bc4e5f1803f0b38b7c28714e358f9f0e 100644 --- a/modules/demux/adaptive/http/Downloader.cpp +++ b/modules/demux/adaptive/http/Downloader.cpp @@ -40,8 +40,7 @@ Downloader::Downloader() bool Downloader::start() { if(!thread_handle_valid && - vlc_clone(&thread_handle, downloaderThread, - static_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT)) + vlc_clone(&thread_handle, downloaderThread, static_cast<void *>(this))) { return false; } diff --git a/modules/demux/mkv/events.cpp b/modules/demux/mkv/events.cpp index cd7b57f1e94a9a0ddd42ef4b864ff1d5124da981..12c0a603d4f34a7e0a031a9857b1e85f3bc8dcd7 100644 --- a/modules/demux/mkv/events.cpp +++ b/modules/demux/mkv/events.cpp @@ -76,7 +76,7 @@ void event_thread_t::SetPci(const pci_t *data) if( !is_running ) { b_abort = false; - is_running = !vlc_clone( &thread, EventThread, this, VLC_THREAD_PRIORITY_LOW ); + is_running = !vlc_clone( &thread, EventThread, this ); } } void event_thread_t::ResetPci() diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c index d0dc0bb5ba3bcdb36d73c426ef3c2a4bf237e13f..9f807aa70cb55fb94f6ea290fc88d558d024e2b6 100644 --- a/modules/gui/ncurses.c +++ b/modules/gui/ncurses.c @@ -1726,7 +1726,7 @@ static int Open(vlc_object_t *p_this) if (!sys->playlist_listener) return err; - if (vlc_clone(&sys->thread, Run, intf, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, Run, intf)) { vlc_playlist_Lock(sys->playlist); vlc_playlist_RemoveListener(sys->playlist, sys->playlist_listener); diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp index 418494788f68cd670ca2023dab4cf1f5f4fa8847..a32e235f376075ffa9f1ac37b147286cecf38811 100644 --- a/modules/gui/qt/qt.cpp +++ b/modules/gui/qt/qt.cpp @@ -511,7 +511,7 @@ static int OpenInternal( qt_intf_t *p_intf ) libvlc_SetExitHandler( vlc_object_instance(p_intf), Abort, p_intf ); Thread( (void *)p_intf ); #else - if( vlc_clone( &p_intf->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_intf->thread, Thread, p_intf ) ) { return VLC_ENOMEM; } diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp index 476e9ecdacaf53a71bfbda7bead8fc39af5bff77..8ac866ec260bfa7e39f39e3953f1e4da2eb8d6c3 100644 --- a/modules/gui/skins2/src/skin_main.cpp +++ b/modules/gui/skins2/src/skin_main.cpp @@ -95,8 +95,7 @@ static int Open( vlc_object_t *p_this ) vlc_sem_init( &p_intf->p_sys->init_wait, 0 ); p_intf->p_sys->b_error = false; - if( vlc_clone( &p_intf->p_sys->thread, Run, p_intf, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_intf->p_sys->thread, Run, p_intf ) ) { free( p_intf->p_sys ); return VLC_EGENERIC; diff --git a/modules/lua/extension_thread.c b/modules/lua/extension_thread.c index 628d0c8375b38399b64479dde6ccc42469710cf3..dadf404bca5020c5d41989aacd36433f494874f9 100644 --- a/modules/lua/extension_thread.c +++ b/modules/lua/extension_thread.c @@ -79,7 +79,7 @@ int Activate( extensions_manager_t *p_mgr, extension_t *p_ext ) p_sys->b_exiting = false; p_sys->b_thread_running = true; - if( vlc_clone( &p_sys->thread, Run, p_ext, VLC_THREAD_PRIORITY_LOW ) + if( vlc_clone( &p_sys->thread, Run, p_ext ) != VLC_SUCCESS ) { p_sys->b_exiting = true; diff --git a/modules/lua/intf.c b/modules/lua/intf.c index 688f856196ce211e44d3308c86c4dd5fc9fd3ef9..6595ba058b35c9109a4b21d13ca160199d8d0383 100644 --- a/modules/lua/intf.c +++ b/modules/lua/intf.c @@ -367,7 +367,7 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name ) p_sys->L = L; - if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Run, p_intf ) ) { vlclua_fd_cleanup( &p_sys->dtable ); lua_close( p_sys->L ); diff --git a/modules/lua/services_discovery.c b/modules/lua/services_discovery.c index 2dc3621c3b1d97b7f2b1d56d80c7c3f43ad46f65..45a73e12e72f584aabb57882d29d86c5c85dc183 100644 --- a/modules/lua/services_discovery.c +++ b/modules/lua/services_discovery.c @@ -239,7 +239,7 @@ int Open_LuaSD( vlc_object_t *p_this ) p_sys->dead = false; vlc_queue_Init( &p_sys->queue, offsetof (struct sd_query, next) ); - if( vlc_clone( &p_sys->thread, Run, p_sd, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Run, p_sd ) ) { goto error; } diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c index 07de2ed7478a4f5d0b4c633ab5d5c68a6d47480d..e541e5e3006a7fb85efddd17040f8baca527f6d4 100644 --- a/modules/misc/audioscrobbler.c +++ b/modules/misc/audioscrobbler.c @@ -409,7 +409,7 @@ static int Open(vlc_object_t *p_this) vlc_cond_init(&p_sys->wait); vlc_sem_init(&p_sys->dead, 0); - if (vlc_clone(&p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&p_sys->thread, Run, p_intf)) { retval = VLC_ENOMEM; goto fail; diff --git a/modules/misc/fingerprinter.c b/modules/misc/fingerprinter.c index dcda08f693c790a1afa671e541271fae8c14da3a..55dd69db1bdcdea649496afd658c13a0702b56e7 100644 --- a/modules/misc/fingerprinter.c +++ b/modules/misc/fingerprinter.c @@ -266,8 +266,7 @@ static int Open(vlc_object_t *p_this) p_fingerprinter->pf_apply = ApplyResult; var_Create( p_fingerprinter, "results-available", VLC_VAR_BOOL ); - if( vlc_clone( &p_sys->thread, Run, p_fingerprinter, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Run, p_fingerprinter ) ) { msg_Err( p_fingerprinter, "cannot spawn fingerprinter thread" ); goto error; diff --git a/modules/services_discovery/microdns.c b/modules/services_discovery/microdns.c index 2bb536c038b04aba5cb16ee6141a0eedab0658af..c9d3917b397622efc159a293ccd45460a5a8652b 100644 --- a/modules/services_discovery/microdns.c +++ b/modules/services_discovery/microdns.c @@ -607,8 +607,7 @@ OpenCommon( vlc_object_t *p_obj, struct discovery_sys *p_sys, bool b_renderer ) goto error; } - if( vlc_clone( &p_sys->thread, b_renderer ? RunRD : RunSD, p_obj, - VLC_THREAD_PRIORITY_LOW) ) + if( vlc_clone( &p_sys->thread, b_renderer ? RunRD : RunSD, p_obj) ) { msg_Err( p_obj, "Can't run the lookup thread" ); goto error; diff --git a/modules/services_discovery/mtp.c b/modules/services_discovery/mtp.c index b7159689743947970a7ad7d2ef8b2fd161fd2586..a392abd8e7cf4fc0c302440e68f7d4838c931c29 100644 --- a/modules/services_discovery/mtp.c +++ b/modules/services_discovery/mtp.c @@ -328,7 +328,7 @@ static int Open( vlc_object_t *p_this ) vlc_once(&mtp_init_once, vlc_libmtp_init, NULL); - if (vlc_clone (&p_sys->thread, Run, p_sd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone (&p_sys->thread, Run, p_sd)) { free (p_sys); return VLC_EGENERIC; diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c index ac3a987f187ae787e4673f8b780d1c4b1a7849df..86b7e742697445056cf7925beef110c1efe8e721 100644 --- a/modules/services_discovery/podcast.c +++ b/modules/services_discovery/podcast.c @@ -131,7 +131,7 @@ static int Open( vlc_object_t *p_this ) var_Create( pl, "podcast-request", VLC_VAR_STRING ); var_AddCallback( pl, "podcast-request", Request, p_sys ); - if (vlc_clone (&p_sys->thread, Run, p_sd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone (&p_sys->thread, Run, p_sd)) { var_DelCallback( pl, "podcast-request", Request, p_sys ); free (p_sys); diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c index 651f1a597c4bddbc84903387804041191c08b68d..e40ceb5d768e8df0577fd37a7e078fedfea688df 100644 --- a/modules/services_discovery/sap.c +++ b/modules/services_discovery/sap.c @@ -581,7 +581,7 @@ static int Open( vlc_object_t *p_this ) p_sys->i_announces = 0; p_sys->pp_announces = NULL; /* TODO: create sockets here, and fix racy sockets table */ - if (vlc_clone (&p_sys->thread, Run, p_sd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone (&p_sys->thread, Run, p_sd)) { free (p_sys); return VLC_EGENERIC; diff --git a/modules/services_discovery/udev.c b/modules/services_discovery/udev.c index 59f57724335f659d59b99dc91b42808448650568..00dff08b65205e00ce86901c7b15259b0ab945a1 100644 --- a/modules/services_discovery/udev.c +++ b/modules/services_discovery/udev.c @@ -274,7 +274,7 @@ static int Open (vlc_object_t *obj, const struct subsys *subsys) } udev_enumerate_unref (devenum); - if (vlc_clone (&p_sys->thread, Run, sd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone (&p_sys->thread, Run, sd)) { /* Fallback without thread */ udev_monitor_unref (mon); udev_unref (udev); diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp index c5824ff15e73333692bfc7970904f200f1e730a2..5f3b3ed6ac4e969aa3fa29da26641b8975d87b4b 100644 --- a/modules/services_discovery/upnp.cpp +++ b/modules/services_discovery/upnp.cpp @@ -322,8 +322,7 @@ static int OpenSD( vlc_object_t *p_this ) /* XXX: Contrary to what the libupnp doc states, UpnpSearchAsync is * blocking (select() and send() are called). Therefore, Call * UpnpSearchAsync from an other thread. */ - if ( vlc_clone( &p_sys->thread, SearchThread, p_this, - VLC_THREAD_PRIORITY_LOW ) ) + if ( vlc_clone( &p_sys->thread, SearchThread, p_this ) ) { p_sys->p_upnp->removeListener( p_sys->p_server_list ); p_sys->p_upnp->release(); @@ -1632,8 +1631,7 @@ try p_sys->p_renderer_list = std::make_shared<RD::MediaRendererList>( p_rd ); p_sys->p_upnp->addListener( p_sys->p_renderer_list ); - if( vlc_clone( &p_sys->thread, SearchThread, (void*)p_rd, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, SearchThread, (void*)p_rd ) ) { msg_Err( p_rd, "Can't run the lookup thread" ); p_sys->p_upnp->removeListener( p_sys->p_renderer_list ); diff --git a/modules/services_discovery/xcb_apps.c b/modules/services_discovery/xcb_apps.c index 57aa8a50e0abbc65097790a5e24431b257271564..9d946e0bbf53f88fb1eec3a5bba965ba1d234102 100644 --- a/modules/services_discovery/xcb_apps.c +++ b/modules/services_discovery/xcb_apps.c @@ -176,7 +176,7 @@ static int Open (vlc_object_t *obj) UpdateApps (sd); - if (vlc_clone (&p_sys->thread, Run, sd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone (&p_sys->thread, Run, sd)) goto error; return VLC_SUCCESS; @@ -310,7 +310,7 @@ static int cmpapp (const void *a, const void *b) if (wa < wb) return -1; return 0; -} +} static void UpdateApps (services_discovery_t *sd) { diff --git a/modules/stream_filter/decomp.c b/modules/stream_filter/decomp.c index 480d89b26f6b80257a5e437372911fc6e6afab91..d28a9a86cb8c50b08e486eaf5068313ec60cd500 100644 --- a/modules/stream_filter/decomp.c +++ b/modules/stream_filter/decomp.c @@ -273,8 +273,7 @@ static int Open (stream_t *stream, const char *path) if (vlc_spawnp(&p_sys->pid, path, fdv, argv) == 0) { - if (vlc_clone(&p_sys->thread, Thread, stream, - VLC_THREAD_PRIORITY_INPUT) == 0) + if (vlc_clone(&p_sys->thread, Thread, stream) == 0) ret = VLC_SUCCESS; } else diff --git a/modules/stream_filter/hds/hds.c b/modules/stream_filter/hds/hds.c index 7f44a59e55a7efab681af4764bbaa3a83401f0d6..4f2551a7e229706c0c64de5bfdd1421faa036c9c 100644 --- a/modules/stream_filter/hds/hds.c +++ b/modules/stream_filter/hds/hds.c @@ -1683,7 +1683,7 @@ static int Open( vlc_object_t *p_this ) s->pf_seek = NULL; s->pf_control = Control; - if( vlc_clone( &p_sys->dl_thread, download_thread, s, VLC_THREAD_PRIORITY_INPUT ) ) + if( vlc_clone( &p_sys->dl_thread, download_thread, s ) ) { goto error; } @@ -1691,7 +1691,7 @@ static int Open( vlc_object_t *p_this ) if( p_sys->live ) { msg_Info( p_this, "Live stream detected" ); - if( vlc_clone( &p_sys->live_thread, live_thread, s, VLC_THREAD_PRIORITY_INPUT ) ) + if( vlc_clone( &p_sys->live_thread, live_thread, s ) ) { goto error; } diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c index 195831884e216c3db7b119b07c3badda4ca60430..5a1e113a963a0d425a9c37f7070c0b235ec1dc76 100644 --- a/modules/stream_filter/prefetch.c +++ b/modules/stream_filter/prefetch.c @@ -488,7 +488,7 @@ static int Open(vlc_object_t *obj) stream->p_sys = sys; - if (vlc_clone(&sys->thread, Thread, stream, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, Thread, stream)) { vlc_interrupt_destroy(sys->interrupt); goto error; diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp index e0b3ef7a9ae5942e1dd865e3142e54b9807cc9a8..1ec187ead018478ecee002c5de50945f186bda34 100644 --- a/modules/stream_out/chromecast/chromecast_ctrl.cpp +++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp @@ -143,8 +143,7 @@ intf_sys_t::intf_sys_t(vlc_object_t * const p_this, int port, std::string device var_SetAddress( vlc_object_parent(vlc_object_parent(m_module)), CC_SHARED_VAR_NAME, &m_common ); // Start the Chromecast event thread. - if (vlc_clone(&m_chromecastThread, ChromecastThread, this, - VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&m_chromecastThread, ChromecastThread, this)) { vlc_interrupt_destroy( m_ctl_thread_interrupt ); var_SetAddress( vlc_object_parent(vlc_object_parent(m_module)), CC_SHARED_VAR_NAME, NULL ); @@ -226,7 +225,7 @@ void intf_sys_t::reinit() } m_state = Authenticating; - if( vlc_clone( &m_chromecastThread, ChromecastThread, this, VLC_THREAD_PRIORITY_LOW) ) + if( vlc_clone( &m_chromecastThread, ChromecastThread, this) ) { m_state = Dead; delete m_communication; diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c index 496c159bfddffd54c806cc0c0c756ed92b766cec..088c9c1a8f0d6b6e8a503d5ecc0d594415a7b179 100644 --- a/modules/stream_out/rtp.c +++ b/modules/stream_out/rtp.c @@ -1057,8 +1057,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt ) msg_Err( p_stream, "passive COMEDIA RTP socket failed" ); goto error; } - if( vlc_clone( &id->listen.thread, rtp_listen_thread, id, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &id->listen.thread, rtp_listen_thread, id ) ) { net_ListenClose( id->listen.fd ); id->listen.fd = NULL; @@ -1125,7 +1124,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt ) id->rtp_fmt.clock_rate, mcast_fd ); id->dead = false; - if( vlc_clone( &id->thread, ThreadSend, id, VLC_THREAD_PRIORITY_HIGHEST ) ) + if( vlc_clone( &id->thread, ThreadSend, id ) ) { id->dead = true; goto error; diff --git a/modules/stream_out/sdi/DBMSDIOutput.cpp b/modules/stream_out/sdi/DBMSDIOutput.cpp index 7619102a20cfccc2d816a56601e9e8b2a06c00ec..804d09397e692672ab57864017153f1838212f1d 100644 --- a/modules/stream_out/sdi/DBMSDIOutput.cpp +++ b/modules/stream_out/sdi/DBMSDIOutput.cpp @@ -220,7 +220,7 @@ int DBMSDIOutput::Open() decklink_iterator->Release(); - if(vlc_clone(&feeder.thread, feederThreadCallback, this, VLC_THREAD_PRIORITY_INPUT)) + if(vlc_clone(&feeder.thread, feederThreadCallback, this)) goto error; return VLC_SUCCESS; diff --git a/modules/stream_out/sdi/SDIStream.cpp b/modules/stream_out/sdi/SDIStream.cpp index fb9f39578a1d19e2b773332f5c139b6ce7e8fc2f..d81521b599b39792877c5a5fe993b7721b40e9fc 100644 --- a/modules/stream_out/sdi/SDIStream.cpp +++ b/modules/stream_out/sdi/SDIStream.cpp @@ -280,7 +280,7 @@ bool AbstractDecodedStream::init(const es_format_t *p_fmt) return false; } - if(vlc_clone(&thread, decoderThreadCallback, this, VLC_THREAD_PRIORITY_VIDEO)) + if(vlc_clone(&thread, decoderThreadCallback, this)) { es_format_Clean(&p_owner->decoder_out); es_format_Clean(&p_owner->last_fmt_update); diff --git a/modules/stream_out/transcode/encoder/encoder.h b/modules/stream_out/transcode/encoder/encoder.h index 22b1d7d1b2ca11ec4fcf29c16bf704597be05252..e8544c50f2bbecd29bb1ee6a950d3cc0b81252b8 100644 --- a/modules/stream_out/transcode/encoder/encoder.h +++ b/modules/stream_out/transcode/encoder/encoder.h @@ -42,7 +42,6 @@ typedef struct struct { unsigned int i_count; - int i_priority; uint32_t pool_size; } threads; } video; diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c index bc3ec46a30af22c70e2da42d6835e6b1acb096bc..eb0d1cb39f912426f3c25ad015e415c31d1d1096 100644 --- a/modules/stream_out/transcode/encoder/video.c +++ b/modules/stream_out/transcode/encoder/video.c @@ -468,7 +468,7 @@ int transcode_encoder_video_open( transcode_encoder_t *p_enc, if( p_cfg->video.threads.i_count > 0 ) { - if( vlc_clone( &p_enc->thread, EncoderThread, p_enc, p_cfg->video.threads.i_priority ) ) + if( vlc_clone( &p_enc->thread, EncoderThread, p_enc ) ) { module_unneed( p_enc->p_encoder, p_enc->p_encoder->p_module ); p_enc->p_encoder->p_module = NULL; diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c index 5d2b9a8e62d08d04a3adbdc5b6c9b75cdb285f52..e98c89abf211186a77d733b224340295b80fac97 100644 --- a/modules/stream_out/transcode/transcode.c +++ b/modules/stream_out/transcode/transcode.c @@ -211,7 +211,7 @@ vlc_module_begin () change_integer_range( 0, 32 ) add_integer( SOUT_CFG_PREFIX "pool-size", 10, POOL_TEXT, POOL_LONGTEXT ) change_integer_range( 1, 1000 ) - add_bool( SOUT_CFG_PREFIX "high-priority", false, HP_TEXT, HP_LONGTEXT ) + add_obsolete_bool( SOUT_CFG_PREFIX "high-priority" ) // Since 4.0.0 vlc_module_end () @@ -322,13 +322,6 @@ static void SetVideoEncoderConfig( sout_stream_t *p_stream, transcode_encoder_co p_cfg->video.threads.i_count = var_GetInteger( p_stream, SOUT_CFG_PREFIX "threads" ); p_cfg->video.threads.pool_size = var_GetInteger( p_stream, SOUT_CFG_PREFIX "pool-size" ); - -#if VLC_THREAD_PRIORITY_OUTPUT != VLC_THREAD_PRIORITY_VIDEO - if( var_GetBool( p_stream, SOUT_CFG_PREFIX "high-priority" ) ) - p_cfg->video.threads.i_priority = VLC_THREAD_PRIORITY_OUTPUT; - else -#endif - p_cfg->video.threads.i_priority = VLC_THREAD_PRIORITY_VIDEO; } static void SetSPUEncoderConfig( sout_stream_t *p_stream, transcode_encoder_config_t *p_cfg ) diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c index a67bc1da51f5d2473861e653e754768485ceeddb..a3c5d92d40a7e1da4b765c267cd3ce60dc0eb86a 100644 --- a/modules/video_output/caca.c +++ b/modules/video_output/caca.c @@ -475,8 +475,7 @@ static int Open(vout_display_t *vd, sys->dead = false; vlc_queue_Init(&sys->q, offsetof (vlc_caca_event_t, next)); - if (vlc_clone(&sys->thread, VoutDisplayEventKeyDispatch, vd, - VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, VoutDisplayEventKeyDispatch, vd)) goto error; sys->cursor_timeout = VLC_TICK_FROM_MS( var_InheritInteger(vd, "mouse-hide-timeout") ); diff --git a/modules/video_output/wayland/xdg-shell.c b/modules/video_output/wayland/xdg-shell.c index 861873519b7da55672d0f4fdabb4799634b65fba..dc062b8f9515216fb8be437e8b7bc4a7291903b7 100644 --- a/modules/video_output/wayland/xdg-shell.c +++ b/modules/video_output/wayland/xdg-shell.c @@ -717,7 +717,7 @@ static int Open(vout_window_t *wnd) wnd->display.wl = display; wnd->ops = &ops; - if (vlc_clone(&sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, Thread, wnd)) goto error; return VLC_SUCCESS; diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c index ad6effbcf3c530b48ad6a549d634e68010a16d09..7e1c95a5387e58c786c2cf3e75498287767037ec 100644 --- a/modules/video_output/win32/events.c +++ b/modules/video_output/win32/events.c @@ -181,8 +181,7 @@ int EventThreadStart( event_thread_t *p_event, event_hwnd_t *p_hwnd, const event atomic_store( &p_event->b_done, false); p_event->b_error = false; - if( vlc_clone( &p_event->thread, EventThread, p_event, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_event->thread, EventThread, p_event ) ) { msg_Err( p_event->obj, "cannot create Vout EventThread" ); return VLC_EGENERIC; diff --git a/modules/video_output/win32/inhibit.c b/modules/video_output/win32/inhibit.c index 1bb55eb62e394137f21d8474206f637df9662716..5172643dd752da83a5b0b3f4ee3f7ae1ac707d7a 100644 --- a/modules/video_output/win32/inhibit.c +++ b/modules/video_output/win32/inhibit.c @@ -94,7 +94,7 @@ static int OpenInhibit (vlc_object_t *obj) sys->exit = false; /* SetThreadExecutionState always needs to be called from the same thread */ - if (vlc_clone(&sys->thread, Run, ih, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, Run, ih)) return VLC_EGENERIC; ih->inhibit = Inhibit; diff --git a/modules/video_output/win32/window.c b/modules/video_output/win32/window.c index 866eedd64e833f64f235280168baa091e8ae5013..1196d8b780dee950fee99c1247b0f5c2111b0e2e 100644 --- a/modules/video_output/win32/window.c +++ b/modules/video_output/win32/window.c @@ -721,7 +721,7 @@ static int Open(vout_window_t *wnd) vlc_sem_init( &sys->ready, 0 ); wnd->sys = sys; - if( vlc_clone( &sys->thread, EventThread, wnd, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &sys->thread, EventThread, wnd ) ) { Close(wnd); return VLC_EGENERIC; diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c index 775dadd49de2fb839c6a82bb063d28ce99b16442..50a22f76e384b119f73de8914f67016b705b75ee 100644 --- a/modules/video_output/xcb/window.c +++ b/modules/video_output/xcb/window.c @@ -680,7 +680,7 @@ static int OpenCommon(vout_window_t *wnd, char *display, /* Create the event thread. It will dequeue all events, so any checked * request from this thread must be completed at this point. */ - if (vlc_clone(&sys->thread, Thread, wnd, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sys->thread, Thread, wnd)) { DeinitKeyboardExtension(wnd); return VLC_ENOMEM; diff --git a/modules/visualization/glspectrum.c b/modules/visualization/glspectrum.c index 71cd5d10ef3eec6946c041349fdf53a02e02c200..32ae2819f4577995a56263a13ab4071da7cb4994 100644 --- a/modules/visualization/glspectrum.c +++ b/modules/visualization/glspectrum.c @@ -222,8 +222,7 @@ static int Open(vlc_object_t * p_this) vlc_gl_ReleaseCurrent(p_sys->gl); /* Create the thread */ - if (vlc_clone(&p_sys->thread, Thread, p_filter, - VLC_THREAD_PRIORITY_VIDEO)) { + if (vlc_clone(&p_sys->thread, Thread, p_filter)) { vlc_gl_surface_Destroy(p_sys->gl); return VLC_ENOMEM; } diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c index 11a5113095d9de5329d31ca6579c331e7a13507a..dc82e28d92ea1e4fb44a14059f6dbd42337d7e9b 100644 --- a/modules/visualization/goom.c +++ b/modules/visualization/goom.c @@ -148,8 +148,7 @@ static int Open( vlc_object_t *p_this ) date_Set( &p_thread->date, VLC_TICK_0 ); p_thread->i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio ); - if( vlc_clone( &p_thread->thread, - Thread, p_thread, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_thread->thread, Thread, p_thread ) ) { msg_Err( p_filter, "cannot launch goom thread" ); vout_Close( p_thread->p_vout ); diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp index 22842e9acc44e50f55d79326e183517973ad3259..4ff9911d61d41d3f72bba08b0c7a332bef339d21 100644 --- a/modules/visualization/projectm.cpp +++ b/modules/visualization/projectm.cpp @@ -195,8 +195,7 @@ static int Open( vlc_object_t * p_this ) goto error; /* Create the thread */ - if( vlc_clone( &p_sys->thread, Thread, p_filter, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Thread, p_filter ) ) { vlc_gl_surface_Destroy( p_sys->gl ); goto error; diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c index 3ee7a6ecdd52c3e95dc11831529ca4c6b37db16d..52655549d4dd27d1725550213612e0c6fc527656 100644 --- a/modules/visualization/visual/visual.c +++ b/modules/visualization/visual/visual.c @@ -315,8 +315,7 @@ static int Open( vlc_object_t *p_this ) p_sys->dead = false; vlc_queue_Init(&p_sys->queue, offsetof (block_t, p_next)); - if( vlc_clone( &p_sys->thread, Thread, p_filter, - VLC_THREAD_PRIORITY_VIDEO ) ) + if( vlc_clone( &p_sys->thread, Thread, p_filter ) ) { vout_Close( p_sys->p_vout ); goto error; diff --git a/modules/visualization/vsxu.cpp b/modules/visualization/vsxu.cpp index a64317425fa8c4d97e21a6a1d6e1095f27eb1cd5..561549c90d92da3be6e31c4ce042b303ae483dbe 100644 --- a/modules/visualization/vsxu.cpp +++ b/modules/visualization/vsxu.cpp @@ -139,8 +139,7 @@ static int Open( vlc_object_t * p_this ) goto error; /* Create the thread */ - if( vlc_clone( &p_sys->thread, Thread, p_filter, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_sys->thread, Thread, p_filter ) ) { vlc_gl_surface_Destroy( p_sys->gl ); goto error; diff --git a/src/android/thread.c b/src/android/thread.c index 4ebba13e870f337c23b2e49d7011502b4c268f78..b73b345a20c1d65169ed85999e765f99545c1aeb 100644 --- a/src/android/thread.c +++ b/src/android/thread.c @@ -137,10 +137,8 @@ static int vlc_clone_attr (vlc_thread_t *th, void *(*entry) (void *), return ret; } -int vlc_clone (vlc_thread_t *th, void *(*entry) (void *), void *data, - int priority) +int vlc_clone (vlc_thread_t *th, void *(*entry) (void *), void *data) { - (void) priority; return vlc_clone_attr (th, entry, data); } diff --git a/src/input/decoder.c b/src/input/decoder.c index 2eafbe885c2555f5be0ef521cad68ae2a3d9e83c..27fa099aab792f32835264c9e43a1f3d43793bda 100644 --- a/src/input/decoder.c +++ b/src/input/decoder.c @@ -131,7 +131,7 @@ struct vlc_input_decoder_t /* If p_aout is valid, then p_astream is valid too */ audio_output_t *p_aout; - vlc_aout_stream *p_astream; + vlc_aout_stream *p_astream; vout_thread_t *p_vout; bool vout_started; @@ -2082,7 +2082,6 @@ static vlc_input_decoder_t * decoder_New( vlc_object_t *p_parent, const struct vlc_input_decoder_cfg *cfg ) { const char *psz_type = cfg->sout ? N_("packetizer") : N_("decoder"); - int i_priority; /* Create the decoder configuration structure */ vlc_input_decoder_t *p_owner = CreateDecoder( p_parent, cfg ); @@ -2106,13 +2105,6 @@ decoder_New( vlc_object_t *p_parent, const struct vlc_input_decoder_cfg *cfg ) assert( p_dec->fmt_in.i_cat != UNKNOWN_ES ); -#if VLC_THREAD_PRIORITY_AUDIO != VLC_THREAD_PRIORITY_VIDEO - if( p_dec->fmt_in.i_cat == AUDIO_ES ) - i_priority = VLC_THREAD_PRIORITY_AUDIO; - else -#endif - i_priority = VLC_THREAD_PRIORITY_VIDEO; - #ifdef ENABLE_SOUT /* Do not delay sout creation for SPU or DATA. */ if( cfg->sout && cfg->fmt->b_packetized && @@ -2129,7 +2121,7 @@ decoder_New( vlc_object_t *p_parent, const struct vlc_input_decoder_cfg *cfg ) #endif /* Spawn the decoder thread */ - if( vlc_clone( &p_owner->thread, DecoderThread, p_owner, i_priority ) ) + if( vlc_clone( &p_owner->thread, DecoderThread, p_owner ) ) { msg_Err( p_dec, "cannot spawn decoder thread" ); DeleteDecoder( p_owner, p_dec->fmt_in.i_cat ); diff --git a/src/input/demux_chained.c b/src/input/demux_chained.c index 0d4b1b0f65fb7e73087c7f9f2496cd25f122ece0..e33a4496fcb2a414f50770a3a0269116f55e63d0 100644 --- a/src/input/demux_chained.c +++ b/src/input/demux_chained.c @@ -119,8 +119,7 @@ vlc_demux_chained_t *vlc_demux_chained_New(vlc_object_t *parent, vlc_mutex_init(&dc->lock); - if (vlc_clone(&dc->thread, vlc_demux_chained_Thread, dc, - VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone(&dc->thread, vlc_demux_chained_Thread, dc)) { vlc_stream_Delete(dc->reader); vlc_stream_fifo_Close(dc->writer); diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c index 07fed31fcb660d76048be30be33518ec55c2a329..f6a7af19b8b19e73acda82b3fce054f027a64b78 100644 --- a/src/input/es_out_timeshift.c +++ b/src/input/es_out_timeshift.c @@ -910,7 +910,7 @@ static int TsStart( es_out_t *p_out ) p_ts->p_storage_w = NULL; p_sys->b_delayed = true; - if( vlc_clone( &p_ts->thread, TsRun, p_ts, VLC_THREAD_PRIORITY_INPUT ) ) + if( vlc_clone( &p_ts->thread, TsRun, p_ts ) ) { msg_Err( p_sys->p_input, "cannot create timeshift thread" ); diff --git a/src/input/input.c b/src/input/input.c index 402f1f749fda0101cea77fa764e0c41bf38c90c0..45a85f6c800aa4705ac4d6366902641d8f50223b 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -127,8 +127,7 @@ int input_Start( input_thread_t *p_input ) assert( !priv->is_running ); /* Create thread and wait for its readiness. */ - priv->is_running = !vlc_clone( &priv->thread, func, priv, - VLC_THREAD_PRIORITY_INPUT ); + priv->is_running = !vlc_clone( &priv->thread, func, priv ); if( !priv->is_running ) { msg_Err( p_input, "cannot create input thread" ); diff --git a/src/input/vlm.c b/src/input/vlm.c index 90534af775f310585c883cebfa8bf797971cb43d..a39b09be07f7b9810800b85811de3ff203827c5a 100644 --- a/src/input/vlm.c +++ b/src/input/vlm.c @@ -145,7 +145,7 @@ vlm_t *vlm_New( libvlc_int_t *libvlc, const char *psz_vlmconf ) TAB_INIT( p_vlm->i_schedule, p_vlm->schedule ); var_Create( p_vlm, "intf-event", VLC_VAR_ADDRESS ); - if( vlc_clone( &p_vlm->thread, Manage, p_vlm, VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_vlm->thread, Manage, p_vlm ) ) { vlc_object_delete(p_vlm); vlc_mutex_unlock( &vlm_mutex ); diff --git a/src/misc/addons.c b/src/misc/addons.c index 3f4e78bbc88b3893694a4d2184bc8f01ffc4a8f0..21a890033090c2a732fd4bd5869e61971de26c79 100644 --- a/src/misc/addons.c +++ b/src/misc/addons.c @@ -223,8 +223,8 @@ void addons_manager_Gather( addons_manager_t *p_manager, const char *psz_uri ) if( !p_manager->p_priv->finder.b_live ) { - if( vlc_clone( &p_manager->p_priv->finder.thread, FinderThread, p_manager, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_manager->p_priv->finder.thread, FinderThread, p_manager + ) ) { msg_Err( p_manager->p_priv->p_parent, "cannot spawn entries provider thread" ); @@ -537,8 +537,8 @@ static int InstallEntry( addons_manager_t *p_manager, addon_entry_t *p_entry ) ARRAY_APPEND( p_manager->p_priv->installer.entries, p_entry ); if( !p_manager->p_priv->installer.b_live ) { - if( vlc_clone( &p_manager->p_priv->installer.thread, InstallerThread, p_manager, - VLC_THREAD_PRIORITY_LOW ) ) + if( vlc_clone( &p_manager->p_priv->installer.thread, InstallerThread, p_manager + ) ) { msg_Err( p_manager->p_priv->p_parent, "cannot spawn addons installer thread" ); diff --git a/src/misc/executor.c b/src/misc/executor.c index 3b79f9ba8d369b8d2333918d5b678021547ec805..96c7d0c430fa092c114fbc0b94ab96040050e6e5 100644 --- a/src/misc/executor.c +++ b/src/misc/executor.c @@ -157,7 +157,7 @@ SpawnThread(vlc_executor_t *executor) thread->owner = executor; thread->current_task = NULL; - if (vlc_clone(&thread->thread, ThreadRun, thread, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&thread->thread, ThreadRun, thread)) { free(thread); return VLC_EGENERIC; diff --git a/src/misc/update.c b/src/misc/update.c index 0231ea74de079860d981c916685befbc0425f3ab..0ebd026e4303103859cefc615ea53db77db10e47 100644 --- a/src/misc/update.c +++ b/src/misc/update.c @@ -407,7 +407,7 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void p_uct->pf_callback = pf_callback; p_uct->p_data = p_data; - vlc_clone( &p_uct->thread, update_CheckReal, p_uct, VLC_THREAD_PRIORITY_LOW ); + vlc_clone( &p_uct->thread, update_CheckReal, p_uct ); } void* update_CheckReal( void *obj ) @@ -519,7 +519,7 @@ void update_Download( update_t *p_update, const char *psz_destdir ) p_udt->psz_destdir = psz_destdir ? strdup( psz_destdir ) : NULL; atomic_store(&p_udt->aborted, false); - vlc_clone( &p_udt->thread, update_DownloadReal, p_udt, VLC_THREAD_PRIORITY_LOW ); + vlc_clone( &p_udt->thread, update_DownloadReal, p_udt ); } static void* update_DownloadReal( void *obj ) diff --git a/src/network/httpd.c b/src/network/httpd.c index 003010560fffd711d8fc15ca40da1e82fc7a92de..f5d13d4ede940235de375c98e4f99906b63f6b11 100644 --- a/src/network/httpd.c +++ b/src/network/httpd.c @@ -982,8 +982,7 @@ static httpd_host_t *httpd_HostCreate(vlc_object_t *p_this, host->p_tls = p_tls; /* create the thread */ - if (vlc_clone(&host->thread, httpd_HostThread, host, - VLC_THREAD_PRIORITY_LOW)) { + if (vlc_clone(&host->thread, httpd_HostThread, host)) { msg_Err(p_this, "cannot spawn http host thread"); goto error; } diff --git a/src/os2/thread.c b/src/os2/thread.c index 7fd4e9556a867cff1fff159fb3eac7818d8acb9e..02825f81c7a9fca28740a298f518b5005e690957 100644 --- a/src/os2/thread.c +++ b/src/os2/thread.c @@ -445,7 +445,7 @@ static void vlc_entry( void *p ) } int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *), - void *data, int priority) + void *data) { struct vlc_thread *th = malloc (sizeof (*th)); if (unlikely(th == NULL)) @@ -472,16 +472,6 @@ int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *), if (p_handle != NULL) *p_handle = th; - if (priority) - { - LONG delta = PRTYD_MAXIMUM; - - if (priority != VLC_THREAD_PRIORITY_HIGHEST) - delta >>= 1; - - DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, delta, th->tid ); - } - return 0; error: diff --git a/src/player/player.c b/src/player/player.c index ded6e3f0591da6c34af143fe445366b54b5bb754..17d8a9022cd450b18330957ac0ce3fdf57bf589c 100644 --- a/src/player/player.c +++ b/src/player/player.c @@ -2018,7 +2018,7 @@ vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type, vlc_player_InitTimer(player); if (vlc_clone(&player->destructor.thread, vlc_player_destructor_Thread, - player, VLC_THREAD_PRIORITY_LOW) != 0) + player) != 0) { vlc_player_DestroyTimer(player); goto error; diff --git a/src/posix/getaddrinfo.c b/src/posix/getaddrinfo.c index c7f9bf07b57d73dea429d73215e972ba28331f25..2c930fa0bfc8bbdf016e3e3d8462db42835d07ef 100644 --- a/src/posix/getaddrinfo.c +++ b/src/posix/getaddrinfo.c @@ -75,7 +75,7 @@ int vlc_getaddrinfo_i11e(const char *name, unsigned port, vlc_sem_init(&req.done, 0); - if (vlc_clone(&th, vlc_gai_thread, &req, VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&th, vlc_gai_thread, &req)) return EAI_SYSTEM; vlc_sem_wait_i11e(&req.done); diff --git a/src/posix/thread.c b/src/posix/thread.c index 78045d9746e48d9e759fd360d95772767ac272dd..49e786d309de1e3a20727bf2e561fca985dab3d4 100644 --- a/src/posix/thread.c +++ b/src/posix/thread.c @@ -130,7 +130,7 @@ void vlc_threads_setup (libvlc_int_t *p_libvlc) } static int vlc_clone_attr (vlc_thread_t *th, pthread_attr_t *attr, - void *(*entry) (void *), void *data, int priority) + void *(*entry) (void *), void *data) { int ret; @@ -179,17 +179,15 @@ static int vlc_clone_attr (vlc_thread_t *th, pthread_attr_t *attr, ret = pthread_create(&th->handle, attr, entry, data); pthread_sigmask (SIG_SETMASK, &oldset, NULL); pthread_attr_destroy (attr); - (void) priority; return ret; } -int vlc_clone (vlc_thread_t *th, void *(*entry) (void *), void *data, - int priority) +int vlc_clone (vlc_thread_t *th, void *(*entry) (void *), void *data) { pthread_attr_t attr; pthread_attr_init (&attr); - return vlc_clone_attr (th, &attr, entry, data, priority); + return vlc_clone_attr (th, &attr, entry, data); } void vlc_join(vlc_thread_t th, void **result) diff --git a/src/posix/timer.c b/src/posix/timer.c index d88df7d501bcd934671400c59e45b492ee52a9d5..42805323808836ef1ca94f844d68eb38b817a675 100644 --- a/src/posix/timer.c +++ b/src/posix/timer.c @@ -118,8 +118,7 @@ int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data) timer->live = true; atomic_init(&timer->overruns, 0); - if (vlc_clone (&timer->thread, vlc_timer_thread, timer, - VLC_THREAD_PRIORITY_INPUT)) + if (vlc_clone (&timer->thread, vlc_timer_thread, timer)) { free (timer); return ENOMEM; diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c index c58750fcc55a9f0ab94383bd0f7e629d483d0741..595723e1b1d302759c5d4b01a3cc0ceda9f32617 100644 --- a/src/stream_output/sap.c +++ b/src/stream_output/sap.c @@ -334,8 +334,7 @@ matched: if (sap_addr->session_count++ == 0) { - if (vlc_clone(&sap_addr->thread, RunThread, sap_addr, - VLC_THREAD_PRIORITY_LOW)) + if (vlc_clone(&sap_addr->thread, RunThread, sap_addr)) { msg_Err(obj, "unable to spawn SAP announce thread"); AddressDestroy(sap_addr); diff --git a/src/test/interrupt.c b/src/test/interrupt.c index 808335575b1c30afa57fab88d725a0f6bde1b689..05f5e88a48bf1a00fd5f3f9bf828adab985863a3 100644 --- a/src/test/interrupt.c +++ b/src/test/interrupt.c @@ -177,16 +177,16 @@ int main (void) test_context_simple(ctx); - assert(!vlc_clone(&th, test_thread_simple, ctx, VLC_THREAD_PRIORITY_LOW)); + assert(!vlc_clone(&th, test_thread_simple, ctx)); vlc_interrupt_raise(ctx); vlc_sem_post(&sem); vlc_sem_post(&sem); vlc_join(th, NULL); - assert(!vlc_clone(&th, test_thread_cleanup, ctx, VLC_THREAD_PRIORITY_LOW)); + assert(!vlc_clone(&th, test_thread_cleanup, ctx)); vlc_join(th, NULL); - assert(!vlc_clone(&th, test_thread_cancel, ctx, VLC_THREAD_PRIORITY_LOW)); + assert(!vlc_clone(&th, test_thread_cancel, ctx)); vlc_cancel(th); vlc_join(th, NULL); diff --git a/src/test/thread.c b/src/test/thread.c index a8eaeed9ce431dee8976df77c58d4ed7c4873b2c..2616fb4a47655331287738c9f585f8db1db0b868 100644 --- a/src/test/thread.c +++ b/src/test/thread.c @@ -54,7 +54,7 @@ static int thread_return_magic = 0x4321; // Spawn thread #define TEST_THREAD_CLONE(th, f, data) \ - assert(vlc_clone(th, f, data, VLC_THREAD_PRIORITY_LOW) == 0) + assert(vlc_clone(th, f, data) == 0) // Spawn thread with magic data #define TEST_THREAD_CLONE_MAGIC(th, f) \ diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index 7b03fca6414022589454877ded868285a849f487..a2eb1618f9f5ea997d512ebda1adabe38c9a17e3 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -2116,7 +2116,7 @@ int vout_Request(const vout_configuration_t *cfg, vlc_video_context *vctx, input return -1; } atomic_store(&sys->control_is_terminated, false); - if (vlc_clone(&sys->thread, Thread, vout, VLC_THREAD_PRIORITY_OUTPUT)) { + if (vlc_clone(&sys->thread, Thread, vout)) { vout_ReleaseDisplay(vout); vout_DisableWindow(vout); return -1; diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c index ea03a16d57eeb352534850acc721ef62c29c1b76..73c2cca04b3039a27846ce2f77631392a3c616ba 100644 --- a/src/video_output/vout_subpictures.c +++ b/src/video_output/vout_subpictures.c @@ -1708,7 +1708,7 @@ spu_t *spu_Create(vlc_object_t *object, vout_thread_t *vout) sys->last_sort_date = -1; sys->vout = vout; - if(vlc_clone(&sys->prerender.thread, spu_PrerenderThread, spu, VLC_THREAD_PRIORITY_VIDEO)) + if(vlc_clone(&sys->prerender.thread, spu_PrerenderThread, spu)) { spu_Cleanup(spu); vlc_object_delete(spu); diff --git a/src/win32/mta_holder.h b/src/win32/mta_holder.h index 8a6f38344045774b11ec1e0015067c4620df9c25..1d13e7c7f6487cce11f50662ff8ddf589718ad7e 100644 --- a/src/win32/mta_holder.h +++ b/src/win32/mta_holder.h @@ -76,7 +76,7 @@ static inline bool vlc_mta_acquire( vlc_object_t *p_parent ) vlc_sem_init( &p_mta->ready_sem, 0 ); vlc_sem_init( &p_mta->release_sem, 0 ); p_mta->i_refcount = 1; - if ( vlc_clone( &p_mta->thread, MtaMainLoop, p_mta, VLC_THREAD_PRIORITY_LOW ) ) + if ( vlc_clone( &p_mta->thread, MtaMainLoop, p_mta ) ) { free( p_mta ); p_mta = NULL; diff --git a/src/win32/thread.c b/src/win32/thread.c index 925cdee15b377d21b186f01684afa13cb054c1e6..d3431a7d1fe4cf3a3ac2b1d279a72bbcada4f969 100644 --- a/src/win32/thread.c +++ b/src/win32/thread.c @@ -347,7 +347,7 @@ __stdcall vlc_entry (void *p) } int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *), - void *data, int priority) + void *data) { struct vlc_thread *th = malloc (sizeof (*th)); if (unlikely(th == NULL)) @@ -380,9 +380,6 @@ int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *), if (p_handle != NULL) *p_handle = th; - if (priority) - SetThreadPriority (th->id, priority); - return 0; } diff --git a/test/modules/misc/tls.c b/test/modules/misc/tls.c index 8005c5dc86a5feb1964be174cafea8b8eaf19a69..efbd171086b0a8c46fa2c334f21af68bbae02c4f 100644 --- a/test/modules/misc/tls.c +++ b/test/modules/misc/tls.c @@ -97,7 +97,7 @@ static vlc_tls_t *securepair(vlc_thread_t *th, server = vlc_tls_ServerSessionCreate(server_creds, socks[0], salpnv); assert(server != NULL); - val = vlc_clone(th, tls_echo, server, VLC_THREAD_PRIORITY_LOW); + val = vlc_clone(th, tls_echo, server); assert(val == 0); client = vlc_tls_ClientSessionCreate(client_creds, socks[1],