V4L/DVB (11395): cx88: audio thread: if stereo detection is hw supported don't do...
authorMarton Balint <cus@fazekas.hu>
Tue, 31 Mar 2009 22:01:52 +0000 (19:01 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 22:14:18 +0000 (19:14 -0300)
commit083d6f8c81e9a2bd5f71633fb38acda35fb8240c
treeb0fcd81a333b89d8a2b30b1cd049a1877fb8807c
parente878cf3a47a5d99635edc564423a9a4469c17810
V4L/DVB (11395): cx88: audio thread: if stereo detection is hw supported don't do it manually

The sole purpose of the audio thread is to detect if stereo transmission is
available, and if it is, then switch to stereo mode (and switch back, if it's
no longer available). This manual autodetection is useful for some audio
standards (e.g. A2) where cx88_get_stereo CAN detect stereo sound, but the
cx2388x chip CANNOT auto-detect stereo sound.

However, for other audio standards, the cx2388x chip CAN auto-detect the stereo
sound, so the manual autodetection in the audio thread is not needed. In fact,
it can cause serious problems because for some of these audio standards,
cx88_get_stereo CANNOT detect the presence of stereo sound.  Besides that, if
the hardware automatically detects stereo/mono sound, you cannot set
core->audiomode_current to the real current audio mode on channel change.

With this patch, the manual autodetection is only used if audiomode_current is
known after a channel change (because of the initial mono mode), and
hardware-based stereo autodetecion is not applicable for the current audio
standard.

Signed-off-by: Marton Balint <cus@fazekas.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx88/cx88-tvaudio.c