Changeset 25768ec58d736505992cc19a25d09c4897b544af

Show
Ignore:
Timestamp:
24/07/08 23:44:36 (4 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1216935876 +0200
git-parent:

[054067808a7d91f465c521395ea602803a9095dc]

git-author:
Laurent Aimar <fenrir@videolan.org> 1216935685 +0200
Message:

Fixed dvd menu highlight (close #1709)
Properly lock spu variable inside UpdateSPU.

No, locking is NOT something you can just igore !

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/video_output/vout_subpictures.c

    r4f793a1 r25768ec  
    658658                             const video_format_t *p_fmt ) 
    659659{ 
    660     video_format_t orig_fmt
     660    video_format_t fmt_original
    661661    bool b_rerender_text; 
    662662    int i_fade_alpha; 
     
    667667    int i_inv_scale_y; 
    668668 
    669     orig_fmt = p_region->fmt; 
     669    vlc_assert_locked( &p_spu->subpicture_lock ); 
     670 
     671    fmt_original = p_region->fmt; 
    670672    b_rerender_text = false; 
    671673    if( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') ) 
     
    708710    if( p_spu->p_scale && 
    709711        ( ( pi_scale_width[i_scale_idx]  > 0 && pi_scale_width[i_scale_idx]  != 1000 ) || 
    710           ( pi_scale_height[i_scale_idx] > 0 && pi_scale_height[i_scale_idx] != 1000 ) ) ) 
     712          ( pi_scale_height[i_scale_idx] > 0 && pi_scale_height[i_scale_idx] != 1000 ) || 
     713          p_spu->b_force_palette ) ) 
    711714    { 
    712715        const int i_dst_width  = p_region->fmt.i_width  * pi_scale_width[i_scale_idx] / 1000; 
     
    717720        { 
    718721            if( p_region->p_cache->fmt.i_width  != i_dst_width || 
    719                 p_region->p_cache->fmt.i_height != i_dst_height ) 
     722                p_region->p_cache->fmt.i_height != i_dst_height || 
     723                p_spu->b_force_palette ) 
    720724            { 
    721725                p_subpic->pf_destroy_region( VLC_OBJECT(p_spu), 
     
    770774        /* And use the scaled picture */ 
    771775        if( p_region->p_cache ) 
     776        { 
    772777            p_region = p_region->p_cache; 
     778            fmt_original = p_region->fmt; 
     779        } 
    773780    } 
    774781 
     
    908915        p_region->picture.pf_release( &p_region->picture ); 
    909916        memset( &p_region->picture, 0, sizeof( picture_t ) ); 
    910         p_region->fmt = orig_fmt
     917        p_region->fmt = fmt_original
    911918        p_region->i_align &= ~SUBPICTURE_RENDERED; 
    912919    } 
     920    else if( p_spu->b_force_crop ) 
     921    { 
     922        p_region->fmt = fmt_original; 
     923    } 
     924 
    913925} 
    914926 
     
    13231335    vlc_value_t val; 
    13241336 
     1337    vlc_mutex_lock( &p_spu->subpicture_lock ); 
     1338 
    13251339    p_spu->b_force_palette = false; 
    13261340    p_spu->b_force_crop = false; 
    13271341 
    1328     if( var_Get( p_object, "highlight", &val ) || !val.b_bool ) return; 
     1342    if( var_Get( p_object, "highlight", &val ) || !val.b_bool ) 
     1343    { 
     1344        vlc_mutex_unlock( &p_spu->subpicture_lock ); 
     1345        return; 
     1346    } 
    13291347 
    13301348    p_spu->b_force_crop = true; 
     
    13431361        p_spu->b_force_palette = true; 
    13441362    } 
     1363    vlc_mutex_unlock( &p_spu->subpicture_lock ); 
    13451364 
    13461365    msg_Dbg( p_object, "crop: %i,%i,%i,%i, palette forced: %i",