From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Another asinine question Date: Wed, 17 May 2006 15:26:20 +0200 Message-ID: References: <4464A474.6070604@instant.com.br> <4469E2B2.4040800@instant.com.br> <4469FDA7.2090105@instant.com.br> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <4469FDA7.2090105@instant.com.br> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Juan Carlos Castro y Castro Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Tue, 16 May 2006 13:28:23 -0300, Juan Carlos Castro y Castro wrote: > > Takashi Iwai wrote: > > >Juan Carlos Castro y Castro wrote: > > > > > >>By the way, my pcm_file extensions DO work! It's the "plug" plugin > >>that's not passing the reads! Stay tuned... > >> > >> > >Great, feel free to submit the patches to alsa-devel ML (Cc to me). > > > Your wish is my command, Takashi-san. ;) > > Note the interleaved read has not yet been implemented. Also, I'm not > yet dealing with blocking versus non-blocking at the moment. When > reading from a file, read()'s just keep getting zero bytes and arecord > doesn't mind. Some deal of sophistication will have to be added. That's OK. We can extend the feature later. > Another thing: you'll see I just "hung" another snd_pcm_file_t structure > at the bottom of the original one. I'll understand if that offends > people's coding sensibilities -- it offended mine. :-/ Does't only one file descriptor instead of the whole snd_pcm_file struct suffice? Actually, it's used only in readi(). > @@ -377,11 +403,11 @@ static snd_pcm_fast_ops_t snd_pcm_file_f > * changed in future. > */ > int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, > - const char *fname, int fd, const char *fmt, int perm, > - snd_pcm_t *slave, int close_slave) > + const char *fname, int fd, const char *ifname, int ifd, > + const char *fmt, int perm, snd_pcm_t *slave, int close_slave) Don't forget to change the doxygen comment for this function. > @@ -405,7 +431,34 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, > close(fd); > return -ENOMEM; > } > - > + > + if (ifname) { > + ifd = open(ifname, O_RDONLY); > + if (ifd < 0) { > + SYSERR("open %s for reading failed", ifname); > + if (fname) > + close(fd); > + return -errno; > + } > + } > + if (ifd) { Should be "if (ifd >= 0)". Also, please make a patch against the latest HG repository. The typo in readn() was already fixed, so your last patch conflicts with the latest tree. Thanks, Takashi ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642