Ticket #7775: various-caption-fixes.patch

File various-caption-fixes.patch, 2.6 KB (added by Clayton Smith <argilo@…>, 2 years ago)

Various fixes to EIA-708 closed caption code

  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    77267726        if ((1<<i) & window_map) 
    77277727            GetCCWin(service_num, i).visible = true; 
    77287728    } 
     7729 
     7730    if (GetOSD()) 
     7731        GetOSD()->CC708Updated(); 
    77297732} 
    77307733 
    77317734void NuppelVideoPlayer::HideWindows(uint service_num, int window_map) 
  • libs/libmythtv/osdtypes.cpp

     
    27282728                        const CC708Window &win, 
    27292729                        const vector<CC708String*> &list) 
    27302730{ 
     2731    if (!win.visible) return; 
     2732 
    27312733    int maxx = surface->width; 
    27322734    int maxy = surface->height; 
    27332735    uint max_width = 0, total_height = 0, i = 0; 
  • libs/libmythtv/cc708window.cpp

     
    155155    true_row_count    = (row_lock) ? row_count : max(row_count + 1, (uint)2); 
    156156    true_column_count = column_count; 
    157157 
    158     if (text && (!exists || (old_row != true_row_count) || 
     158    if (text && exists && (old_col == true_column_count) 
     159                       && (old_row < true_row_count)) 
     160    { 
     161        // We need to add more rows to an existing window 
     162        uint num = true_row_count * true_column_count; 
     163        CC708Character *new_text = new CC708Character[num]; 
     164        pen.column = 0; 
     165        pen.row = 0; 
     166        for (uint i = 0; i < old_row * old_col; i++) 
     167            new_text[i] = text[i]; 
     168        for (uint i = old_row * old_col; i < num; i++) 
     169            new_text[i].attr = pen.attr; 
     170        delete [] text; 
     171        text = new_text; 
     172    } 
     173    else if (text && (!exists || (old_row != true_row_count) || 
    159174                 (old_col != true_column_count))) 
    160175    { 
    161176        delete [] text; 
     
    367382    if (k708DirLeftToRight == print_dir || k708DirRightToLeft == print_dir) 
    368383    { 
    369384        // basic wrapping for l->r, r->l languages 
    370         if (new_column >= (int)true_column_count) 
     385        if (!row_lock && column_lock && (new_column >= (int)true_column_count)) 
    371386        { 
    372387            new_column  = 0; 
    373388            new_row    += 1; 
    374389        } 
    375         else if (new_column < 0) 
     390        else if (!row_lock && column_lock && (new_column < 0)) 
    376391        { 
    377392            new_column  = (int)true_column_count - 1; 
    378393            new_row    -= 1;