Commit d2910851 authored by Damien Fouilleul's avatar Damien Fouilleul

libvlc_video_take_snapshot: removed kludge and fixed path_sanitize for win32

parent b1b62947
......@@ -158,14 +158,19 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath,
vout_thread_t *p_vout = GetVout( p_input, p_e );
input_thread_t *p_input_thread;
char path[256];
/* GetVout will raise the exception for us */
if( !p_vout )
{
return;
}
if( !psz_filepath )
{
libvlc_exception_raise( p_e, "filepath is null" );
return;
}
p_input_thread = (input_thread_t*)vlc_object_get(
p_input->p_instance->p_libvlc_int,
p_input->i_input_id );
......@@ -175,8 +180,7 @@ libvlc_video_take_snapshot( libvlc_input_t *p_input, char *psz_filepath,
return;
}
snprintf( path, 255, "%s", psz_filepath );
var_SetString( p_vout, "snapshot-path", path );
var_SetString( p_vout, "snapshot-path", psz_filepath );
var_SetString( p_vout, "snapshot-format", "png" );
vout_Control( p_vout, VOUT_SNAPSHOT );
......
......@@ -840,6 +840,11 @@ void path_sanitize( char *str )
* want to.
*/
char *prev = str - 1;
#endif
#ifdef WIN32
/* check drive prefix if path is absolute */
if( isalpha(*str) && (':' == *(str+1)) )
str += 2;
#endif
while( *str )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment