提交 a0ba47c5 编写于 作者: Z Zhang Rui

ff_ffplay: do not count ic->start_time in duration

上级 9c812a29
...@@ -3563,17 +3563,11 @@ long ffp_get_duration_l(FFPlayer *ffp) ...@@ -3563,17 +3563,11 @@ long ffp_get_duration_l(FFPlayer *ffp)
if (!is || !is->ic) if (!is || !is->ic)
return 0; return 0;
int64_t start_time = is->ic->start_time;
int64_t start_diff = 0;
if (start_time > 0 && start_time != AV_NOPTS_VALUE)
start_diff = fftime_to_milliseconds(start_time);
int64_t duration = fftime_to_milliseconds(is->ic->duration); int64_t duration = fftime_to_milliseconds(is->ic->duration);
if (duration < 0 || duration < start_diff) if (duration < 0)
return 0; return 0;
int64_t adjust_duration = duration - start_diff; return (long)duration;
return (long)adjust_duration;
} }
long ffp_get_playable_duration_l(FFPlayer *ffp) long ffp_get_playable_duration_l(FFPlayer *ffp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册