diff options
Diffstat (limited to 'ytdlsb-main.c')
| -rw-r--r-- | ytdlsb-main.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/ytdlsb-main.c b/ytdlsb-main.c index 4956743..cf2a9aa 100644 --- a/ytdlsb-main.c +++ b/ytdlsb-main.c @@ -48,7 +48,7 @@ struct ytdlsb_sb{ enum ytdlsb_tasknum{ YTDLSB_TASK_MPVEV = 0, YTDLSB_TASK_PRELOAD, - YTDLSB_TASK_NUM + YTDLSB_TASK_NUM }; struct ytdlsb{ @@ -192,8 +192,18 @@ int ytdlsb_process_preload(struct ytdlsb_task *t){ sb->fragments[pp].state = YTDLSB_SB_FAILED; } }else{ + double time; eprintf("storyboard download error: %d\n", (int)m->data.result); sb->fragments[pp].state = YTDLSB_SB_FAILED; +#define TIME(t) \ + if(!curl_easy_getinfo(p->preload_easy, t, &time)){ \ + eprintf(#t ": %f\n", time); \ + } + TIME(CURLINFO_CONNECT_TIME); + TIME(CURLINFO_APPCONNECT_TIME); + TIME(CURLINFO_PRETRANSFER_TIME); + TIME(CURLINFO_STARTTRANSFER_TIME); +#undef TIME } if(CKP(err, ytdlsb_done_fragment_preload(p))) continue; @@ -202,8 +212,10 @@ int ytdlsb_process_preload(struct ytdlsb_task *t){ break; } } + CKP(err, ytdlsb_task_timeout_ms(&p->t.tasks[YTDLSB_TASK_PRELOAD], + 300)); CKP(err, ytdlsb_task_fdto_from_curl(&p->t.tasks[YTDLSB_TASK_PRELOAD], - 0, 1, p->preload_multi)); + 0, 0, p->preload_multi)); return 0; err: return -1; } @@ -227,7 +239,7 @@ int ytdlsb_start_preload(struct ytdlsb *p){ OPT(CURLOPT_PROTOCOLS_STR, "http,https"); OPT(CURLOPT_FOLLOWLOCATION, 1l); OPT(CURLOPT_NOSIGNAL, 1l); - OPT(CURLOPT_TIMEOUT_MS, 10000l); + OPT(CURLOPT_TIMEOUT_MS, 30000l); OPT(CURLOPT_CONNECTTIMEOUT_MS, 3000l); OPT(CURLOPT_HTTPHEADER, p->preload_headers); OPT(CURLOPT_WRITEFUNCTION, ytdlsb_fragment_preload_write); |
