+static int opus_get_header_callback(ogg_packet *packet, int packet_num,
+ int serial, __a_unused struct afh_info *afhi, void *private_data)
+{
+ struct oac_custom_header *h = private_data;
+ int ret;
+ static unsigned char dummy_tags[] = { /* a minimal comment header */
+ 'O', 'p', 'u', 's', 'T', 'a', 'g', 's',
+ 0x06, 0x00, 0x00, 0x00, /* vendor string length */
+ 'd', 'u', 'm', 'm', 'y', '\0', /* vendor string */
+ 0x00, 0x00, 0x00, 0x00, /* user comment list length */
+ };
+ ogg_packet replacement;
+
+ if (packet_num == 0) {
+ oac_custom_header_init(serial, h);
+ ret = oac_custom_header_append(packet, h);
+ if (ret < 0)
+ return ret;
+ oac_custom_header_flush(h);
+ return 1;
+ }
+ assert(packet_num == 1);
+ PARA_INFO_LOG("replacing metadata packet\n");
+ replacement = *packet;
+ replacement.packet = dummy_tags;
+ replacement.bytes = sizeof(dummy_tags);
+ ret = oac_custom_header_append(&replacement, h);
+ if (ret < 0)
+ return ret;
+ oac_custom_header_flush(h);
+ return 0;
+}
+
+static void opus_get_header(void *map, size_t mapsize, char **buf,
+ size_t *len)