]> git.sesse.net Git - vlc/commitdiff
opus: remove dead code
authorTristan Matthews <tmatth@videolan.org>
Mon, 12 Jan 2015 18:01:24 +0000 (13:01 -0500)
committerTristan Matthews <tmatth@videolan.org>
Mon, 12 Jan 2015 22:14:02 +0000 (17:14 -0500)
opus_prepare_header is "too small to fail"

modules/codec/opus.c
modules/codec/opus_header.c
modules/codec/opus_header.h

index 1eb885ef26bc9342ce27860eff2a2c185bcad288..1e93cd4da1e43fd60bc67e77da09c32980c8438d 100644 (file)
@@ -611,14 +611,8 @@ static int OpenEncoder(vlc_object_t *p_this)
 
     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;
index 101a33da61759184374e7af2c8197011bbec9e9d..392b673b2b1368f333ceb3d25691f80568c2ffc8 100644 (file)
@@ -299,7 +299,7 @@ static int comment_pad(char **comments, size_t *length)
     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;
@@ -309,8 +309,6 @@ int opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header)
     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)
index a4c1f16d3416200d13b539d4c557837c24fc7ad2..4b6a4e5d3c6f2491e8050bf540a6e7b19fe906de 100644 (file)
@@ -44,7 +44,7 @@ typedef struct {
 } 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