[MPlayer-dev-eng] [patch] audio too high on saa7134

Josef Zlomek josef.zlomek at email.cz
Sun Jan 11 13:40:40 CET 2004


> >I have a problem with mencoder 1.0pre3 and saa7134 using oss.
> >When recording from tv, the audio is too high (too fast).
> >I discovered using program "record" that the samplerate of audio is 32000 
> >Hz
> >but mencoder detects 44100 Hz. The result is that the audio is too high.
> >I analyzed it further and found a bug in mencoder.
> >The problem is that when we are setting the samplerate kernel returns
> >a value different to value we wanted.
> 
> Thanks, committed.

Thanks for commiting.
There are similar occurences of the problem but they do not cause a wrong audio
input for me because my card supports 2 channels.

Josef

Index: libmpdemux/ai_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/ai_oss.c,v
retrieving revision 1.7
diff -u -p -r1.7 ai_oss.c
--- libmpdemux/ai_oss.c	11 Jan 2004 10:01:18 -0000	1.7
+++ libmpdemux/ai_oss.c	11 Jan 2004 12:39:58 -0000
@@ -46,6 +46,7 @@ int ai_oss_set_channels(audio_in_t *ai)
 		   ai->req_channels);
 	    return -1;
 	}
+	ai->channels = ioctl_param;
     }
     else
     {
@@ -58,8 +59,8 @@ int ai_oss_set_channels(audio_in_t *ai)
 		   ai->req_channels == 2);
 	    return -1;
 	}
+	ai->channels = ioctl_param ? 2 : 1;
     }
-    ai->channels = ai->req_channels;
     return 0;
 }
 
@@ -102,7 +103,7 @@ int ai_oss_init(audio_in_t *ai)
 	       ai->req_samplerate);
 	return -1;
     }
-    ai->samplerate = ai->req_samplerate;
+    ai->samplerate = ioctl_param;
 
     mp_msg(MSGT_TV, MSGL_V, "ioctl dsp trigger: %d\n",
 	   ioctl(ai->oss.audio_fd, SNDCTL_DSP_GETTRIGGER, &ioctl_param));




More information about the MPlayer-dev-eng mailing list