diff options
-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; |