Revision ab561df9 libavformat/movenc.c

View differences:

libavformat/movenc.c
52 52
    long        sampleCount;
53 53
    long        sampleDuration;
54 54
    int         hasKeyframes;
55
    int         language;
55 56
    int         trackID;
56 57
    AVCodecContext *enc;
57 58

  
......
72 73

  
73 74
static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track);
74 75

  
76
/* output language code from iso639 language name */
77
extern int ff_mov_iso639_to_lang(const char *lang, int mp4);
78

  
75 79
const CodecTag ff_mov_obj_type[] = {
76 80
    { CODEC_ID_MPEG4     ,  32 },
77 81
    { CODEC_ID_AAC       ,  64 },
......
701 705
    put_be32(pb, track->time); /* modification time */
702 706
    put_be32(pb, track->timescale); /* time scale (sample rate for audio) */
703 707
    put_be32(pb, track->trackDuration); /* duration */
704
    put_be16(pb, 0); /* language, 0 = english */
708
    put_be16(pb, track->language); /* language */
705 709
    put_be16(pb, 0); /* reserved (quality) */
706 710
    return 32;
707 711
}
......
1331 1335
                    av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, the file may be unplayable!\n");
1332 1336
            }
1333 1337
        }
1338
        /* don't know yet if mp4 or not */
1339
        mov->tracks[i].language = ff_mov_iso639_to_lang(s->streams[i]->language, 1);
1334 1340
    }
1335 1341

  
1336 1342
    /* Default mode == MP4 */

Also available in: Unified diff