[vlc-devel] [PATCH 1/2] avformat: mux: handle subtitle metadata

Alexandre Janniaux ajanni at videolabs.io
Fri Dec 13 17:56:20 CET 2019


Hi,

On Fri, Dec 13, 2019 at 10:08:26AM +0100, Steve Lhomme wrote:
> On 2019-12-11 16:30, Francois Cartegnie wrote:
> > Le 11/12/2019 à 16:23, Alexandre Janniaux a écrit :
> > > +    case SPU_ES:
> > > +        codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
> > > +        av_dict_set( &stream->metadata, "title", fmt->psz_description, 0 );
> > > +        av_dict_set( &stream->metadata, "language", fmt->psz_language, 0 );
> > > +        break;
> > > +
> >
> > * language is unlikely to match the expected format.
>
> We read the language field as follows without further transformation:
>
> AVDictionaryEntry *language = av_dict_get( s->metadata, "language", NULL, 0
> );
> if ( language && language->value )
>     es_fmt.psz_language = strdup( language->value );
>
> So either the internal values of VLC are exactly compatible with lavf, or
> one of them (or both) are loosely defined and we shouldn't care too much.
>
> Also the ES field is defined as such:
> char            *psz_language; /**< human-readable language name */
>
> I would have expected some ISO code. The Matroska demuxer writes a ISO-639-2
> value.

I'll wait if some more information gets to the mailing list
and send a patch with the missing checks.

Thank you for review,

Regards,
--
Alexandre Janniaux
Videolabs


More information about the vlc-devel mailing list