Revision 1522767d

View differences:

libavformat/movenc.c
1389 1389
    MOVContext *mov = s->priv_data;
1390 1390
    int i;
1391 1391

  
1392
    /* Default mode == MP4 */
1393
    mov->mode = MODE_MP4;
1394

  
1395
    if (s->oformat != NULL) {
1396
        if (!strcmp("3gp", s->oformat->name)) mov->mode = MODE_3GP;
1397
        else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3G2;
1398
        else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV;
1399
        else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP;
1400

  
1401
        if ( mov->mode == MODE_3GP || mov->mode == MODE_3G2 ||
1402
             mov->mode == MODE_MP4 || mov->mode == MODE_PSP )
1403
            mov_write_ftyp_tag(pb,s);
1404
        if ( mov->mode == MODE_PSP ) {
1405
            if ( s->nb_streams != 2 ) {
1406
                av_log(s, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n");
1407
                return -1;
1408
            }
1409
            mov_write_uuidprof_tag(pb,s);
1410
        }
1411
    }
1412

  
1392 1413
    for(i=0; i<s->nb_streams; i++){
1393 1414
        AVCodecContext *c= s->streams[i]->codec;
1394 1415

  
......
1409 1430
                    av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, the file may be unplayable!\n");
1410 1431
            }
1411 1432
        }
1412
        /* don't know yet if mp4 or not */
1413
        mov->tracks[i].language = ff_mov_iso639_to_lang(s->streams[i]->language, 1);
1414
    }
1415

  
1416
    /* Default mode == MP4 */
1417
    mov->mode = MODE_MP4;
1418

  
1419
    if (s->oformat != NULL) {
1420
        if (!strcmp("3gp", s->oformat->name)) mov->mode = MODE_3GP;
1421
        else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3G2;
1422
        else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV;
1423
        else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP;
1424

  
1425
        if ( mov->mode == MODE_3GP || mov->mode == MODE_3G2 ||
1426
             mov->mode == MODE_MP4 || mov->mode == MODE_PSP )
1427
            mov_write_ftyp_tag(pb,s);
1428
        if ( mov->mode == MODE_PSP ) {
1429
            if ( s->nb_streams != 2 ) {
1430
                av_log(s, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n");
1431
                return -1;
1432
            }
1433
            mov_write_uuidprof_tag(pb,s);
1434
        }
1433
        mov->tracks[i].language = ff_mov_iso639_to_lang(s->streams[i]->language, mov->mode != MODE_MOV);
1435 1434
    }
1436 1435

  
1437 1436
    for (i=0; i<MAX_STREAMS; i++) {
tests/ffmpeg.regression.ref
137 137
7200000 ./data/a-dv.dv
138 138
c2082cd8adf417c4ebc32654e446cba1 *./data/out.yuv
139 139
stddev:  8.86 PSNR:29.17 bytes:7602176
140
bd0db310a36ad94bcd4448abe0a88368 *./data/a-svq1.mov
140
733d55faec85f437f534771c145973d2 *./data/a-svq1.mov
141 141
1379827 ./data/a-svq1.mov
142 142
bbff871d1475e1eee4231a08e075de2c *./data/out.yuv
143 143
stddev: 10.99 PSNR:27.30 bytes:7602176
tests/libav.regression.ref
22 22
794934a02582f8dfc85d1856514cf37c *./data/b-libav.flv
23 23
 339325 ./data/b-libav.flv
24 24
./data/b-libav.flv CRC=0x7b9076f8
25
e4ed8d635d867e2f5980fd9c73c9cf3d *./data/b-libav.mov
25
4eecc0b7b09a6696f6d0f811f637612e *./data/b-libav.mov
26 26
 369873 ./data/b-libav.mov
27 27
./data/b-libav.mov CRC=0x48f5a90d
28 28
8bf16d40a2ec19fa36b124a928e47e23 *./data/b-libav.nut
tests/rotozoom.regression.ref
137 137
7200000 ./data/a-dv.dv
138 138
bb69dda7a84a5b166434e28e1243d3d1 *./data/out.yuv
139 139
stddev:  2.99 PSNR:38.59 bytes:7602176
140
5b02b6ae7ffa257a66ae9857a992fdfe *./data/a-svq1.mov
140
e4896d19f536c420cb17fac162d1f95b *./data/a-svq1.mov
141 141
769527 ./data/a-svq1.mov
142 142
44777d1ddbccd0ef7f8d08394465670c *./data/out.yuv
143 143
stddev:  3.44 PSNR:37.38 bytes:7602176

Also available in: Unified diff