Skip to content
Browse files

Updated libhdhomerun to version 20130328.

Fixes #11389
  • Loading branch information...
1 parent 1ead1cf commit c5818bd4546424a82dc9e9634597470e4169134a @gigem gigem committed Apr 4, 2013
View
46 mythtv/external/libhdhomerun/hdhomerun_channels.c
@@ -140,45 +140,57 @@ static const struct hdhomerun_channelmap_range_t hdhomerun_channelmap_range_us_i
static const struct hdhomerun_channelmap_record_t hdhomerun_channelmap_table[] = {
{"au-bcast", hdhomerun_channelmap_range_au_bcast, "au-bcast", "AU"},
{"au-cable", hdhomerun_channelmap_range_eu_cable, "au-cable", "AU"},
- {"eu-bcast", hdhomerun_channelmap_range_eu_bcast, "eu-bcast", "EU PA"},
- {"eu-cable", hdhomerun_channelmap_range_eu_cable, "eu-cable", "EU"},
+ {"eu-bcast", hdhomerun_channelmap_range_eu_bcast, "eu-bcast", NULL},
+ {"eu-cable", hdhomerun_channelmap_range_eu_cable, "eu-cable", NULL},
{"tw-bcast", hdhomerun_channelmap_range_us_bcast, "tw-bcast", "TW"},
{"tw-cable", hdhomerun_channelmap_range_us_cable, "tw-cable", "TW"},
{"kr-bcast", hdhomerun_channelmap_range_us_bcast, "kr-bcast", "KR"},
{"kr-cable", hdhomerun_channelmap_range_kr_cable, "kr-cable", "KR"},
- {"us-bcast", hdhomerun_channelmap_range_us_bcast, "us-bcast", "CA US"},
- {"us-cable", hdhomerun_channelmap_range_us_cable, "us-cable us-hrc us-irc", "CA PA US"},
- {"us-hrc", hdhomerun_channelmap_range_us_hrc , "us-cable us-hrc us-irc", "CA PA US"},
- {"us-irc", hdhomerun_channelmap_range_us_irc, "us-cable us-hrc us-irc", "CA PA US"},
+ {"us-bcast", hdhomerun_channelmap_range_us_bcast, "us-bcast", NULL},
+ {"us-cable", hdhomerun_channelmap_range_us_cable, "us-cable us-hrc us-irc", NULL},
+ {"us-hrc", hdhomerun_channelmap_range_us_hrc , "us-cable us-hrc us-irc", NULL},
+ {"us-irc", hdhomerun_channelmap_range_us_irc, "us-cable us-hrc us-irc", NULL},
{NULL, NULL, NULL, NULL}
};
-const char *hdhomerun_channelmap_get_channelmap_from_country_source(const char *countrycode, const char *source)
+const char *hdhomerun_channelmap_get_channelmap_from_country_source(const char *countrycode, const char *source, const char *supported)
{
- bool_t country_found = FALSE;
+ const char *default_result = NULL;
const struct hdhomerun_channelmap_record_t *record = hdhomerun_channelmap_table;
while (record->channelmap) {
- if (!strstr(record->countrycodes, countrycode)) {
+ /* Ignore records that do not match the requested source. */
+ if (!strstr(record->channelmap, source)) {
record++;
continue;
}
- if (strstr(record->channelmap, source)) {
- return record->channelmap;
+ /* Ignore records that are not supported by the hardware. */
+ if (!strstr(supported, record->channelmap)) {
+ record++;
+ continue;
}
- country_found = TRUE;
- record++;
- }
+ /* If this record is the default result then remember it and keep searching. */
+ if (!record->countrycodes) {
+ default_result = record->channelmap;
+ record++;
+ continue;
+ }
- if (!country_found) {
- return hdhomerun_channelmap_get_channelmap_from_country_source("EU", source);
+ /* Ignore records that have a countrycode filter and do not match. */
+ if (!strstr(record->countrycodes, countrycode)) {
+ record++;
+ continue;
+ }
+
+ /* Record found with exact match for source and countrycode. */
+ return record->channelmap;
}
- return NULL;
+ return default_result;
}
const char *hdhomerun_channelmap_get_channelmap_scan_group(const char *channelmap)
View
2 mythtv/external/libhdhomerun/hdhomerun_channels.h
@@ -37,7 +37,7 @@ extern "C" {
struct hdhomerun_channel_entry_t;
struct hdhomerun_channel_list_t;
-extern LIBTYPE const char *hdhomerun_channelmap_get_channelmap_from_country_source(const char *countrycode, const char *source);
+extern LIBTYPE const char *hdhomerun_channelmap_get_channelmap_from_country_source(const char *countrycode, const char *source, const char *supported);
extern LIBTYPE const char *hdhomerun_channelmap_get_channelmap_scan_group(const char *channelmap);
extern LIBTYPE uint16_t hdhomerun_channel_entry_channel_number(struct hdhomerun_channel_entry_t *entry);
View
1 mythtv/external/libhdhomerun/hdhomerun_channelscan.c
@@ -60,6 +60,7 @@ struct hdhomerun_channelscan_t *channelscan_create(struct hdhomerun_device_t *hd
void channelscan_destroy(struct hdhomerun_channelscan_t *scan)
{
+ hdhomerun_channel_list_destroy(scan->channel_list);
free(scan);
}
View
3 mythtv/external/libhdhomerun/hdhomerun_os_posix.h
@@ -50,10 +50,7 @@
#include <pthread.h>
typedef int bool_t;
-
-#if !defined(_DARWIN_C_SOURCE)
typedef void (*sig_t)(int);
-#endif
#define LIBTYPE
#define console_vprintf vprintf
View
2 mythtv/external/libhdhomerun/hdhomerun_os_windows.c
@@ -90,7 +90,6 @@ void msleep_minimum(uint64_t ms)
}
}
-#if !defined(PTHREAD_H)
int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg)
{
*tid = CreateThread(NULL, 0, start, arg, 0, NULL);
@@ -127,7 +126,6 @@ void pthread_mutex_unlock(pthread_mutex_t *mutex)
{
ReleaseMutex(*mutex);
}
-#endif
bool_t hdhomerun_vsprintf(char *buffer, char *end, const char *fmt, va_list ap)
{
View
14 mythtv/external/libhdhomerun/hdhomerun_os_windows.h
@@ -31,17 +31,10 @@
*/
#define _WINSOCKAPI_
-#if defined(USING_MINGW)
-/* MinGW lacks wspiapi.h; set minimum WINVER to WinXP to remove dependency */
-#define WINVER 0x0501
-#endif
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
-#include <wincrypt.h>
-#if !defined(USING_MINGW)
#include <wspiapi.h>
-#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
@@ -60,10 +53,6 @@
#endif
typedef int bool_t;
-#if defined(USING_MINGW)
-#include <stdint.h>
-#include <pthread.h>
-#else
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
@@ -75,7 +64,6 @@ typedef unsigned __int64 uint64_t;
typedef void (*sig_t)(int);
typedef HANDLE pthread_t;
typedef HANDLE pthread_mutex_t;
-#endif
#define va_copy(x, y) x = y
#define atoll _atoi64
@@ -94,13 +82,11 @@ extern LIBTYPE uint64_t getcurrenttime(void);
extern LIBTYPE void msleep_approx(uint64_t ms);
extern LIBTYPE void msleep_minimum(uint64_t ms);
-#if !defined(PTHREAD_H)
extern LIBTYPE int pthread_create(pthread_t *tid, void *attr, LPTHREAD_START_ROUTINE start, void *arg);
extern LIBTYPE int pthread_join(pthread_t tid, void **value_ptr);
extern LIBTYPE void pthread_mutex_init(pthread_mutex_t *mutex, void *attr);
extern LIBTYPE void pthread_mutex_lock(pthread_mutex_t *mutex);
extern LIBTYPE void pthread_mutex_unlock(pthread_mutex_t *mutex);
-#endif
extern LIBTYPE bool_t hdhomerun_vsprintf(char *buffer, char *end, const char *fmt, va_list ap);
extern LIBTYPE bool_t hdhomerun_sprintf(char *buffer, char *end, const char *fmt, ...);

0 comments on commit c5818bd

Please sign in to comment.
Something went wrong with that request. Please try again.