Changeset 25768ec58d736505992cc19a25d09c4897b544af
- 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
| r4f793a1 |
r25768ec |
|
| 658 | 658 | const video_format_t *p_fmt ) |
|---|
| 659 | 659 | { |
|---|
| 660 | | video_format_t orig_fmt; |
|---|
| | 660 | video_format_t fmt_original; |
|---|
| 661 | 661 | bool b_rerender_text; |
|---|
| 662 | 662 | int i_fade_alpha; |
|---|
| … | … | |
| 667 | 667 | int i_inv_scale_y; |
|---|
| 668 | 668 | |
|---|
| 669 | | orig_fmt = p_region->fmt; |
|---|
| | 669 | vlc_assert_locked( &p_spu->subpicture_lock ); |
|---|
| | 670 | |
|---|
| | 671 | fmt_original = p_region->fmt; |
|---|
| 670 | 672 | b_rerender_text = false; |
|---|
| 671 | 673 | if( p_region->fmt.i_chroma == VLC_FOURCC('T','E','X','T') ) |
|---|
| … | … | |
| 708 | 710 | if( p_spu->p_scale && |
|---|
| 709 | 711 | ( ( 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 ) ) |
|---|
| 711 | 714 | { |
|---|
| 712 | 715 | const int i_dst_width = p_region->fmt.i_width * pi_scale_width[i_scale_idx] / 1000; |
|---|
| … | … | |
| 717 | 720 | { |
|---|
| 718 | 721 | 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 ) |
|---|
| 720 | 724 | { |
|---|
| 721 | 725 | p_subpic->pf_destroy_region( VLC_OBJECT(p_spu), |
|---|
| … | … | |
| 770 | 774 | /* And use the scaled picture */ |
|---|
| 771 | 775 | if( p_region->p_cache ) |
|---|
| | 776 | { |
|---|
| 772 | 777 | p_region = p_region->p_cache; |
|---|
| | 778 | fmt_original = p_region->fmt; |
|---|
| | 779 | } |
|---|
| 773 | 780 | } |
|---|
| 774 | 781 | |
|---|
| … | … | |
| 908 | 915 | p_region->picture.pf_release( &p_region->picture ); |
|---|
| 909 | 916 | memset( &p_region->picture, 0, sizeof( picture_t ) ); |
|---|
| 910 | | p_region->fmt = orig_fmt; |
|---|
| | 917 | p_region->fmt = fmt_original; |
|---|
| 911 | 918 | p_region->i_align &= ~SUBPICTURE_RENDERED; |
|---|
| 912 | 919 | } |
|---|
| | 920 | else if( p_spu->b_force_crop ) |
|---|
| | 921 | { |
|---|
| | 922 | p_region->fmt = fmt_original; |
|---|
| | 923 | } |
|---|
| | 924 | |
|---|
| 913 | 925 | } |
|---|
| 914 | 926 | |
|---|
| … | … | |
| 1323 | 1335 | vlc_value_t val; |
|---|
| 1324 | 1336 | |
|---|
| | 1337 | vlc_mutex_lock( &p_spu->subpicture_lock ); |
|---|
| | 1338 | |
|---|
| 1325 | 1339 | p_spu->b_force_palette = false; |
|---|
| 1326 | 1340 | p_spu->b_force_crop = false; |
|---|
| 1327 | 1341 | |
|---|
| 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 | } |
|---|
| 1329 | 1347 | |
|---|
| 1330 | 1348 | p_spu->b_force_crop = true; |
|---|
| … | … | |
| 1343 | 1361 | p_spu->b_force_palette = true; |
|---|
| 1344 | 1362 | } |
|---|
| | 1363 | vlc_mutex_unlock( &p_spu->subpicture_lock ); |
|---|
| 1345 | 1364 | |
|---|
| 1346 | 1365 | msg_Dbg( p_object, "crop: %i,%i,%i,%i, palette forced: %i", |
|---|