Skip to content

Commit

Permalink
HDHomeRun: Fix capture failures when HDHR is defined by IP.
Browse files Browse the repository at this point in the history
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
Robert McNamara committed Jun 19, 2011
1 parent 4a795bc commit 0b88b99
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmythhdhomerun/hdhomerun_device.c
Expand Up @@ -216,14 +216,15 @@ static struct hdhomerun_device_t *hdhomerun_device_create_from_str_ip(const char
{ {
unsigned long a[4]; unsigned long a[4];
unsigned int port = 0; 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:%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; return NULL;
} }
} }


unsigned long device_ip = (a[0] << 24) | (a[1] << 16) | (a[2] << 8) | (a[3] << 0); 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) { if (!hd) {
return NULL; return NULL;
} }
Expand Down

0 comments on commit 0b88b99

Please sign in to comment.