[FFmpeg-cvslog] r17688 - trunk/ffmpeg.c
aurel
subversion
Sun Mar 1 16:58:58 CET 2009
Author: aurel
Date: Sun Mar 1 16:58:57 2009
New Revision: 17688
Log:
fix last usage of old metadata API in ffmpeg.c (handling of AVStream language)
Modified:
trunk/ffmpeg.c
Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c Sun Mar 1 16:38:06 2009 (r17687)
+++ trunk/ffmpeg.c Sun Mar 1 16:58:57 2009 (r17688)
@@ -1721,6 +1721,7 @@ static int av_encode(AVFormatContext **o
/* 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 **o
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(AVFormatCon
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(AVFormat
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;
}
More information about the ffmpeg-cvslog
mailing list