Ticket #466: mplayer.cc.patch

File mplayer.cc.patch, 9.8 KB (added by dswarin+mplayer@…, 20 years ago)

TiVo closed captions with -subcc

  • cfg-common.h

    old new  
    253253        // specify IFO file for VOBSUB subtitle
    254254        {"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL},
    255255        // enable Closed Captioning display
    256         {"subcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL},
    257         {"nosubcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL},
     256        {"subcc", &subcc_enabled, CONF_TYPE_INT, 0, 0, 1, NULL},
    258257        {"overlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 2, NULL},
    259258        {"nooverlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 0, NULL},
    260259        {"sub-bg-color", &sub_bg_color, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL},
  • libmpdemux/demux_ty.c

    old new  
    103103} TiVoInfo;
    104104
    105105off_t vstream_streamsize( );
    106 void ty_ClearOSD( int start );
     106void ty_ClearOSD( int start, int osd );
    107107
    108108// DTiVo MPEG 336, 480, 576, 768
    109109// SA TiVo 864
     
    10081008   }
    10091009        if ( subcc_enabled )
    10101010        {
    1011            ty_ClearOSD( 0 );
     1011           ty_ClearOSD( 0, 0 );
    10121012        }
    10131013}
    10141014
  • libmpdemux/demux_ty_osd.c

    old new  
    6565
    6666static void ty_DrawOSD()
    6767{
     68        int index;
    6869        // printf( "Calling ty_DrawOSD()\n" );
     70    for ( index = 1; index < SUB_MAX_TEXT ; index++ )
     71        {
     72                memcpy( ty_OSD1.text[ index ], ty_OSD2.text[ index ], TY_CC_MAX_X - 1 );
     73                ty_OSD1.text[ index ][ TY_CC_MAX_X - 1 ] = 0;
     74        }
    6975        tyOSDUpdate = 1;
    7076}
    7177
    72 void ty_ClearOSD( int start )
     78void ty_ClearOSD( int start, int osd )
    7379{
    7480        int index;
    7581        // printf( "Calling ty_ClearOSD()\n" );
    7682   for ( index = start ; index < SUB_MAX_TEXT ; index++ )
    7783        {
    78                 memset( ty_OSD1.text[ index ], ' ', TY_CC_MAX_X - 1 );
    79                 ty_OSD1.text[ index ][ TY_CC_MAX_X - 1 ] = 0;
    80                 memset( ty_OSD2.text[ index ], ' ', TY_CC_MAX_X - 1 );
    81                 ty_OSD2.text[ index ][ TY_CC_MAX_X - 1 ] = 0;
     84
     85                if ( osd == 0 || osd == 1 )
     86                {
     87                        memset( ty_OSD1.text[ index ], ' ', TY_CC_MAX_X - 1 );
     88                        ty_OSD1.text[ index ][ TY_CC_MAX_X - 1 ] = 0;
     89                }
     90
     91                if ( osd == 0 || osd == 2 )
     92                {
     93                        memset( ty_OSD2.text[ index ], ' ', TY_CC_MAX_X - 1 );
     94                        ty_OSD2.text[ index ][ TY_CC_MAX_X - 1 ] = 0;
     95                }
    8296        }
    8397}
    8498
     
    103117        // printf( "Calling ty_DrawChar() x:%d y:%d %c fg:%d bg:%d\n",
    104118        //      cx, cy, disChar, fgColor, bgColor );
    105119
    106    ty_OSD1.text[ TY_CC_Y_Offset + cy ][ cx ] = disChar;
    107    memset( &( ty_OSD1.text[ TY_CC_Y_Offset + cy ][ cx + 1 ] ), ' ',
     120   ty_OSD2.text[ TY_CC_Y_Offset + cy ][ cx ] = disChar;
     121   memset( &( ty_OSD2.text[ TY_CC_Y_Offset + cy ][ cx + 1 ] ), ' ',
    108122      TY_CC_MAX_X - cx - 2 );
    109123        ( *x )++;
    110124}
     
    118132        //
    119133        if ( ( source + TY_CC_Y_Offset + numLines ) > SUB_MAX_TEXT )
    120134        {
    121       ty_ClearOSD( 1 );
     135      ty_ClearOSD( 1, 1 );
    122136                return;
    123137        }
    124138
    125139        if ( ( source + TY_CC_Y_Offset + numLines ) < 0 )
    126140        {
    127       ty_ClearOSD( 1 );
     141      ty_ClearOSD( 1, 1 );
    128142                return;
    129143        }
    130144
    131145        if ( numLines > SUB_MAX_TEXT )
    132146        {
    133       ty_ClearOSD( 1 );
     147      ty_ClearOSD( 1, 1 );
    134148                return;
    135149        }
    136150
     
    148162static void ty_drawchar( char c )
    149163{
    150164   if ( c < 2 ) return;
    151  
     165
    152166   if ( TY_OSD_flags & TY_OSD_MODE && TY_CC_stat != TY_CCNONE &&
    153167      TY_CC_CUR_Y != -1 )
    154168      ty_DrawChar( &TY_CC_CUR_X, &TY_CC_CUR_Y, c, 4, 13 );
     
    186200   11, -1, 1, 2, 3, 4, 12, 13, 14, 15, 5, 6, 7, 8, 9, 10
    187201};
    188202
     203// these are kind of poor substitutes for the actual special characters
     204char specialchar[] = { 'R', 'o', '/', '?', '*', 'c', 'E', '/', 'a', ' ', 'e', 'a', 'e', 'i', 'o', 'u' };
    189205// char specialchar[] = { '®', '°', '½', '¿', '*', '¢', '£', 14, 'à', ' ', 'è', 'â', 'ê', 'î', 'ô', 'û' };
    190206
    191207static int ty_CCdecode( char b1, char b2 )
     
    333349                     }
    334350                     else
    335351                     {
    336                         // ty_drawchar(specialchar[ b2 & 0x0f ] );
    337                         ty_drawchar( ' ' );
     352                        ty_drawchar( specialchar[ b2 & 0x0f ] );
     353                        // ty_drawchar( ' ' );
    338354                     }
    339355                     break;
    340356                  }
     
    353369                  {
    354370                     if ( TY_OSD_flags & TY_OSD_MODE &&
    355371                        TY_CC_stat != TY_CCPOPUP )
    356                                                                 ty_ClearOSD( 1 );
     372                                                                ty_ClearOSD( 1, 2 );
    357373                     TY_CC_stat = TY_CCPOPUP;
    358374                     break;
    359375                  }
     
    366382             
    367383                  case 0x25 ... 0x27:       // 2-4 row captions
    368384                  {
    369                      if ( TY_CC_stat == TY_CCPOPUP ) ty_ClearOSD( 1 );
     385                     if ( TY_CC_stat == TY_CCPOPUP ) ty_ClearOSD( 1, 2 );
    370386                     TY_CC_stat = b2 - 0x23;
    371387                     if ( TY_CC_CUR_Y < TY_CC_stat ) TY_CC_CUR_Y = TY_CC_stat;
    372388                     break;
     
    397413                     {
    398414                        if ( TY_CC_stat > TY_CCPOPUP || TY_CC_ptr == TY_CC_buf )
    399415                        {
    400                            ty_ClearOSD( 1 );
     416                           ty_ClearOSD( 1, 1 );
    401417                           ty_draw();
    402418                        }
    403419                        else
    404420                        {
    405                            ty_ClearOSD( 1 );
     421                           ty_ClearOSD( 1, 1 );
    406422
    407423                           // CRW -
    408424                           // new buffer
     
    442458                     if ( TY_OSD_debug && TY_CC_ptr != TY_CC_buf )
    443459                        mp_msg( MSGT_DEMUX, MSGL_DBG3, "(TY_OSD_debug) %s\n",
    444460                           TY_CC_buf );
    445                      if ( TY_OSD_flags & TY_OSD_MODE ) ty_ClearOSD( 1 );
     461                     if ( TY_OSD_flags & TY_OSD_MODE ) ty_ClearOSD( 1, 2 );
    446462
    447463                     TY_CC_CUR_X = 1;
    448464                     TY_CC_CUR_Y = -1;
     
    871887                                ty_OSD1.text[ index ] = malloc( TY_CC_MAX_X );
    872888                                ty_OSD2.text[ index ] = malloc( TY_CC_MAX_X );
    873889                        }
    874                         ty_ClearOSD( 0 );
     890                        ty_ClearOSD( 0, 0 );
    875891                        ty_OSD1.lines = SUB_MAX_TEXT;
    876892                        ty_OSD2.lines = SUB_MAX_TEXT;
    877893                        ty_pOSD1 = &ty_OSD1;
     
    880896                        tyOSDInited = 1;
    881897                }
    882898
    883                 if ( buf[ 0 ] == 0x01 )
     899                if ( buf[ 0 ] == 0x01 && ( subcc_enabled & 0x01 ) )
    884900                {
    885901                        ty_CCdecode( buf[ 1 ], buf[ 2 ] );
    886902                }
    887                 if ( buf[ 0 ] == 0x02 )
     903                if ( buf[ 0 ] == 0x02 && ( subcc_enabled & 0x02 ) )
    888904                {
    889905                        ty_XDSdecode( buf[ 1 ], buf[ 2 ] );
    890906                }
  • DOCS/man/cs/mplayer.1

    old new  
    15711571.PD 1
    15721572.
    15731573.TP
    1574 .B \-subcc \
     1574.B \-subcc 1 \
    15751575Zobrazovat DVD Closed Caption (CC) titulky.
    15761576Toto
    15771577.B nejsou
  • DOCS/man/de/mplayer.1

    old new  
    16141614.PD 1
    16151615.
    16161616.TP
    1617 .B \-subcc \
     1617.B \-subcc 1 \
    16181618Zeigt DVD-Closed-Caption-Untertitel an (CC).
    16191619Diese sind KEINE VOB-Untertitel. Hierbei handelt es sich um spezielle
    16201620ASCII-Untertitel für Hörgeschädigte, die in VOB-Userdatenstreams auf
  • DOCS/man/en/mplayer.1

    old new  
    15861586.PD 1
    15871587.
    15881588.TP
    1589 .B \-subcc \
    1590 Display DVD Closed Caption (CC) subtitles.
     1589.B \-subcc <0\-3> \
     1590Display Closed Caption (CC) or Extended Data Service (XDS) subtitles.
    15911591These are
    15921592.B not
    15931593the VOB subtitles, these are special ASCII subtitles for the
    15941594hearing impaired encoded in the VOB userdata stream on most region 1 DVDs.
    15951595CC subtitles have not been spotted on DVDs from other regions so far.
     1596.
     1597Passing -subcc 1 will show Closed Caption subtitles. Passing -subcc 2 will
     1598show XDS subtitles. Passing -subcc 3 will show both types.
    15961599.
    15971600.TP
    15981601.B \-subcp <codepage> (iconv only)
  • DOCS/man/es/mplayer.1

    old new  
    15351535.PD 1
    15361536.
    15371537.TP
    1538 .B \-subcc \
     1538.B \-subcc 1 \
    15391539Muestra subtículos de DVD Closed Caption (CC).
    15401540Esto no es los subtítulos VOB, son subtítulos especiales ASCII codificados
    15411541para el que no oye bien en el flujo de datos de usuario VOB en la mayoría de los
  • DOCS/man/fr/mplayer.1

    old new  
    16831683.PD 1
    16841684.
    16851685.TP
    1686 .B \-subcc \
     1686.B \-subcc 1 \
    16871687Affiche les sous-titres DVD Closed Caption (CC).
    16881688Ce ne sont
    16891689.B pas
  • DOCS/man/hu/mplayer.1

    old new  
    12641264Megadja hogy a feliratok merre legyenek rendezve.
    12651265A 0 a képernyõ felsõ része, az 1 a közepe, a 2 az alsó része.
    12661266.TP
    1267 .B \-subcc \
     1267.B \-subcc 1 \
    12681268DVD Closed Caption (CC) feliratok megjelenítése.
    12691269Ezek nem VOB feliratok, hanem ASCII-k. Az 1-es régiókódú lemezeken
    12701270haszálatosak.
  • DOCS/man/it/mplayer.1

    old new  
    16891689.PD 1
    16901690.
    16911691.TP
    1692 .B \-subcc \
     1692.B \-subcc 1 \
    16931693Visualizza i sottotitoli Close Caption (CC) dei DVD.
    16941694Questi
    16951695.B non
  • DOCS/man/pl/mplayer.1

    old new  
    16071607.PD 1
    16081608.
    16091609.TP
    1610 .B \-subcc \
     1610.B \-subcc 1 \
    16111611Wy¶wietla napisy DVD Closed Caption (CC).
    16121612To
    16131613.B nie
  • DOCS/man/sv/mplayer.1

    old new  
    15131513.PD 1
    15141514.
    15151515.TP
    1516 .B \-subcc \
     1516.B \-subcc 1 \
    15171517Display DVD Closed Caption (CC) subtitles.
    15181518These are NOT the VOB subtitles, these are special ASCII subtitles for the
    15191519hearing impaired encoded in the VOB userdata stream on most region 1 DVDs.
  • DOCS/man/zh/mplayer.1

    old new  
    859859ÉèÖÃ×ÖÄ»ºÍOSD±³¾°µÄÑÕɫֵ. Ŀǰ×ÖÄ»ÊǻҶÈͼÏñËùÒÔÕâ¸öÖµÏ൱ÓÚÑÕÉ«µÄÁÁ¶È.
    860860255´ú±í°×É«0´ú±íºÚÉ«.
    861861.TP
    862 .B \-subcc \
     862.B \-subcc 1 \
    863863ÏÔʾDVDµÄÒþ²Ø×ÖÄ»Êý¾Ý±í(CC)×ÖÄ».
    864864ËüÃDz»ÊÇVOB×ÖÄ», ËüÃÇÊÇΪÌýÁ¦Õϰ­µÄÈË×¼±¸µÄÌØÊâµÄASCII×ÖÄ»,
    865865±àÂëÔÚ´ó¶àÊýÇøÂëΪ1µÄVOBµÄÓû§Êý¾ÝÁ÷ÖÐ.