diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tv.c | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -1055,12 +1055,8 @@ int tv_destroy(void) { int r; - if (g_tv_info.live_svc) { - r = tv_service_live_destroy(g_tv_info.live_svc); - if (r != TVS_ERROR_OK) - _ERR("failed to destroy live service"); + if (g_tv_info.live_svc) g_tv_info.live_svc = NULL; - } r = tv_service_channel_info_destroy(); if (r < 0) @@ -1126,10 +1122,9 @@ int tv_pause(void) int r; if (g_tv_info.live_svc) { - r = tv_service_live_destroy(g_tv_info.live_svc); + r = tv_service_live_tune_pause(g_tv_info.live_svc); if (r != TVS_ERROR_OK) - _ERR("failed to destroy live service"); - g_tv_info.live_svc = NULL; + _ERR("failed to pause live service"); } return 0; @@ -1151,10 +1146,17 @@ int tv_resume(void) { int r; - if (g_tv_info.live_svc) - return 0; + if (!g_tv_info.live_svc) { + r = tv_service_live_create(&g_tv_info.live_svc); + if (r != TVS_ERROR_OK) { + _ERR("failed to create live service"); + goto err; + } else { + return 1; + } + } - r = tv_service_live_create(&g_tv_info.live_svc); + r = tv_service_live_tune_resume(g_tv_info.live_svc); if (r != TVS_ERROR_OK) { _ERR("failed to create live service"); goto err; @@ -1167,7 +1169,7 @@ int tv_resume(void) goto err; } - return 1; + return 0; err: tv_destroy(); |