Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: Help on use of DMX_OUT_TAP (II)
- To: jng_junk@greenmail.demon.co.uk
- Subject: [linux-dvb] Re: Help on use of DMX_OUT_TAP (II)
- From: Johannes Stezenbach <js@convergence.de>
- Date: Mon, 2 Jun 2003 13:07:31 +0200
- Cc: linux-dvb@linuxtv.org
- Content-disposition: inline
- Content-type: text/plain; charset=us-ascii
- In-reply-to: <Pine.LNX.4.44.0305312005310.6680-100000@greenmail.demon.co.uk>
- Mail-followup-to: Johannes Stezenbach <js@convergence.de>,jng_junk@greenmail.demon.co.uk, linux-dvb@linuxtv.org
- References: <Pine.LNX.4.44.0304251836060.2021-100000@greenmail.demon.co.uk> <Pine.LNX.4.44.0305312005310.6680-100000@greenmail.demon.co.uk>
- Sender: linux-dvb-bounce@linuxtv.org
- User-agent: Mutt/1.5.4i
jng_junk@greenmail.demon.co.uk wrote:
...
> if (type == DMX_PES_AUDIO) flags |= O_NONBLOCK;
...
> while (1) {
> int bytes;
>
> /* Video. */
> bytes = read(video_fd, buf, sizeof(buf));
> if (bytes < 0) {
> fprintf(stderr, "Errno %d: ", errno);
> perror("video_fd read");
> } else {
> fprintf(stderr, "Read %d bytes from video_fd.\n", bytes);
> }
>
> /* Audio. */
> bytes = read(audio_fd, buf, sizeof(buf));
> if (bytes < 0) {
> if (errno != EAGAIN) {
> fprintf(stderr, "Errno %d: ", errno);
> perror("audio_fd read");
> }
> } else {
> fprintf(stderr, "Read %d bytes from audio_fd.\n", bytes);
> }
> }
This can't work. You must use select() or poll() to wait for
data to arrive, then read() from the file descriptor which is ready.
Johannes
--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index