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

Steve Lhomme robux4 at ycbcr.xyz
Fri Dec 13 10:08:26 CET 2019


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.

> 
> * better not create empty value for keys
> 
> -- 
> Francois Cartegnie
> VideoLAN - VLC Developer
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list