From patchwork Tue Aug 2 16:39:03 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Huelswitt X-Patchwork-Id: 11962 Received: from wp012.webpack.hosteurope.de ([80.237.132.19]) by www.linuxtv.org with esmtp (Exim 4.34) id 1Dzzpe-0003cJ-PE for vdr@linuxtv.org; Tue, 02 Aug 2005 18:41:34 +0200 Received: by wp012.webpack.hosteurope.de running Exim 4.43 using esmtpsa (TLSv1:DES-CBC3-SHA:168) from ip102.53.1411d-cud12k-02.ish.de ([62.143.53.102] helo=video.local.muempf.de) id 1DzzpJ-0002nS-FU; Tue, 02 Aug 2005 18:41:13 +0200 Received: from video.local.muempf.de (localhost [127.0.0.1]) by video.local.muempf.de (8.12.6/8.12.6/SuSE Linux 0.6) with ESMTP id j72Gd3VV012485 for ; Tue, 2 Aug 2005 18:39:03 +0200 Received: (from news@localhost) by video.local.muempf.de (8.12.6/8.12.6/Submit) id j72Gd3WC012484 for vdr@linuxtv.org; Tue, 2 Aug 2005 18:39:03 +0200 To: vdr@linuxtv.org Path: not-for-mail From: s.huelswitt@gmx.de (Stefan Huelswitt) Newsgroups: local.linux.vdr Subject: Re: [vdr] MP3/MPlayer plugin 0.9.13 available Date: Tue, 2 Aug 2005 16:39:03 +0000 (UTC) Organization: Home, sweet home Lines: 62 Sender: nathan@gmx.de Message-ID: References: NNTP-Posting-Host: master.local.muempf.de Mime-Version: 1.0 X-Trace: video.local.muempf.de 1123000743 5004 192.168.1.1 (2 Aug 2005 16:39:03 GMT) X-Complaints-To: s.huelswitt@gmx.de NNTP-Posting-Date: Tue, 2 Aug 2005 16:39:03 +0000 (UTC) X-Newsreader: knews 1.0b.1 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2005 16:41:34 -0000 Status: O X-Status: X-Keywords: X-UID: 3899 Hi, appearently there are some problems with OSS replay. In some cases VDR hangs for 5-6 seconds when skipping between songs. I think I found a solution, but due to the great variety of OSS drivers, this has to be tested with as much drivers as possible. So if you're using OSS, please test the attached patch and report any failure/weirdness. Regards. diff -urN -X mp3-unstable/.exclude mp3-0.9.13/player-mp3.c mp3-unstable/player-mp3.c --- mp3-0.9.13/player-mp3.c 2005-07-30 14:33:50.000000000 +0200 +++ mp3-unstable/player-mp3.c 2005-08-01 21:47:25.000000000 +0200 @@ -1391,7 +1391,7 @@ void cOutputOss::Init(void) { if(fd<0) { - fd=open(dspdevice,O_WRONLY); + fd=open(dspdevice,O_WRONLY|O_NONBLOCK); if(fd>=0) poll.Add(fd,true); else esyslog("ERROR: Cannot open dsp device '%s': %s!",dspdevice,strerror(errno)); } @@ -1453,15 +1453,19 @@ int cOutputOss::Output(const unsigned char *Data, int Len, bool SOF) { - int n=0; - if(SOF) { - struct FrameHeader *fh=(struct FrameHeader *)Data; - if(fh->samplerate!=outSr) Reset(fh->samplerate); - n=FHS; - Data+=n; Len-=n; + if(fd>=0) { + int n=0; + if(SOF) { + struct FrameHeader *fh=(struct FrameHeader *)Data; + if(fh->samplerate!=outSr) Reset(fh->samplerate); + n=FHS; + Data+=n; Len-=n; + } + int r=write(fd,Data,Len); + if(r<0 && !FATALERRNO) r=0; + if(r>=0) return n+r; } - int r=fd>=0 ? write(fd,Data,Len) : -1; - return (r>=0 ? r+n : -1); + return -1; } bool cOutputOss::Poll(void)