[MPlayer-dev-eng] [PATCH] demuxer-independent attachments

Nico Sabbi Nicola.Sabbi at poste.it
Tue Jan 8 09:47:51 CET 2008


Il Tuesday 08 January 2008 01:35:49 Evgeniy Stepanov ha scritto:
> Hi,
>
> with this patch, attachments are stored in demuxer_t. This allows
> to remove the last remaining ass_* call from mkv demuxer.
>
> Index: libmpdemux/demuxer.c
> ===================================================================
> --- libmpdemux/demuxer.c        (revision 25646)
> +++ libmpdemux/demuxer.c        (working copy)
> @@ -22,6 +22,11 @@
>
>  #include "libaf/af_format.h"
>
> +#ifdef USE_ASS
> +#include "libass/ass.h"
> +#include "libass/ass_mp.h"
> +#endif
> +
>  extern void resync_video_stream(sh_video_t *sh_video);
>  extern void resync_audio_stream(sh_audio_t *sh_audio);
>
> @@ -332,6 +337,14 @@
>            free(demuxer->chapters[i].name);
>        free(demuxer->chapters);
>      }
> +    if (demuxer->attachments) {
> +      for (i=0; i<demuxer->num_attachments; i++) {
> +        free(demuxer->attachments[i].name);
> +        free(demuxer->attachments[i].type);
> +        free(demuxer->attachments[i].data);
> +      }
> +      free(demuxer->attachments);
> +    }
>      free(demuxer);
>  }
>
> @@ -812,6 +825,19 @@
>      sh_video->i_bps*0.008f,
>      sh_video->i_bps/1024.0f );
>  }
> +#ifdef USE_ASS
> + if (ass_enabled && ass_library) {
> +   for (i = 0; i < demuxer->num_attachments; ++i) {
> +     demux_attachment_t* att = demuxer->attachments + i;
> +     if (extract_embedded_fonts &&
> +         att->name && att->type && att->data && att->data_size &&
> +         (strcmp(att->type, "application/x-truetype-font") == 0 ||
> +          strcmp(att->type, "application/x-font") == 0))
> +       ass_add_font(ass_library, att->name, att->data,
> att->data_size); +   }
> + }
> +#endif
> +
>  return demuxer;
>  }
>


I don't like it even remotely: the demuxer layer has nothing to do 
with ass!




More information about the MPlayer-dev-eng mailing list