[MPlayer-dev-eng] [PATCH] v4l2: remove capture dependence on audioset

Jesse Allen the3dfxdude at gmail.com
Tue Feb 21 07:52:52 CET 2006


Hi,

There is one more dependence on audioset that needs to be fixed.  This
case affects whether or not audio is recorded in mencoder.  My changes
are based on reading the API description here:
http://v4l2spec.bytesex.org/spec/x268.htm

"Radio devices have no audio inputs or outputs. They have exactly one
tuner which in fact is an audio source, but this API associates tuners
with video inputs or outputs only, and radio devices have none of these.
A connector on a TV card to loop back the received audio signal to a
sound card is not considered an audio output."

The problem is bttv no longer sets the audioset field, and mplayer
probably wrongly depended on it to test for audio support.  There
are two cases where there is an audio source while not having audioset
be set, 1) radio, 2) or having a loopback.  Since based on description,
we could guess that there is an audio source if we have a tuner.  So
this patch changes it to say we have an audio device if we have a tuner.
I've tested and it works.  If not applied, the "forceaudio" option is
required to capture sound.

Changes:
If we have a tuner, use that as a reason we have audio support, and do
not depend on audioset.


--- mplayer-orig/libmpdemux/tvi_v4l2.c	2006-02-19 16:32:58.000000000 -0700
+++ mplayer/libmpdemux/tvi_v4l2.c	2006-02-20 22:47:27.000000000 -0700
@@ -545,12 +545,11 @@ static int control(priv_t *priv, int cmd
     struct v4l2_frequency frequency;
 
     switch(cmd) {
-    case TVI_CONTROL_IS_AUDIO:
-	if (tv_param_force_audio) return TVI_CONTROL_TRUE;
-	return priv->input.audioset ? TVI_CONTROL_TRUE: TVI_CONTROL_FALSE;
     case TVI_CONTROL_IS_VIDEO:
 	return priv->capability.capabilities & V4L2_CAP_VIDEO_CAPTURE?
 	    TVI_CONTROL_TRUE: TVI_CONTROL_FALSE;
+    case TVI_CONTROL_IS_AUDIO:
+	if (tv_param_force_audio) return TVI_CONTROL_TRUE;
     case TVI_CONTROL_IS_TUNER:
 	return priv->capability.capabilities & V4L2_CAP_TUNER?
 	    TVI_CONTROL_TRUE: TVI_CONTROL_FALSE;




More information about the MPlayer-dev-eng mailing list