comparison movenc.c @ 887:d70e50f1495f libavformat

COSMETICS: tabs --> spaces, some prettyprinting
author diego
date Thu, 22 Dec 2005 01:10:11 +0000
parents da1d5db0ce5c
children 1e49bfea0ffb
comparison
equal deleted inserted replaced
886:7ed1351f8c7e 887:d70e50f1495f
285 if (!tag) 285 if (!tag)
286 tag = codec_get_tag(codec_movaudio_tags, track->enc->codec_id); 286 tag = codec_get_tag(codec_movaudio_tags, track->enc->codec_id);
287 // if no mac fcc found, try with Microsoft tags 287 // if no mac fcc found, try with Microsoft tags
288 if (!tag) 288 if (!tag)
289 { 289 {
290 int tmp = codec_get_tag(codec_wav_tags, track->enc->codec_id); 290 int tmp = codec_get_tag(codec_wav_tags, track->enc->codec_id);
291 tag = MKTAG('m', 's', ((tmp >> 8) & 0xff), (tmp & 0xff)); 291 tag = MKTAG('m', 's', ((tmp >> 8) & 0xff), (tmp & 0xff));
292 } 292 }
293 put_le32(pb, tag); // store it byteswapped 293 put_le32(pb, tag); // store it byteswapped
294 294
295 put_be32(pb, 0); /* Reserved */ 295 put_be32(pb, 0); /* Reserved */
513 tag = track->enc->codec_tag; 513 tag = track->enc->codec_tag;
514 if (!tag) 514 if (!tag)
515 tag = codec_get_tag(codec_movvideo_tags, track->enc->codec_id); 515 tag = codec_get_tag(codec_movvideo_tags, track->enc->codec_id);
516 // if no mac fcc found, try with Microsoft tags 516 // if no mac fcc found, try with Microsoft tags
517 if (!tag) 517 if (!tag)
518 tag = codec_get_tag(codec_bmp_tags, track->enc->codec_id); 518 tag = codec_get_tag(codec_bmp_tags, track->enc->codec_id);
519 put_le32(pb, tag); // store it byteswapped 519 put_le32(pb, tag); // store it byteswapped
520 520
521 put_be32(pb, 0); /* Reserved */ 521 put_be32(pb, 0); /* Reserved */
522 put_be16(pb, 0); /* Reserved */ 522 put_be16(pb, 0); /* Reserved */
523 put_be16(pb, 1); /* Data-reference index */ 523 put_be16(pb, 1); /* Data-reference index */
647 { 647 {
648 char *descr, *hdlr, *hdlr_type; 648 char *descr, *hdlr, *hdlr_type;
649 int pos = url_ftell(pb); 649 int pos = url_ftell(pb);
650 650
651 if (!track) { /* no media --> data handler */ 651 if (!track) { /* no media --> data handler */
652 hdlr = "dhlr"; 652 hdlr = "dhlr";
653 hdlr_type = "url "; 653 hdlr_type = "url ";
654 descr = "DataHandler"; 654 descr = "DataHandler";
655 } else { 655 } else {
656 hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0"; 656 hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";
657 if (track->enc->codec_type == CODEC_TYPE_VIDEO) { 657 if (track->enc->codec_type == CODEC_TYPE_VIDEO) {
658 hdlr_type = "vide"; 658 hdlr_type = "vide";
659 descr = "VideoHandler"; 659 descr = "VideoHandler";
660 } else { 660 } else {
661 hdlr_type = "soun"; 661 hdlr_type = "soun";
662 descr = "SoundHandler"; 662 descr = "SoundHandler";
663 } 663 }
664 } 664 }
665 665
666 put_be32(pb, 0); /* size */ 666 put_be32(pb, 0); /* size */
667 put_tag(pb, "hdlr"); 667 put_tag(pb, "hdlr");
668 put_be32(pb, 0); /* Version & flags */ 668 put_be32(pb, 0); /* Version & flags */
1392 } 1392 }
1393 } 1393 }
1394 else if(enc->codec_id == CODEC_ID_PCM_ALAW) { 1394 else if(enc->codec_id == CODEC_ID_PCM_ALAW) {
1395 samplesInChunk = size/enc->channels; 1395 samplesInChunk = size/enc->channels;
1396 } 1396 }
1397 else if(enc->codec_id == CODEC_ID_PCM_S16BE || enc->codec_id == CODEC_ID_PCM_S16LE) { 1397 else if(enc->codec_id == CODEC_ID_PCM_S16BE || enc->codec_id == CODEC_ID_PCM_S16LE) {
1398 samplesInChunk = size/(2*enc->channels); 1398 samplesInChunk = size/(2*enc->channels);
1399 } 1399 }
1400 else { 1400 else {
1401 samplesInChunk = 1; 1401 samplesInChunk = 1;
1402 } 1402 }
1403 } 1403 }