I see a very weird problem when reading from an analog capture card with MPEG 
encoder using libevent 1.4 and an EV_READ callback function (persistent mode).
Actually so far I used the same code for reading from a dvb dvr device, which 
always worked very well. Now with the /dev/video I loose parts of the data, it 
seems as if the dvr_read function is not always called when data comes in. Or 
it's called too late, so that the device driver might have to drop data due to 
buffer underruns.

I inspected the polling behaviour of the device and figured that it works well 
to read from the device with a polling loop like this:
while(running) {
    if(poll(&poll, 1, 500) > 0) {
       do {
         len = read(fd, &buf[0], 188);
         if(len < 188 && len > 0)
           printf("read err\n");
         write(fdo, &buf[0], len);
       } while (len==188);
    } else
       usleep(100000);
}

To see a similiar behaviour as I have with libevent I have to remove the else 
and do the sleep whenever read returned len != 188.
Has anyone any ideas what my be the cause of this?

-Julian
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to