42 #define RF64_AUTO (-1)
59 static inline void bwf_write_bext_string(
AVFormatContext *s,
const char *key,
int maxlen)
65 len = strlen(tag->
value);
66 len =
FFMIN(len, maxlen);
76 uint64_t time_reference = 0;
79 bwf_write_bext_string(s,
"description", 256);
80 bwf_write_bext_string(s,
"originator", 32);
81 bwf_write_bext_string(s,
"originator_reference", 32);
82 bwf_write_bext_string(s,
"origination_date", 10);
83 bwf_write_bext_string(s,
"origination_time", 8);
86 time_reference = strtoll(tmp_tag->
value,
NULL, 10);
91 unsigned char umidpart_str[17] = {0};
96 for (i = 0; i < len/16; i++) {
97 memcpy(umidpart_str, tmp_tag->
value + 2 + (i*16), 16);
98 umidpart = strtoll(umidpart_str,
NULL, 16);
154 bwf_write_bext_chunk(s);
189 int64_t file_size, data_size;
190 int64_t number_of_samples = 0;
198 data_size = file_size - wav->
data;
203 avio_wl32(pb, (uint32_t)(file_size - 8));
217 if (rf64 || (wav->
rf64 ==
RF64_AUTO && number_of_samples > UINT32_MAX)) {
253 #define OFFSET(x) offsetof(WAVMuxContext, x)
254 #define ENC AV_OPT_FLAG_ENCODING_PARAM
264 static const AVClass wav_muxer_class = {
274 .mime_type =
"audio/x-wav",
284 .priv_class = &wav_muxer_class,
299 static void end_guid(
AVIOContext *pb, int64_t start)
347 end_guid(pb, wav->
data);
354 int64_t number_of_samples;