Commit 763a902e authored by Tristan Matthews's avatar Tristan Matthews

opus: remove dead code

opus_prepare_header is "too small to fail"
parent 99343e4b
...@@ -611,14 +611,8 @@ static int OpenEncoder(vlc_object_t *p_this) ...@@ -611,14 +611,8 @@ static int OpenEncoder(vlc_object_t *p_this)
OpusHeader header; OpusHeader header;
if (opus_prepare_header(enc->fmt_out.audio.i_channels, opus_prepare_header(enc->fmt_out.audio.i_channels,
enc->fmt_out.audio.i_rate, enc->fmt_out.audio.i_rate, &header);
&header))
{
msg_Err(enc, "Failed to prepare header.");
status = VLC_ENOMEM;
goto error;
}
/* needed for max encoded size calculation */ /* needed for max encoded size calculation */
sys->nb_streams = header.nb_streams; sys->nb_streams = header.nb_streams;
......
...@@ -299,7 +299,7 @@ static int comment_pad(char **comments, size_t *length) ...@@ -299,7 +299,7 @@ static int comment_pad(char **comments, size_t *length)
return 0; 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->version = 1;
header->channels = channels; header->channels = channels;
...@@ -309,8 +309,6 @@ int opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header) ...@@ -309,8 +309,6 @@ int opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header)
header->gain = 0; // 0dB header->gain = 0; // 0dB
header->channel_mapping = header->channels > 8 ? 255 : header->channel_mapping = header->channels > 8 ? 255 :
header->channels > 2; header->channels > 2;
return 0;
} }
static int opus_header_to_packet(const OpusHeader *h, unsigned char *packet, int len) static int opus_header_to_packet(const OpusHeader *h, unsigned char *packet, int len)
......
...@@ -44,7 +44,7 @@ typedef struct { ...@@ -44,7 +44,7 @@ typedef struct {
} OpusHeader; } OpusHeader;
int opus_header_parse(const unsigned char *header, int len, OpusHeader *h); 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); int opus_write_header(uint8_t **p_extra, int *i_extra, OpusHeader *header, const char *vendor);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment