@@ -363,7 +363,7 @@ static bool video_thread_handle_packet(
363363 /* Never reply on no command. Possible deadlock if
364364 * thread sends command right after frame update. */
365365 break ;
366-
366+
367367 case CMD_POKE_SET_HDR_MAX_NITS :
368368 if (thr -> driver_data && thr -> poke && thr -> poke -> set_hdr_max_nits )
369369 thr -> poke -> set_hdr_max_nits (
@@ -372,7 +372,7 @@ static bool video_thread_handle_packet(
372372 );
373373 video_thread_reply (thr , & pkt );
374374 break ;
375-
375+
376376 case CMD_POKE_SET_HDR_PAPER_WHITE_NITS :
377377 if (thr -> driver_data &&
378378 thr -> poke && thr -> poke -> set_hdr_paper_white_nits )
@@ -382,7 +382,7 @@ static bool video_thread_handle_packet(
382382 );
383383 video_thread_reply (thr , & pkt );
384384 break ;
385-
385+
386386 case CMD_POKE_SET_HDR_CONTRAST :
387387 if (thr -> driver_data && thr -> poke && thr -> poke -> set_hdr_contrast )
388388 thr -> poke -> set_hdr_contrast (
@@ -391,7 +391,7 @@ static bool video_thread_handle_packet(
391391 );
392392 video_thread_reply (thr , & pkt );
393393 break ;
394-
394+
395395 case CMD_POKE_SET_HDR_EXPAND_GAMUT :
396396 if (thr -> driver_data && thr -> poke && thr -> poke -> set_hdr_expand_gamut )
397397 thr -> poke -> set_hdr_expand_gamut (
@@ -457,7 +457,7 @@ static void video_thread_loop(void *data)
457457 video_frame_info_t video_info ;
458458 bool ret ;
459459
460- /* TODO/FIXME - not thread-safe - should get
460+ /* TODO/FIXME - not thread-safe - should get
461461 * rid of this */
462462 video_driver_build_info (& video_info );
463463
@@ -508,7 +508,7 @@ static bool video_thread_alive(void *data)
508508
509509 if (!thr )
510510 return false;
511-
511+
512512 runloop_flags = runloop_get_flags ();
513513
514514 if (runloop_flags & RUNLOOP_FLAG_PAUSED )
@@ -1434,7 +1434,7 @@ unsigned video_thread_texture_handle(void *data, custom_command_method_t func)
14341434
14351435 /* if we're already on the video thread, just call the function, otherwise
14361436 * we may deadlock with ourself waiting for the packet to be processed. */
1437- if (sthread_get_thread_id (thr -> thread ) == sthread_get_current_thread_id ())
1437+ if (sthread_get_thread_id (thr -> thread ) == sthread_get_current_thread_id () || ! thr -> alive )
14381438 return func (data );
14391439
14401440 pkt .type = CMD_CUSTOM_COMMAND ;
0 commit comments