static clvideo_t* OpenVideo( clvideo_t *video, const char *filename, const char *name, int owner )
{
- strncpy( video->filename, filename, MAX_QPATH );
+ strlcpy( video->filename, filename, sizeof(video->filename) );
video->ownertag = owner;
if( strncmp( name, CLVIDEOPREFIX, sizeof( CLVIDEOPREFIX ) - 1 ) )
return NULL;
- strncpy( video->cpif.name, name, MAX_QPATH );
+ strlcpy( video->cpif.name, name, sizeof(video->cpif.name) );
if( !OpenStream( video ) )
return NULL;
CL_RestartVideo( cl_videos );
}
+void CL_Video_KeyEvent( int key, int ascii, qboolean down )
+{
+ // only react to up events, to allow the user to delay the abortion point if it suddenly becomes interesting..
+ if( !down ) {
+ if( key == K_ESCAPE || key == K_ENTER || key == K_SPACE ) {
+ CL_VideoStop();
+ }
+ }
+}
+
void CL_VideoStop(void)
{
cl_videoplaying = false;