aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorFrançois Revol <revol@free.fr>2005-12-30 20:34:08 +0000
committerFrançois Revol <revol@free.fr>2005-12-30 20:34:08 +0000
commitab561df995ccf41ad6fde7e80adba6966cf86954 (patch)
tree612774cd2659226ef49c68f1cf62d476d5ffa5b0 /libavformat/movenc.c
parentb9a87c4d6c73d3b1462b6f09940b0a9649b123c9 (diff)
downloadffmpeg-ab561df995ccf41ad6fde7e80adba6966cf86954.tar.gz
finally found what those >138 codes were... crappy compressed 5bit ascii. this gets them correctly, and adds setting track lang in movenc too.
Originally committed as revision 4792 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 1c721d7200..a340644b79 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -52,6 +52,7 @@ typedef struct MOVIndex {
long sampleCount;
long sampleDuration;
int hasKeyframes;
+ int language;
int trackID;
AVCodecContext *enc;
@@ -72,6 +73,9 @@ typedef struct MOVContext {
static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track);
+/* output language code from iso639 language name */
+extern int ff_mov_iso639_to_lang(const char *lang, int mp4);
+
const CodecTag ff_mov_obj_type[] = {
{ CODEC_ID_MPEG4 , 32 },
{ CODEC_ID_AAC , 64 },
@@ -701,7 +705,7 @@ static int mov_write_mdhd_tag(ByteIOContext *pb, MOVTrack* track)
put_be32(pb, track->time); /* modification time */
put_be32(pb, track->timescale); /* time scale (sample rate for audio) */
put_be32(pb, track->trackDuration); /* duration */
- put_be16(pb, 0); /* language, 0 = english */
+ put_be16(pb, track->language); /* language */
put_be16(pb, 0); /* reserved (quality) */
return 32;
}
@@ -1331,6 +1335,8 @@ static int mov_write_header(AVFormatContext *s)
av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, the file may be unplayable!\n");
}
}
+ /* don't know yet if mp4 or not */
+ mov->tracks[i].language = ff_mov_iso639_to_lang(s->streams[i]->language, 1);
}
/* Default mode == MP4 */