Mercurial > libavformat.hg
comparison movenc.c @ 3472:0edcd0638ecc libavformat
simplify ipod brand selection
author | bcoudurier |
---|---|
date | Sat, 14 Jun 2008 21:07:59 +0000 |
parents | a7ba44edfacb |
children | 87259205d376 |
comparison
equal
deleted
inserted
replaced
3471:a7ba44edfacb | 3472:0edcd0638ecc |
---|---|
1376 /* TODO: This needs to be more general */ | 1376 /* TODO: This needs to be more general */ |
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; | 1381 int has_h264 = 0, has_video = 0; |
1382 int i; | 1382 int i; |
1383 | 1383 |
1384 for (i = 0; i < s->nb_streams; i++) { | 1384 for (i = 0; i < s->nb_streams; i++) { |
1385 AVStream *st = s->streams[i]; | 1385 AVStream *st = s->streams[i]; |
1386 if (st->codec->codec_type == CODEC_TYPE_VIDEO) | |
1387 has_video = 1; | |
1386 if (st->codec->codec_id == CODEC_ID_H264) | 1388 if (st->codec->codec_id == CODEC_ID_H264) |
1387 has_h264 = 1; | 1389 has_h264 = 1; |
1388 } | 1390 } |
1389 | 1391 |
1390 put_be32(pb, 0); /* size */ | 1392 put_be32(pb, 0); /* size */ |
1396 put_tag(pb, "3g2a"); | 1398 put_tag(pb, "3g2a"); |
1397 else if (mov->mode == MODE_PSP) | 1399 else if (mov->mode == MODE_PSP) |
1398 put_tag(pb, "MSNV"); | 1400 put_tag(pb, "MSNV"); |
1399 else if (mov->mode == MODE_MP4) | 1401 else if (mov->mode == MODE_MP4) |
1400 put_tag(pb, "isom"); | 1402 put_tag(pb, "isom"); |
1401 else if (mov->mode == MODE_IPOD) { | 1403 else if (mov->mode == MODE_IPOD) |
1402 for (i = 0; i < s->nb_streams; i++) | 1404 put_tag(pb, has_video ? "M4V ":"M4A "); |
1403 if (s->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) { | 1405 else |
1404 put_tag(pb, "M4V "); | |
1405 break; | |
1406 } | |
1407 if (i == s->nb_streams) | |
1408 put_tag(pb, "M4A "); | |
1409 } else | |
1410 put_tag(pb, "qt "); | 1406 put_tag(pb, "qt "); |
1411 | 1407 |
1412 put_be32(pb, 0x200); | 1408 put_be32(pb, 0x200); |
1413 | 1409 |
1414 if(mov->mode != MODE_MOV){ | 1410 if(mov->mode != MODE_MOV){ |