Ticket #4790: hvr1600_workaround_for_mpegrecorder.patch

File hvr1600_workaround_for_mpegrecorder.patch, 1.9 KB (added by wrsturm@…, 18 years ago)
  • libs/libmythtv/mpegrecorder.cpp

    old new  
    860860#if defined(__FreeBSD__)
    861861        // HACK. FreeBSD PVR150/500 driver doesn't currently support select()
    862862#else
    863         switch (select(readfd + 1, &rdset, NULL, NULL, &tv))
     863        // The following is a workaround until the cx18 driver
     864        // doesn't timeout in select()
     865        if (driver != "cx18")
    864866        {
    865             case -1:
    866                 if (errno == EINTR)
    867                     continue;
    868 
    869                 VERBOSE(VB_IMPORTANT, LOC_ERR + "Select error" + ENO);
    870                 continue;
     867            switch (select(readfd + 1, &rdset, NULL, NULL, &tv))
     868            {
     869                case -1:
     870                     if (errno == EINTR)
     871                         continue;
    871872
    872             case 0:
    873                 VERBOSE(VB_IMPORTANT, LOC_ERR + "select timeout - "
    874                         "ivtv driver has stopped responding");
     873                    VERBOSE(VB_IMPORTANT, LOC_ERR + "Select error" + ENO);
     874                    continue;
    875875
    876                 if (close(readfd) != 0)
    877                 {
    878                     VERBOSE(VB_IMPORTANT, LOC_ERR + "Close error" + ENO);
    879                 }
     876                case 0:
     877                    VERBOSE(VB_IMPORTANT, LOC_ERR + "select timeout - "
     878                            "ivtv driver has stopped responding");
     879
     880                    if (close(readfd) != 0)
     881                    {
     882                        VERBOSE(VB_IMPORTANT, LOC_ERR + "Close error" + ENO);
     883                    }
    880884
    881                 readfd = -1; // Force PVR card to be reopened on next iteration
    882                 continue;
     885                    readfd = -1; // Force PVR card to be reopened on next iteration
     886                    continue;
    883887
    884            default: break;
     888                default: break;
     889            }
    885890        }
    886891#endif
    887892