[SCM] libav/experimental: fix last usage of old metadata API in ffmpeg.c (handling of AVStream language)

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:40:01 UTC 2013


The following commit has been merged in the experimental branch:
commit 0a7892468ed33366dc252f11518bb79e5b8a5ceb
Author: Aurelien Jacobs <aurel at gnuage.org>
Date:   Sun Mar 1 15:58:57 2009 +0000

    fix last usage of old metadata API in ffmpeg.c (handling of AVStream language)
    
    Originally committed as revision 17688 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/ffmpeg.c b/ffmpeg.c
index 69f87cb..8ec1f47 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1721,6 +1721,7 @@ static int av_encode(AVFormatContext **output_files,
 
     /* for each output stream, we compute the right encoding parameters */
     for(i=0;i<nb_ostreams;i++) {
+        AVMetadataTag *lang;
         ost = ost_table[i];
         os = output_files[ost->file_index];
         ist = ist_table[ost->source_index];
@@ -1728,9 +1729,9 @@ static int av_encode(AVFormatContext **output_files,
         codec = ost->st->codec;
         icodec = ist->st->codec;
 
-        if (!ost->st->language[0])
-            av_strlcpy(ost->st->language, ist->st->language,
-                       sizeof(ost->st->language));
+        if ((lang=av_metadata_get(ist->st->metadata, "language", NULL, 0))
+            &&   !av_metadata_get(ost->st->metadata, "language", NULL, 0))
+            av_metadata_set(&ost->st->metadata, "language", lang->value);
 
         ost->st->disposition = ist->st->disposition;
 
@@ -3195,7 +3196,7 @@ static void new_audio_stream(AVFormatContext *oc)
     audio_enc->sample_rate = audio_sample_rate;
     audio_enc->time_base= (AVRational){1, audio_sample_rate};
     if (audio_language) {
-        av_strlcpy(st->language, audio_language, sizeof(st->language));
+        av_metadata_set(&st->metadata, "language", audio_language);
         av_free(audio_language);
         audio_language = NULL;
     }
@@ -3233,7 +3234,7 @@ static void new_subtitle_stream(AVFormatContext *oc)
     nb_ocodecs++;
 
     if (subtitle_language) {
-        av_strlcpy(st->language, subtitle_language, sizeof(st->language));
+        av_metadata_set(&st->metadata, "language", subtitle_language);
         av_free(subtitle_language);
         subtitle_language = NULL;
     }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list