summaryrefslogtreecommitdiff
authorJian Xu <jian.xu@amlogic.com>2016-11-30 11:01:40 (GMT)
committer Jian Xu <jian.xu@amlogic.com>2016-11-30 11:01:40 (GMT)
commit2fb4ea7b1fd6843aba146fe24d531552f3d6c539 (patch)
tree1aeeaae3c470a68d489169795723d4417fd83bc0
parent2c0e3f90cf59681a7587b02acb3ccdb46d68b438 (diff)
downloadaudio-2fb4ea7b1fd6843aba146fe24d531552f3d6c539.zip
audio-2fb4ea7b1fd6843aba146fe24d531552f3d6c539.tar.gz
audio-2fb4ea7b1fd6843aba146fe24d531552f3d6c539.tar.bz2
PD#132693: audio: fix CTS testVariableSpeedPlayback fail issue
Change-Id: I92a56de3e4511f73ba228562550f6f4f3133db2e
Diffstat
-rw-r--r--audio_hw.c8
-rw-r--r--audio_hw.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/audio_hw.c b/audio_hw.c
index db95600..f805e43 100644
--- a/audio_hw.c
+++ b/audio_hw.c
@@ -1576,11 +1576,12 @@ static ssize_t out_write_legacy(struct audio_stream_out *stream, const void* buf
#endif
#if 1
codec_type = get_sysfs_int("/sys/class/audiodsp/digital_codec");
- samesource_flag = get_sysfs_int("/sys/class/audiodsp/audio_samesource");
- if (samesource_flag == 0 && codec_type == 0) {
+ //samesource_flag = get_sysfs_int("/sys/class/audiodsp/audio_samesource");
+ if (codec_type != out->last_codec_type/*samesource_flag == 0*/ && codec_type == 0) {
ALOGI("to enable same source,need reset alsa,type %d,same source flag %d \n", codec_type, samesource_flag);
pcm_stop(out->pcm);
}
+ out->last_codec_type = codec_type;
#endif
if (out->is_tv_platform == 1) {
int16_t *tmp_buffer = (int16_t *)out->audioeffect_tmp_buffer;
@@ -2431,7 +2432,7 @@ static int out_get_render_position(const struct audio_stream_out *stream,
struct aml_stream_out *out = (struct aml_stream_out *)stream;
*dsp_frames = out->last_frames_postion;
-
+ ALOGV("out_get_render_position %d\n", *dsp_frames);
return 0;
}
@@ -2462,6 +2463,7 @@ static int out_get_presentation_position(const struct audio_stream_out *stream,
if (timestamp != NULL) {
clock_gettime(CLOCK_MONOTONIC, timestamp);
}
+ ALOGV("out_get_presentation_position %lld\n", *frames);
return 0;
}
diff --git a/audio_hw.h b/audio_hw.h
index 890f8b1..23b77b3 100644
--- a/audio_hw.h
+++ b/audio_hw.h
@@ -130,6 +130,7 @@ struct aml_stream_out {
int has_aml_IIR_lib;
float volume_l;
float volume_r;
+ int last_codec_type;
};
#define MAX_PREPROCESSORS 3 /* maximum one AGC + one NS + one AEC per input stream */