diff options
author | jinwoo.shin <jw0227.shin@samsung.com> | 2015-09-08 14:36:23 +0900 |
---|---|---|
committer | jinwoo.shin <jw0227.shin@samsung.com> | 2015-09-08 16:55:04 +0900 |
commit | 2b91dc0f82b09c863c3dc5996a6b6a2d9c1aead0 (patch) | |
tree | 04857d9333656f9bdfa39e271e80769ffec11a4d | |
parent | cf24548ef200fedb5909f94766c01c726f3a4690 (diff) | |
download | air_livetv-2b91dc0f82b09c863c3dc5996a6b6a2d9c1aead0.tar.gz air_livetv-2b91dc0f82b09c863c3dc5996a6b6a2d9c1aead0.tar.bz2 air_livetv-2b91dc0f82b09c863c3dc5996a6b6a2d9c1aead0.zip |
Delays to call tune after tv service resume
Change-Id: Id9c9c4c10f5955ff2d70c48eba804cc09c9dd3df
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
-rw-r--r-- | src/main.c | 47 | ||||
-rw-r--r-- | src/view_pin.c | 2 |
2 files changed, 26 insertions, 23 deletions
@@ -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; |