Web lists-archives.com

Re: [MPlayer-dev-eng] [PATCH 2/2] demux_lavf: Also add AV_CODEC_ID_OTF attachments




Le quartidi 4 brumaire, an CCXXIII, Alexander Strasser a écrit :
> Make those font attachments work with demux_lavf.
> 
> Fix other part of 2207
> 
> Signed-off-by: Alexander Strasser <eclipse7@xxxxxxx>
> ---
>  libmpdemux/demux_lavf.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

This looks right too, except for a small nitpick:

> diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
> index de523df..ddc05d6 100644
> --- a/libmpdemux/demux_lavf.c
> +++ b/libmpdemux/demux_lavf.c
> @@ -483,10 +483,11 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
>              break;
>          }
>          case AVMEDIA_TYPE_ATTACHMENT:{
> -            if (st->codec->codec_id == AV_CODEC_ID_TTF) {
> +            if (st->codec->codec_id == AV_CODEC_ID_TTF || st->codec->codec_id == AV_CODEC_ID_OTF) {
>                  AVDictionaryEntry *fnametag = av_dict_get(st->metadata, "filename", NULL, 0);
> +                AVDictionaryEntry *mimetype = av_dict_get(st->metadata, "mimetype", NULL, 0);
>                  demuxer_add_attachment(demuxer, fnametag ? fnametag->value : NULL,
> -                                       "application/x-truetype-font",

> +                                       mimetype ? mimetype->value : "application/x-truetype-font",

application/x-font would seem like a saner fallback if it works.

>                                         codec->extradata, codec->extradata_size);
>              }
>              break;
> -- 

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng