[MPlayer-cvslog] r29386 - trunk/libmpdemux/demux_lavf.c

reimar subversion at mplayerhq.hu
Wed Jun 24 10:13:52 CEST 2009


Author: reimar
Date: Wed Jun 24 10:13:52 2009
New Revision: 29386

Log:
AVStream.language is deprecated, switch to av_get_metadata instead.

Modified:
   trunk/libmpdemux/demux_lavf.c

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	Wed Jun 24 10:06:46 2009	(r29385)
+++ trunk/libmpdemux/demux_lavf.c	Wed Jun 24 10:13:52 2009	(r29386)
@@ -220,6 +220,7 @@ static void handle_stream(demuxer_t *dem
     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 @@ static void handle_stream(demuxer_t *dem
                     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 @@ static void handle_stream(demuxer_t *dem
                 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)


More information about the MPlayer-cvslog mailing list