diff options
Diffstat (limited to 'jni/DvbManager.cpp')
-rw-r--r-- | jni/DvbManager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/jni/DvbManager.cpp b/jni/DvbManager.cpp index d4d35e42..b344f803 100644 --- a/jni/DvbManager.cpp +++ b/jni/DvbManager.cpp @@ -94,6 +94,11 @@ int DvbManager::tune(JNIEnv *env, jobject thiz, if (openDvbFe(env, thiz) != 0) { return -1; } + + if (frequency < 0) { + return -1; + } + if (mDvbApiVersion == DVB_API_VERSION_UNDEFINED) { struct dtv_property testProps[1] = { { .cmd = DTV_DELIVERY_SYSTEM } @@ -116,7 +121,7 @@ int DvbManager::tune(JNIEnv *env, jobject thiz, .cmd = DTV_DELIVERY_SYSTEM, .u.data = SYS_ATSC }; struct dtv_property frequencyProperty = { - .cmd = DTV_FREQUENCY, .u.data = frequency + .cmd = DTV_FREQUENCY, .u.data = static_cast<__u32>(frequency) }; struct dtv_property modulationProperty = { .cmd = DTV_MODULATION }; if (strncmp(modulationStr, "QAM", 3) == 0) { |