/*****************************************************************************
* record.c
*****************************************************************************
- * Copyright (C) 2005 VideoLAN
+ * Copyright (C) 2005 the VideoLAN team
* $Id: demux.c 7546 2004-04-29 13:53:29Z gbazin $
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
#include <vlc/vout.h>
#include "vlc_keys.h"
-#include <osd.h>
+#include <vlc_osd.h>
#include <errno.h>
+#include <time.h>
/*****************************************************************************
* Module descriptor
set_capability( "access_filter", 0 );
add_shortcut( "record" );
- add_string( "record-path", NULL, NULL,
- RECORD_PATH_TXT, RECORD_PATH_LONGTXT, VLC_TRUE );
+ add_directory( "record-path", NULL, NULL,
+ RECORD_PATH_TXT, RECORD_PATH_LONGTXT, VLC_TRUE );
set_callbacks( Open, Close );
time_t t = time(NULL);
struct tm l;
- if( !localtime_r( &t, &l ) )
- memset( &l, 0, sizeof(l) );
+#ifdef HAVE_LOCALTIME_R
+ if( !localtime_r( &t, &l ) ) memset( &l, 0, sizeof(l) );
+#else
+ /* Grrr */
+ {
+ struct tm *p_l = localtime( &t );
+ if( p_l ) l = *p_l;
+ else memset( &l, 0, sizeof(l) );
+ }
+#endif
p_input = vlc_object_find( p_access, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
vlc_mutex_lock( &p_input->input.p_item->lock );
- if( p_input->input.p_item->psz_name &&
- strlen( p_input->input.p_item->psz_name ) < 64 )
- psz_name = strdup( p_input->input.p_item->psz_name );
+ if( p_input->input.p_item->psz_name )
+ {
+ char *p = strrchr( p_input->input.p_item->psz_name, '/' );
+ if( p == NULL )
+ p = strrchr( p_input->input.p_item->psz_name, '\\' );
+
+ if( p == NULL )
+ psz_name = strdup( p_input->input.p_item->psz_name );
+ else if( p[1] != '\0' )
+ psz_name = strdup( &p[1] );
+ }
vlc_mutex_unlock( &p_input->input.p_item->lock );
vlc_object_release( p_input );
}
+
if( psz_name == NULL )
psz_name = strdup( "Unknown" );