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

Nicolas George george at nsup.org
Sat Oct 25 13:43:50 CEST 2014


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 at gmx.net>
> ---
>  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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20141025/aed4711f/attachment.asc>


More information about the MPlayer-dev-eng mailing list