From 0b88b99c23c4c5152fb986163fe31d628ac60173 Mon Sep 17 00:00:00 2001 From: Robert McNamara Date: Sun, 19 Jun 2011 07:35:26 -0700 Subject: [PATCH] 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. --- mythtv/libs/libmythhdhomerun/hdhomerun_device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmythhdhomerun/hdhomerun_device.c b/mythtv/libs/libmythhdhomerun/hdhomerun_device.c index dae549befe0..fe500c5dd80 100644 --- a/mythtv/libs/libmythhdhomerun/hdhomerun_device.c +++ b/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; }