This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/tvtime.git tree:

Subject: mute: Delay unmute on signal lock to give msp3400 time to sync
Author:  Hans de Goede <[email protected]>
Date:    Sat Feb 13 16:47:27 2016 -0200

Delay unmute on signal lock, this fixes a loud plop sound on changing
channels on cards with a msp3400 stereo sound decoder.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 src/videoinput.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/tvtime.git/commit/?id=57ceea15a660dee0e15f7da5701ae7f49efefe28
diff --git a/src/videoinput.c b/src/videoinput.c
index 11decd816602..2650ac7285fb 100644
--- a/src/videoinput.c
+++ b/src/videoinput.c
@@ -123,6 +123,12 @@ int videoinput_get_time_per_field( int norm )
     }
 }
 
+static int videoinput_get_unmute_delay( int norm )
+{
+    /* The msp3400 needs some time before it provides stable audio */
+    return 400000 / videoinput_get_time_per_field( norm );
+}
+
 typedef struct capture_buffer_s
 {
     struct v4l2_buffer vidbuf;
@@ -158,6 +164,7 @@ struct videoinput_s
     int hasaudio;
     int audiomode;
     int change_muted;
+    int change_muted_delay;
     int user_muted;
     int hw_muted;
 
@@ -360,6 +367,7 @@ videoinput_t *videoinput_new( config_t *cfg, int norm, int 
verbose,
     vidin->signal_recover_wait = 0;
     vidin->signal_acquire_wait = 0;
     vidin->change_muted = 1;
+    vidin->change_muted_delay = videoinput_get_unmute_delay( norm );
     vidin->user_muted = user_muted;
     vidin->hw_muted = 1;
     vidin->hasaudio = 1;
@@ -752,6 +760,7 @@ void videoinput_set_tuner_freq( videoinput_t *vidin, int 
freqKHz )
        }
 
        vidin->change_muted = 1;
+       vidin->change_muted_delay = videoinput_get_unmute_delay( vidin->norm );
        videoinput_do_mute( vidin );
        vidin->cur_tuner_state = TUNER_STATE_SIGNAL_DETECTED;
        vidin->signal_acquire_wait = SIGNAL_ACQUIRE_DELAY;
@@ -918,10 +927,10 @@ int videoinput_check_for_signal( videoinput_t *vidin, int 
check_freq_present )
                 vidin->signal_acquire_wait--;
                 break;
             } else {
-                vidin->cur_tuner_state = TUNER_STATE_HAS_SIGNAL;
-            }
+               vidin->cur_tuner_state = TUNER_STATE_HAS_SIGNAL;
+           }
        default:
-           if( vidin->change_muted ) {
+           if( vidin->change_muted && --vidin->change_muted_delay == 0 ) {
                vidin->change_muted = 0;
                videoinput_do_mute( vidin );
            }
@@ -934,6 +943,7 @@ int videoinput_check_for_signal( videoinput_t *vidin, int 
check_freq_present )
            vidin->cur_tuner_state = TUNER_STATE_SIGNAL_LOST;
            vidin->signal_recover_wait = SIGNAL_RECOVER_DELAY;
            vidin->change_muted = 1;
+           vidin->change_muted_delay = videoinput_get_unmute_delay( 
vidin->norm );
            videoinput_do_mute( vidin );
        case TUNER_STATE_SIGNAL_LOST:
            if( vidin->signal_recover_wait ) {

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to