[EMAIL PROTECTED] 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 [EMAIL PROTECTED] with "unsubscribe linux-dvb" as
subject.