Bug 1410456 - remove get latency implementation because makes use of dlopen. r?padenot draft
authorAlex Chronopoulos <achronop@gmail.com>
Tue, 20 Feb 2018 15:37:10 +0200
changeset 758413 4e01e474ce0adc76ed55077cc6c79c79c82b6028
parent 758412 b9199006217c2ef36291fff18c2f4fb09af95b06
child 758414 599f1cec68c592e0cd33a82ebd8e32b32bf198b6
push id100043
push userachronop@gmail.com
push dateThu, 22 Feb 2018 11:35:08 +0000
reviewerspadenot
bugs1410456
milestone60.0a1
Bug 1410456 - remove get latency implementation because makes use of dlopen. r?padenot MozReview-Commit-ID: 1Mc2dSk0hlc
media/libcubeb/src/cubeb_opensl.c
--- a/media/libcubeb/src/cubeb_opensl.c
+++ b/media/libcubeb/src/cubeb_opensl.c
@@ -1577,34 +1577,16 @@ opensl_stream_get_position(cubeb_stream 
       unadjusted_position : maximum_position;
   } else {
     *position = 0;
   }
   return CUBEB_OK;
 }
 
 int
-opensl_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
-{
-  int r;
-  uint32_t mixer_latency; // The latency returned by AudioFlinger is in ms.
-
-  /* audio_stream_type_t is an int, so this is okay. */
-  r = stm->context->get_output_latency(&mixer_latency, AUDIO_STREAM_TYPE_MUSIC);
-  if (r) {
-    return CUBEB_ERROR;
-  }
-
-  *latency = stm->latency_frames + // OpenSL latency
-    mixer_latency * stm->inputrate / 1000; // AudioFlinger latency
-
-  return CUBEB_OK;
-}
-
-int
 opensl_stream_set_volume(cubeb_stream * stm, float volume)
 {
   SLresult res;
   SLmillibel max_level, millibels;
   float unclamped_millibels;
 
   res = (*stm->volume)->GetMaxVolumeLevel(stm->volume, &max_level);
 
@@ -1641,16 +1623,16 @@ static struct cubeb_ops const opensl_ops
   .device_collection_destroy = NULL,
   .destroy = opensl_destroy,
   .stream_init = opensl_stream_init,
   .stream_destroy = opensl_stream_destroy,
   .stream_start = opensl_stream_start,
   .stream_stop = opensl_stream_stop,
   .stream_reset_default_device = NULL,
   .stream_get_position = opensl_stream_get_position,
-  .stream_get_latency = opensl_stream_get_latency,
+  .stream_get_latency = NULL,
   .stream_set_volume = opensl_stream_set_volume,
   .stream_set_panning = NULL,
   .stream_get_current_device = NULL,
   .stream_device_destroy = NULL,
   .stream_register_device_changed_callback = NULL,
   .register_device_collection_changed = NULL
 };