Loading hal/audio_hw.c +24 −10 Original line number Diff line number Diff line Loading @@ -1422,9 +1422,22 @@ static int out_get_presentation_position(const struct audio_stream_out *stream, { struct stream_out *out = (struct stream_out *)stream; int ret = -1; unsigned long dsp_frames; pthread_mutex_lock(&out->lock); if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { if (out->compr != NULL) { compress_get_tstamp(out->compr, &dsp_frames, &out->sample_rate); ALOGVV("%s rendered frames %ld sample_rate %d", __func__, dsp_frames, out->sample_rate); *frames = dsp_frames; ret = 0; /* this is the best we can do */ clock_gettime(CLOCK_MONOTONIC, timestamp); } } else { if (out->pcm) { size_t avail; if (pcm_get_htimestamp(out->pcm, &avail, timestamp) == 0) { Loading @@ -1438,6 +1451,7 @@ static int out_get_presentation_position(const struct audio_stream_out *stream, } } } } pthread_mutex_unlock(&out->lock); Loading Loading
hal/audio_hw.c +24 −10 Original line number Diff line number Diff line Loading @@ -1422,9 +1422,22 @@ static int out_get_presentation_position(const struct audio_stream_out *stream, { struct stream_out *out = (struct stream_out *)stream; int ret = -1; unsigned long dsp_frames; pthread_mutex_lock(&out->lock); if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { if (out->compr != NULL) { compress_get_tstamp(out->compr, &dsp_frames, &out->sample_rate); ALOGVV("%s rendered frames %ld sample_rate %d", __func__, dsp_frames, out->sample_rate); *frames = dsp_frames; ret = 0; /* this is the best we can do */ clock_gettime(CLOCK_MONOTONIC, timestamp); } } else { if (out->pcm) { size_t avail; if (pcm_get_htimestamp(out->pcm, &avail, timestamp) == 0) { Loading @@ -1438,6 +1451,7 @@ static int out_get_presentation_position(const struct audio_stream_out *stream, } } } } pthread_mutex_unlock(&out->lock); Loading