Permalink
Browse files

HDHomeRun: Fix capture failures when HDHR is defined by IP.

Around a year ago, SiliconDust modified the hdhomerun_device_create_from_str_ip to hardcode tuner 0 rather than parse it from the device string.  This appears to have been a simple oversight, since the equivalent string parsing function by device ID still does parse for the tuner number.

This restores the logic to parse for the tuner number rather than just unequivocally use tuner 0.

Refs #8193.  Refs #9247.
  • Loading branch information...
1 parent 4a795bc commit 0b88b99c23c4c5152fb986163fe31d628ac60173 Robert McNamara committed Jun 19, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 mythtv/libs/libmythhdhomerun/hdhomerun_device.c
@@ -216,14 +216,15 @@ static struct hdhomerun_device_t *hdhomerun_device_create_from_str_ip(const char
{
unsigned long a[4];
unsigned int port = 0;
+ unsigned int tuner = 0;
if (sscanf(device_str, "%lu.%lu.%lu.%lu:%u", &a[0], &a[1], &a[2], &a[3], &port) != 5) {
- if (sscanf(device_str, "%lu.%lu.%lu.%lu", &a[0], &a[1], &a[2], &a[3]) != 4) {
+ if (sscanf(device_str, "%lu.%lu.%lu.%lu-%u", &a[0], &a[1], &a[2], &a[3], &tuner) != 5) {
return NULL;
}
}
unsigned long device_ip = (a[0] << 24) | (a[1] << 16) | (a[2] << 8) | (a[3] << 0);
- struct hdhomerun_device_t *hd = hdhomerun_device_create(HDHOMERUN_DEVICE_ID_WILDCARD, (uint32_t)device_ip, 0, dbg);
+ struct hdhomerun_device_t *hd = hdhomerun_device_create(HDHOMERUN_DEVICE_ID_WILDCARD, (uint32_t)device_ip, tuner, dbg);
if (!hd) {
return NULL;
}

0 comments on commit 0b88b99

Please sign in to comment.