[vlc-devel] [PATCH v3 4/14] es_out_timeshift: simplify win32 case with config_GetTempPath()
Lyndon Brown
jnqnfe at gmail.com
Wed Oct 14 04:53:03 CEST 2020
From: Lyndon Brown <jnqnfe at gmail.com>
Date: Fri, 9 Oct 2020 19:28:38 +0100
Subject: es_out_timeshift: simplify win32 case with config_GetTempPath()
this changes the functionality slightly, with the old code dynamically
allocating a buffer of the necessary size to hold the path, whilst the
config_GetTempPath() function just uses PATH_MAX. But if the implementation
of config_GetTempPath() using PATH_MX is inadequate, it should be changed
to use the model replaced here.
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 8ffa1ea400..02735e807b 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -364,20 +364,7 @@ es_out_t *input_EsOutTimeshiftNew( input_thread_t *p_input, es_out_t *p_next_out
p_sys->psz_tmp_path = var_InheritString( p_input, "input-timeshift-path" );
#if defined (_WIN32) && !VLC_WINSTORE_APP
if( p_sys->psz_tmp_path == NULL )
- {
- const DWORD count = GetTempPath( 0, NULL );
- if( count > 0 )
- {
- WCHAR *path = vlc_alloc( count + 1, sizeof(WCHAR) );
- if( path != NULL )
- {
- DWORD ret = GetTempPath( count + 1, path );
- if( ret != 0 && ret <= count )
- p_sys->psz_tmp_path = FromWide( path );
- free( path );
- }
- }
- }
+ p_sys->psz_tmp_path = config_GetTempPath();
if( p_sys->psz_tmp_path == NULL )
{
wchar_t *wpath = _wgetcwd( NULL, 0 );
More information about the vlc-devel
mailing list