audio: DTV mpeg audio abnormal [1/1]

PD#SWPL-187381

Problem:
Loudness has repeatedly processed the sound.

Solution:
Modify loudness proccessing flow.

Verify:
yocto-t5w

Change-Id: Ie8603192d5f4011eba4008be901ac49363aea110
Signed-off-by: yayun.shi <yayun.shi@amlogic.com>
diff --git a/audio_hal/aml_audio_ms12_render.c b/audio_hal/aml_audio_ms12_render.c
index 8799c44..54d9579 100644
--- a/audio_hal/aml_audio_ms12_render.c
+++ b/audio_hal/aml_audio_ms12_render.c
@@ -84,6 +84,7 @@
     {
         /*begin to write, clear the total write*/
         total_write = 0;
+        audio_input_loudness_control(aml_out, abuffer->buffer, abuffer->size);
 re_write:
         if (adev->debug_flag > 1) {
             ALOGI("%s dolby_ms12_main_process before write_bytes %d, pts %"PRIu64"!\n", __func__, write_bytes, abuffer->pts);
diff --git a/audio_hal/audio_hw_ms12_v2.c b/audio_hal/audio_hw_ms12_v2.c
index c675105..66289e9 100644
--- a/audio_hal/audio_hw_ms12_v2.c
+++ b/audio_hal/audio_hw_ms12_v2.c
@@ -1450,7 +1450,6 @@
 #endif
 
 MAIN_INPUT:
-        audio_input_loudness_control(aml_out, main_frame_buffer, main_frame_size);
         if (main_frame_buffer && (main_frame_size > 0)) {
             /*we check whether there is enough space*/
             if ((adev->continuous_audio_mode == 1)
diff --git a/audio_hal/audio_hw_ms12_v2.h b/audio_hal/audio_hw_ms12_v2.h
index ff1186f..82f3033 100644
--- a/audio_hal/audio_hw_ms12_v2.h
+++ b/audio_hal/audio_hw_ms12_v2.h
@@ -366,6 +366,7 @@
 
 int aml_dap_close(struct dolby_ms12_desc *ms12);
 int dolby_ms12_desc_init(struct aml_audio_device *adev);
+int audio_input_loudness_control (struct aml_stream_out *aml_out, void *buffer, size_t bytes);
 
 int aml_dap_process(
     struct audio_stream_out *stream