[MPlayer-dev-eng] [PATCH] aalib subtitle fix

za3k at za3k.com za3k at za3k.com
Sun May 7 12:15:11 EEST 2017


For some time now, aalib rendering has had broken subtitles. -vo aa is designed to use human-readable text at the size of one character per character. In actuality, it's somehow switched to trying to render a standard font using dithering since its introduction. This patch fixes it.

Explanation: vo_font doesn't seem to get used anywhere, because OSD rendering is actually done in a completely separate way from other video output, but I kept it in just in case.

As a side note, someone may want to investigate unicode support for subtitles in -vo aa.

*** /var/src/MPlayer-1.3.0/libvo/vo_aa.c        2016-02-12 12:23:39.000000000 -0800
--- vo_aa.c     2017-05-07 02:07:11.900548663 -0700
*************** static int osdx, osdy;
*** 92,97 ****
--- 92,98 ----
  static int osd_text_length = 0;
  int aaconfigmode=1;
  font_desc_t* vo_font_save = NULL;
+ font_desc_t* sub_font_save = NULL;
  static struct SwsContext *sws=NULL;
  
  /* configuration */
*************** config(uint32_t width, uint32_t height,
*** 249,256 ****
  
      /* now init our own 'font' */
      if(!vo_font_save) vo_font_save = vo_font;
!     if(vo_font == vo_font_save) {
!       vo_font=malloc(sizeof(font_desc_t));//if(!desc) return NULL;
        memset(vo_font,0,sizeof(font_desc_t));
        vo_font->pic_a[0]=malloc(sizeof(raw_file));
        memset(vo_font->pic_a[0],0,sizeof(raw_file));
--- 250,258 ----
  
      /* now init our own 'font' */
      if(!vo_font_save) vo_font_save = vo_font;
!     if(!sub_font_save) sub_font_save = vo_font;
!     if(vo_font == vo_font_save || sub_font == sub_font_save) {
!       vo_font=sub_font=malloc(sizeof(font_desc_t));//if(!desc) return NUL
L;
        memset(vo_font,0,sizeof(font_desc_t));
        vo_font->pic_a[0]=malloc(sizeof(raw_file));
        memset(vo_font->pic_a[0],0,sizeof(raw_file));


More information about the MPlayer-dev-eng mailing list