comparison movenc.c @ 3476:3026020083e8 libavformat

set correct ftyp minor version for 3gp/2
author bcoudurier
date Sun, 15 Jun 2008 01:38:38 +0000
parents 654b3aa1cab4
children ae0885c44048
comparison
equal deleted inserted replaced
3475:654b3aa1cab4 3476:3026020083e8
1377 static int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s) 1377 static int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s)
1378 { 1378 {
1379 MOVContext *mov = s->priv_data; 1379 MOVContext *mov = s->priv_data;
1380 offset_t pos = url_ftell(pb); 1380 offset_t pos = url_ftell(pb);
1381 int has_h264 = 0, has_video = 0; 1381 int has_h264 = 0, has_video = 0;
1382 int minor = 0x200;
1382 int i; 1383 int i;
1383 1384
1384 for (i = 0; i < s->nb_streams; i++) { 1385 for (i = 0; i < s->nb_streams; i++) {
1385 AVStream *st = s->streams[i]; 1386 AVStream *st = s->streams[i];
1386 if (st->codec->codec_type == CODEC_TYPE_VIDEO) 1387 if (st->codec->codec_type == CODEC_TYPE_VIDEO)
1390 } 1391 }
1391 1392
1392 put_be32(pb, 0); /* size */ 1393 put_be32(pb, 0); /* size */
1393 put_tag(pb, "ftyp"); 1394 put_tag(pb, "ftyp");
1394 1395
1395 if (mov->mode == MODE_3GP) 1396 if (mov->mode == MODE_3GP) {
1396 put_tag(pb, has_h264 ? "3gp6":"3gp4"); 1397 put_tag(pb, has_h264 ? "3gp6" : "3gp4");
1397 else if (mov->mode & MODE_3G2) 1398 minor = has_h264 ? 0x100 : 0x200;
1398 put_tag(pb, has_h264 ? "3g2b":"3g2a"); 1399 } else if (mov->mode & MODE_3G2) {
1399 else if (mov->mode == MODE_PSP) 1400 put_tag(pb, has_h264 ? "3g2b" : "3g2a");
1401 minor = has_h264 ? 0x20000 : 0x10000;
1402 }else if (mov->mode == MODE_PSP)
1400 put_tag(pb, "MSNV"); 1403 put_tag(pb, "MSNV");
1401 else if (mov->mode == MODE_MP4) 1404 else if (mov->mode == MODE_MP4)
1402 put_tag(pb, "isom"); 1405 put_tag(pb, "isom");
1403 else if (mov->mode == MODE_IPOD) 1406 else if (mov->mode == MODE_IPOD)
1404 put_tag(pb, has_video ? "M4V ":"M4A "); 1407 put_tag(pb, has_video ? "M4V ":"M4A ");
1405 else 1408 else
1406 put_tag(pb, "qt "); 1409 put_tag(pb, "qt ");
1407 1410
1408 put_be32(pb, 0x200); 1411 put_be32(pb, minor);
1409 1412
1410 if(mov->mode == MODE_MOV) 1413 if(mov->mode == MODE_MOV)
1411 put_tag(pb, "qt "); 1414 put_tag(pb, "qt ");
1412 else{ 1415 else{
1413 put_tag(pb, "isom"); 1416 put_tag(pb, "isom");