shithub: libopusenc

Download patch

ref: cae3f9c858ad7bd6fe82e8b8a3b07f2ab0204e4a
parent: abc0ed1b4b0732362ff83f2d75cae59d968a7308
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Sat Apr 29 17:40:50 EDT 2017

return values, setting framesize

--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -173,6 +173,7 @@
   if (! (ret == OPUS_OK && st != NULL) ) {
     goto fail;
   }
+  opus_multistream_encoder_ctl(st, OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_20_MS));
   enc->os_allocated = 0;
   enc->stream_is_init = 0;
   enc->comment = NULL;
@@ -301,7 +302,7 @@
     samples_per_channel -= curr;
     encode_buffer(enc);
   } while (samples_per_channel > 0);
-  return 0;
+  return OPE_OK;
 }
 
 /* Add/encode any number of int16 samples to the file. */
@@ -321,7 +322,7 @@
     samples_per_channel -= curr;
     encode_buffer(enc);
   } while (samples_per_channel > 0);
-  return 0;
+  return OPE_OK;
 }
 
 static void finalize_stream(OggOpusEnc *enc) {
@@ -340,7 +341,7 @@
 /* Ends the stream and create a new stream within the same file. */
 int ope_chain_current(OggOpusEnc *enc) {
   (void)enc;
-  return 0;
+  return OPE_UNIMPLEMENTED;
 }
 
 /* Ends the stream and create a new file. */
@@ -347,7 +348,7 @@
 int ope_continue_new_file(OggOpusEnc *enc, const char *path) {
   (void)enc;
   (void)path;
-  return 0;
+  return OPE_UNIMPLEMENTED;
 }
 
 /* Ends the stream and create a new file (callback-based). */
@@ -354,7 +355,7 @@
 int ope_continue_new_callbacks(OggOpusEnc *enc, void *user_data) {
   (void)enc;
   (void)user_data;
-  return 0;
+  return OPE_UNIMPLEMENTED;
 }
 
 /* Add a comment to the file (can only be called before encoding samples). */
@@ -374,7 +375,7 @@
 int ope_encoder_ctl(OggOpusEnc *enc, int request, ...) {
   (void)enc;
   (void)request;
-  return 0;
+  return OPE_UNIMPLEMENTED;
 }
 
 /* ctl()-type call for the OggOpus layer. */
@@ -381,5 +382,5 @@
 int ope_set_params(OggOpusEnc *enc, int request, ...) {
   (void)enc;
   (void)request;
-  return 0;
+  return OPE_UNIMPLEMENTED;
 }