summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2015-09-08 17:34:50 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2015-09-08 17:34:50 -0700
commit68a9813d7e6d2dee4ac7ed3ee18516daaf92fc03 (patch)
tree7e90a9bedfa0479af3a94bfb0120cc425c05a51d
parent434964e8ceb787d44fc369e1eecf90faaf0322c2 (diff)
parent2b91dc0f82b09c863c3dc5996a6b6a2d9c1aead0 (diff)
downloadair_livetv-68a9813d7e6d2dee4ac7ed3ee18516daaf92fc03.tar.gz
air_livetv-68a9813d7e6d2dee4ac7ed3ee18516daaf92fc03.tar.bz2
air_livetv-68a9813d7e6d2dee4ac7ed3ee18516daaf92fc03.zip
Merge "Delays to call tune after tv service resume" into tizen
-rw-r--r--src/main.c47
-rw-r--r--src/view_pin.c2
2 files changed, 26 insertions, 23 deletions
diff --git a/src/main.c b/src/main.c
index b400730..324e5d3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -41,6 +41,7 @@ struct _appdata {
tzsh_h tzsh;
tzsh_tvsrv_h ta;
Ecore_Timer *pause_timer;
+ int service_id;
int is_signal;
int is_channel;
@@ -273,14 +274,30 @@ static void _resume(void *data)
r = tv_resume();
if (r < 0) {
_ERR("Resume tv service failed");
+ ui_app_exit();
+
return;
- } else if (r > 0) {
- r = tv_channel_tune();
- if (r < 0) {
- _ERR("Tune channel failed");
+ }
+
+ /* Try to tune with service id if supplied from app control */
+ if (ad->service_id > 0) {
+ r = tv_channel_tune_with_service_id(ad->service_id);
+ ad->service_id = 0;
+
+ if (!r) {
+ ad->is_channel = true;
return;
}
}
+
+ r = tv_channel_tune();
+ if (r < 0) {
+ ad->is_channel = false;
+ viewmgr_show_view(VIEW_ERROR);
+ viewmgr_update_view(VIEW_ERROR, UPDATE_TYPE_NOCHANNEL, NULL);
+ } else {
+ ad->is_channel = true;
+ }
}
static bool _create(void *data)
@@ -409,25 +426,11 @@ static void _control(app_control_h control, void *data)
ad = data;
r = app_control_get_extra_data(control, KEY_SVCID, &svcid);
- if (r == SERVICE_ERROR_NONE) {
- r = tv_channel_tune_with_service_id(atoll(svcid));
- free(svcid);
- if (!r) {
- ad->is_channel = true;
- viewmgr_show_view(VIEW_CHANNELINFO);
- return;
- }
- }
-
- r = tv_channel_tune();
+ if (r != SERVICE_ERROR_NONE)
+ return;
- if (r < 0) {
- ad->is_channel = false;
- viewmgr_show_view(VIEW_ERROR);
- viewmgr_update_view(VIEW_ERROR, UPDATE_TYPE_NOCHANNEL, NULL);
- } else {
- ad->is_channel = true;
- }
+ ad->service_id = atoll(svcid);
+ free(svcid);
}
int main(int argc, char *argv[])
diff --git a/src/view_pin.c b/src/view_pin.c
index bab97bc..b91800e 100644
--- a/src/view_pin.c
+++ b/src/view_pin.c
@@ -53,7 +53,7 @@ static void _send_message(struct _priv *priv, const char *result)
service_destroy(service);
}
-static void _check_pincode(struct _priv *priv, const char *pincode)
+static void _check_pincode(struct _priv *priv, char *pincode)
{
const struct tv_channel_info *channel_info;
int r;