Ticket #1648: 1648-guid-timeout.patch

File 1648-guid-timeout.patch, 1.1 KB (added by danielk, 17 years ago)

Fix to avoid getting stuck when we can't get a devices GUID (untested).

  • libs/libmythtv/linuxfirewiredevice.cpp

     
    871871            continue;
    872872        }
    873873
     874        MythTimer guid_timer;
     875        guid_timer.start();
    874876        for (int node = 0; node < raw1394_get_nodecount(item.handle); node++)
    875877        {
    876878            bool tmp;
    877879            uint64_t guid;
    878880            if (!get_guid(item.handle, 0xffc0 | node, guid, tmp))
    879881            {
    880                 if (tmp) // device has gone off-line temporarily
    881                 {
     882                if (tmp && (guid_timer.elapsed() < 200))
     883                { // device has gone off-line temporarily
    882884                    usleep(10 * 1000);
    883885                    node--;
    884886                }
     
    889891            item.node = node;
    890892            UpdateDeviceListItem(guid, &item);
    891893            guid_online[guid] = true;
     894            guid_timer.start();
    892895        }
    893896
    894897        raw1394_destroy_handle(item.handle);