22 #include "libavutil/mathematics.h"
23 #include "libavcodec/avcodec.h"
28 #include "libavutil/avassert.h"
395 {
AV_CODEC_ID_AC3, {0x2C,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}},
396 {
AV_CODEC_ID_ATRAC3P, {0xBF,0xAA,0x23,0xE9,0x58,0xCB,0x71,0x44,0xA1,0x19,0xFF,0xFA,0x01,0xE4,0xCE,0x62}},
397 {
AV_CODEC_ID_EAC3, {0xAF,0x87,0xFB,0xA7,0x02,0x2D,0xFB,0x42,0xA4,0xD4,0x05,0xCD,0x93,0x84,0x3B,0xDD}},
398 {
AV_CODEC_ID_MP2, {0x2B,0x80,0x6D,0xE0,0x46,0xDB,0xCF,0x11,0xB4,0xD1,0x00,0x80,0x5F,0x6C,0xBB,0xEA}},
403 {
"IART",
"artist" },
404 {
"ICMT",
"comment" },
405 {
"ICOP",
"copyright" },
408 {
"ILNG",
"language" },
412 {
"ISFT",
"encoder" },
413 {
"ISMP",
"timecode" },
414 {
"ITCH",
"encoded_by"},
446 int waveformatextensible;
465 if (waveformatextensible) {
522 bytestream_put_le16(&riff_extradata, 1);
523 bytestream_put_le32(&riff_extradata, 2);
524 bytestream_put_le16(&riff_extradata, 1152);
525 bytestream_put_le16(&riff_extradata, 1);
526 bytestream_put_le16(&riff_extradata, 1393);
529 bytestream_put_le16(&riff_extradata, 2);
530 bytestream_put_le32(&riff_extradata, enc->
bit_rate);
531 bytestream_put_le16(&riff_extradata, enc->
channels == 2 ? 1 : 8);
532 bytestream_put_le16(&riff_extradata, 0);
533 bytestream_put_le16(&riff_extradata, 1);
534 bytestream_put_le16(&riff_extradata, 16);
535 bytestream_put_le32(&riff_extradata, 0);
536 bytestream_put_le32(&riff_extradata, 0);
539 bytestream_put_le32(&riff_extradata, 0x9ace0002);
540 bytestream_put_le32(&riff_extradata, 0xaea2f732);
541 bytestream_put_le16(&riff_extradata, 0xacde);
544 bytestream_put_le16(&riff_extradata, frame_size);
550 if(waveformatextensible) {
552 avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
560 avio_wl16(pb, riff_extradata - riff_extradata_start);
562 avio_write(pb, riff_extradata_start, riff_extradata - riff_extradata_start);
589 if (!ignore_extradata) {
600 int audio_frame_size;
606 if (!audio_frame_size)
611 *au_scale = audio_frame_size;
622 gcd=
av_gcd(*au_scale, *au_rate);
629 int len = strlen(str);
640 static const char riff_tags[][5] = {
641 "IARL",
"IART",
"ICMS",
"ICMT",
"ICOP",
"ICRD",
"ICRP",
"IDIM",
"IDPI",
642 "IENG",
"IGNR",
"IKEY",
"ILGT",
"ILNG",
"IMED",
"INAM",
"IPLT",
"IPRD",
643 "IPRT",
"ISBJ",
"ISFT",
"ISHP",
"ISMP",
"ISRC",
"ISRF",
"ITCH",
651 for (i = 0; *riff_tags[i]; i++) {
669 if (!riff_has_valid_tags(s))
674 for (i = 0; *riff_tags[i]; i++) {
680 #endif //CONFIG_MUXERS
713 cbSize =
FFMIN(size, cbSize);
714 if (cbSize >= 22 &&
id == 0xfffe) {
797 if (
avio_read(s, *g,
sizeof(*g)) < (
int)
sizeof(*g))
798 memset(*g, 0,
sizeof(*g));
813 int64_t start,
end, cur;
819 while ((cur =
avio_tell(pb)) >= 0 && cur <= end - 8 ) {
828 if (chunk_code || chunk_size) {
834 if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
838 if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
844 chunk_size += (chunk_size & 1);
860 if (
avio_read(pb, value, chunk_size) != chunk_size) {
869 #endif // CONFIG_DEMUXERS