[FFmpeg-cvslog] r17611 - in trunk/libavformat: isom.c movenc.c
aurel
subversion
Thu Feb 26 14:11:19 CET 2009
Author: aurel
Date: Thu Feb 26 14:11:18 2009
New Revision: 17611
Log:
return -1 for errors in ff_mov_iso639_to_lang() to allow for error checking
Modified:
trunk/libavformat/isom.c
trunk/libavformat/movenc.c
Modified: trunk/libavformat/isom.c
==============================================================================
--- trunk/libavformat/isom.c Thu Feb 26 14:08:22 2009 (r17610)
+++ trunk/libavformat/isom.c Thu Feb 26 14:11:18 2009 (r17611)
@@ -257,7 +257,7 @@ int ff_mov_iso639_to_lang(const char *la
}
/* XXX:can we do that in mov too? */
if (!mp4)
- return 0;
+ return -1;
/* handle undefined as such */
if (lang[0] == '\0')
lang = "und";
@@ -265,9 +265,9 @@ int ff_mov_iso639_to_lang(const char *la
for (i = 0; i < 3; i++) {
unsigned char c = (unsigned char)lang[i];
if (c < 0x60)
- return 0;
+ return -1;
if (c > 0x60 + 0x1f)
- return 0;
+ return -1;
code <<= 5;
code |= (c - 0x60);
}
Modified: trunk/libavformat/movenc.c
==============================================================================
--- trunk/libavformat/movenc.c Thu Feb 26 14:08:22 2009 (r17610)
+++ trunk/libavformat/movenc.c Thu Feb 26 14:11:18 2009 (r17611)
@@ -1651,6 +1651,8 @@ static int mov_write_header(AVFormatCont
track->enc = st->codec;
track->language = ff_mov_iso639_to_lang(lang?lang->value:"und", mov->mode!=MODE_MOV);
+ if (track->language < 0)
+ track->language = 0;
track->mode = mov->mode;
track->tag = mov_find_codec_tag(s, track);
if (!track->tag) {
More information about the ffmpeg-cvslog
mailing list