]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/remoteosd.c
Clean up a bit subpicture region API.
[vlc] / modules / video_filter / remoteosd.c
index 6e4a5be941cf63a4d66185cf2636fe165bfa5575..95e71c2fa7182c6dcb0f2932700b804a9204a102 100644 (file)
@@ -282,7 +282,7 @@ static int CreateFilter ( vlc_object_t *p_this )
 
     p_sys->i_alpha = var_CreateGetIntegerCommand( p_this, RMTOSD_CFG "alpha" );
 
-    /* in miliseconds, 0 disables polling, should not be lower than 100 */
+    /* in milliseconds, 0 disables polling, should not be lower than 100 */
     p_sys->i_vnc_poll_interval  = var_CreateGetIntegerCommand( p_this,
                                                        RMTOSD_CFG "update" );
     if ( p_sys->i_vnc_poll_interval < 100)
@@ -677,6 +677,7 @@ static void* vnc_worker_thread( vlc_object_t *p_thread_obj )
     filter_t* p_filter = (filter_t*)(p_thread_obj->p_parent);
     filter_sys_t *p_sys = p_filter->p_sys;
     vlc_object_t *p_update_request_thread;
+    int canc = vlc_savecancel ();
 
     msg_Dbg( p_filter, "VNC worker thread started" );
 
@@ -799,6 +800,7 @@ exit:
     vlc_mutex_unlock( &p_sys->lock );
 
     msg_Dbg( p_filter, "VNC message reader thread ended" );
+    vlc_restorecancel (canc);
     return NULL;
 }
 
@@ -806,6 +808,7 @@ static void* update_request_thread( vlc_object_t *p_thread_obj )
 {
     filter_t* p_filter = (filter_t*)(p_thread_obj->p_parent);
     filter_sys_t *p_sys = p_filter->p_sys;
+    int canc = vlc_savecancel ();
 
     msg_Dbg( p_filter, "VNC update request thread started" );
 
@@ -848,6 +851,7 @@ static void* update_request_thread( vlc_object_t *p_thread_obj )
     }
 
     msg_Dbg( p_filter, "VNC update request thread ended" );
+    vlc_restorecancel (canc);
     return NULL;
 }
 
@@ -1158,7 +1162,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
     fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
     fmt.i_height = fmt.i_visible_height = p_pic->p[Y_PLANE].i_visible_lines;
     fmt.i_x_offset = fmt.i_y_offset = 0;
-    p_region = p_spu->pf_create_region( VLC_OBJECT(p_filter), &fmt );
+    p_region = subpicture_region_New( &fmt );
     if( !p_region )
     {
         msg_Err( p_filter, "cannot allocate SPU region" );
@@ -1167,7 +1171,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         return NULL;
     }
 
-    vout_CopyPicture( p_filter, &p_region->picture, p_pic );
+    /* FIXME the copy is probably not needed anymore */
+    picture_Copy( p_region->p_picture, p_pic );
 
     p_sys->b_need_update = false;
 
@@ -1178,8 +1183,6 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
     p_spu->b_absolute = false;
 
 
-    p_spu->i_x = 0;
-    p_spu->i_y = 0;
     p_spu->i_original_picture_width = 0; /*Let vout core do the horizontal scaling */
     p_spu->i_original_picture_height = fmt.i_height;