comparison spudec.c @ 31595:1026cf3f3e7b

Reuse spudec_visible to avoid code duplication.
author reimar
date Sat, 10 Jul 2010 11:22:42 +0000
parents 8f8d3775d564
children 1eb8dc8f96fa
comparison
equal deleted inserted replaced
31594:8f8d3775d564 31595:1026cf3f3e7b
654 } 654 }
655 655
656 void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) 656 void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride))
657 { 657 {
658 spudec_handle_t *spu = (spudec_handle_t *)this; 658 spudec_handle_t *spu = (spudec_handle_t *)this;
659 if (spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts && spu->image) 659 if (spudec_visible(spu))
660 { 660 {
661 draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height, 661 draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height,
662 spu->image, spu->aimage, spu->stride); 662 spu->image, spu->aimage, spu->stride);
663 spu->spu_changed = 0; 663 spu->spu_changed = 0;
664 } 664 }
805 { 805 {
806 spudec_handle_t *spu = (spudec_handle_t *)me; 806 spudec_handle_t *spu = (spudec_handle_t *)me;
807 scale_pixel *table_x; 807 scale_pixel *table_x;
808 scale_pixel *table_y; 808 scale_pixel *table_y;
809 809
810 if (spu->start_pts <= spu->now_pts && spu->now_pts < spu->end_pts) { 810 if (spudec_visible(spu)) {
811 811
812 // check if only forced subtitles are requested 812 // check if only forced subtitles are requested
813 if( (spu->forced_subs_only) && !(spu->is_forced_sub) ){ 813 if( (spu->forced_subs_only) && !(spu->is_forced_sub) ){
814 return; 814 return;
815 } 815 }