LinkVideoTexture( video );
// update starttime
- video->starttime += realtime - video->lasttime;
+ video->starttime += host.realtime - video->lasttime;
return true;
}
video->state = CLVIDEO_FIRSTFRAME;
video->framenum = -1;
video->framerate = video->getframerate( video->stream );
- video->lasttime = realtime;
+ video->lasttime = host.realtime;
video->subtitles = 0;
video->width = video->getwidth( video->stream );
video->framenum = -1;
}
- video->lasttime = realtime;
+ video->lasttime = host.realtime;
return video;
}
if (!video)
return;
- video->lasttime = realtime;
+ video->lasttime = host.realtime;
video->state = state;
if (state == CLVIDEO_FIRSTFRAME)
CL_RestartVideo(video);
return;
// reset time
- video->starttime = video->lasttime = realtime;
+ video->starttime = video->lasttime = host.realtime;
video->framenum = -1;
// reopen stream
{
if (video->state != CLVIDEO_UNUSED && !video->suspended)
{
- if (realtime - video->lasttime > CLTHRESHOLD)
+ if (host.realtime - video->lasttime > CLTHRESHOLD)
{
SuspendVideo(video);
continue;
}
if (video->state == CLVIDEO_PAUSE)
{
- video->starttime = realtime - video->framenum * video->framerate;
+ video->starttime = host.realtime - video->framenum * video->framerate;
continue;
}
// read video frame from stream if time has come
if (video->state == CLVIDEO_FIRSTFRAME )
destframe = 0;
else
- destframe = (int)((realtime - video->starttime) * video->framerate);
+ destframe = (int)((host.realtime - video->starttime) * video->framerate);
if (destframe < 0)
destframe = 0;
if (video->framenum < destframe)
// calc brightness for fadein and fadeout effects
b = cl_video_brightness.value;
- if (cl_video_fadein.value && (realtime - video->starttime) < cl_video_fadein.value)
- b = pow((realtime - video->starttime)/cl_video_fadein.value, 2);
- else if (cl_video_fadeout.value && ((video->starttime + video->framenum * video->framerate) - realtime) < cl_video_fadeout.value)
- b = pow(((video->starttime + video->framenum * video->framerate) - realtime)/cl_video_fadeout.value, 2);
+ if (cl_video_fadein.value && (host.realtime - video->starttime) < cl_video_fadein.value)
+ b = pow((host.realtime - video->starttime)/cl_video_fadein.value, 2);
+ else if (cl_video_fadeout.value && ((video->starttime + video->framenum * video->framerate) - host.realtime) < cl_video_fadeout.value)
+ b = pow(((video->starttime + video->framenum * video->framerate) - host.realtime)/cl_video_fadeout.value, 2);
// draw black bg in case stipple is active or video is scaled
if (cl_video_stipple.integer || px != 0 || py != 0 || sx != vid_conwidth.integer || sy != vid_conheight.integer)
return;
// find current subtitle
- videotime = realtime - video->starttime;
+ videotime = host.realtime - video->starttime;
for (i = 0; i < video->subtitles; i++)
{
if (videotime >= video->subtitle_start[i] && videotime <= video->subtitle_end[i])