[FFmpeg-devel] Suggestion for a centralized language-tag facility in libavformat
cyril comparon
cyril.comparon
Thu Apr 23 16:10:53 CEST 2009
>> + ? ?/* language list */
>> + ? ?hpos = put_header(pb, &ff_asf_language_guid);
>> + ? ?for(nbStreamsWithSupportedLang=0, n=0; n<s->nb_streams; n++) {
>> + ? ? ? ?AVMetadataTag *lang_tag = av_metadata_get(s->streams[n]->metadata, "language", NULL, 0);
>> + ? ? ? ?if (lang_tag && av_convertLangTo(lang_tag->value, AV_LANG_ISO639_1))
>> + ? ? ? ? ? ?nbStreamsWithSupportedLang++;
>> + ? ?}
>> + ? ?put_le16(pb, nbStreamsWithSupportedLang);
>> + ? ?for(n=0; n<s->nb_streams; n++) {
>> + ? ? ? ?AVMetadataTag *lang_tag = av_metadata_get(s->streams[n]->metadata, "language", NULL, 0);
>> + ? ? ? ?if (lang_tag) {
>> + ? ? ? ? ? ?const char *language = av_convertLangTo(lang_tag->value, AV_LANG_ISO639_1);
>> + ? ? ? ? ? ?if (language) {
>> + ? ? ? ? ? ? ? ?put_byte(pb, 2*(1+strlen(language)));
>> + ? ? ? ? ? ? ? ?put_str16_nolen(pb, language);
>> + ? ? ? ? ? ?}
>> + ? ? ? ?}
>> + ? ?}
>
> This still does not look like it would work where any of these if() false once
>
This should be solved now.
Cyril
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iso639tool.cpp
Type: application/octet-stream
Size: 5070 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090423/46c8af66/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iso639tool.pro
Type: application/octet-stream
Size: 90 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090423/46c8af66/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iso639tool.readme
Type: application/octet-stream
Size: 622 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090423/46c8af66/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1_avlanguage-b.patch
Type: application/octet-stream
Size: 26970 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090423/46c8af66/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2_asf_languages-b.patch
Type: application/octet-stream
Size: 9723 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090423/46c8af66/attachment-0004.obj>
More information about the ffmpeg-devel
mailing list