changeset 29344:fb8ad1c8b5d6

AVStream.language is deprecated, switch to av_get_metadata instead.
author reimar
date Wed, 24 Jun 2009 08:13:52 +0000
parents 28486169f9e0
children 1f8d78a38803
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Wed Jun 24 08:06:46 2009 +0000
+++ b/libmpdemux/demux_lavf.c	Wed Jun 24 08:13:52 2009 +0000
@@ -220,6 +220,7 @@
     lavf_priv_t *priv= demuxer->priv;
     AVStream *st= avfc->streams[i];
     AVCodecContext *codec= st->codec;
+    AVMetadataTag *lang = av_metadata_get(st->metadata, "language", NULL, 0);
     int g;
 
     switch(codec->codec_type){
@@ -290,8 +291,8 @@
                     sh_audio->format = 0x7;
                     break;
             }
-            if (st->language) {
-              sh_audio->lang = strdup(st->language);
+            if (lang && lang->value) {
+              sh_audio->lang = strdup(lang->value);
               mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_LANG=%s\n", i, sh_audio->lang);
             }
             if (st->disposition & AV_DISPOSITION_DEFAULT)
@@ -396,8 +397,8 @@
                 memcpy(sh_sub->extradata, codec->extradata, codec->extradata_size);
                 sh_sub->extradata_len = codec->extradata_size;
             }
-            if (st->language) {
-              sh_sub->lang = strdup(st->language);
+            if (lang && lang->value) {
+              sh_sub->lang = strdup(lang->value);
               mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", priv->sub_streams, sh_sub->lang);
             }
             if (st->disposition & AV_DISPOSITION_DEFAULT)