comparison vorbis_enc.c @ 10326:b10c3bc8ea3e libavcodec

Use ff_put_string in vorbis encoder.
author reimar
date Wed, 30 Sep 2009 10:37:37 +0000
parents 7bfcc66f807d
children 5462710f17ee
comparison
equal deleted inserted replaced
10325:36b60aa6bc75 10326:b10c3bc8ea3e
528 int len, hlens[3]; 528 int len, hlens[3];
529 529
530 // identification header 530 // identification header
531 init_put_bits(&pb, p, buffer_len); 531 init_put_bits(&pb, p, buffer_len);
532 put_bits(&pb, 8, 1); //magic 532 put_bits(&pb, 8, 1); //magic
533 for (i = 0; "vorbis"[i]; i++) 533 ff_put_string(&pb, "vorbis", 0);
534 put_bits(&pb, 8, "vorbis"[i]);
535 put_bits(&pb, 32, 0); // version 534 put_bits(&pb, 32, 0); // version
536 put_bits(&pb, 8, venc->channels); 535 put_bits(&pb, 8, venc->channels);
537 put_bits(&pb, 32, venc->sample_rate); 536 put_bits(&pb, 32, venc->sample_rate);
538 put_bits(&pb, 32, 0); // bitrate 537 put_bits(&pb, 32, 0); // bitrate
539 put_bits(&pb, 32, 0); // bitrate 538 put_bits(&pb, 32, 0); // bitrate
548 p += hlens[0]; 547 p += hlens[0];
549 548
550 // comment header 549 // comment header
551 init_put_bits(&pb, p, buffer_len); 550 init_put_bits(&pb, p, buffer_len);
552 put_bits(&pb, 8, 3); //magic 551 put_bits(&pb, 8, 3); //magic
553 for (i = 0; "vorbis"[i]; i++) 552 ff_put_string(&pb, "vorbis", 0);
554 put_bits(&pb, 8, "vorbis"[i]);
555 put_bits(&pb, 32, 0); // vendor length TODO 553 put_bits(&pb, 32, 0); // vendor length TODO
556 put_bits(&pb, 32, 0); // amount of comments 554 put_bits(&pb, 32, 0); // amount of comments
557 put_bits(&pb, 1, 1); // framing 555 put_bits(&pb, 1, 1); // framing
558 556
559 flush_put_bits(&pb); 557 flush_put_bits(&pb);
562 p += hlens[1]; 560 p += hlens[1];
563 561
564 // setup header 562 // setup header
565 init_put_bits(&pb, p, buffer_len); 563 init_put_bits(&pb, p, buffer_len);
566 put_bits(&pb, 8, 5); //magic 564 put_bits(&pb, 8, 5); //magic
567 for (i = 0; "vorbis"[i]; i++) 565 ff_put_string(&pb, "vorbis", 0);
568 put_bits(&pb, 8, "vorbis"[i]);
569 566
570 // codebooks 567 // codebooks
571 put_bits(&pb, 8, venc->ncodebooks - 1); 568 put_bits(&pb, 8, venc->ncodebooks - 1);
572 for (i = 0; i < venc->ncodebooks; i++) 569 for (i = 0; i < venc->ncodebooks; i++)
573 put_codebook_header(&pb, &venc->codebooks[i]); 570 put_codebook_header(&pb, &venc->codebooks[i]);