OpusHeader header;
- if (opus_prepare_header(enc->fmt_out.audio.i_channels,
- enc->fmt_out.audio.i_rate,
- &header))
- {
- msg_Err(enc, "Failed to prepare header.");
- status = VLC_ENOMEM;
- goto error;
- }
+ opus_prepare_header(enc->fmt_out.audio.i_channels,
+ enc->fmt_out.audio.i_rate, &header);
/* needed for max encoded size calculation */
sys->nb_streams = header.nb_streams;
return 0;
}
-int opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header)
+void opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header)
{
header->version = 1;
header->channels = channels;
header->gain = 0; // 0dB
header->channel_mapping = header->channels > 8 ? 255 :
header->channels > 2;
-
- return 0;
}
static int opus_header_to_packet(const OpusHeader *h, unsigned char *packet, int len)
} OpusHeader;
int opus_header_parse(const unsigned char *header, int len, OpusHeader *h);
-int opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header);
+void opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header);
int opus_write_header(uint8_t **p_extra, int *i_extra, OpusHeader *header, const char *vendor);
#endif