vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Tue May 17 21:12:23 2016 +0300| [274f62f22a927e6891650493f4604aa9fa31187c] | committer: Rémi Denis-Courmont
Rename str_format_time to vlc_strftime > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=274f62f22a927e6891650493f4604aa9fa31187c --- include/vlc_strings.h | 12 ++++++++++-- modules/access_output/file.c | 2 +- modules/access_output/livehttp.c | 4 ++-- modules/video_filter/marq.c | 2 +- src/libvlccore.sym | 2 +- src/text/strings.c | 9 ++------- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/include/vlc_strings.h b/include/vlc_strings.h index 0c1c6b7..98e329b 100644 --- a/include/vlc_strings.h +++ b/include/vlc_strings.h @@ -123,12 +123,20 @@ VLC_API size_t vlc_b64_decode_binary_to_buffer( uint8_t *p_dst, size_t i_dst_max VLC_API size_t vlc_b64_decode_binary( uint8_t **pp_dst, const char *psz_src ); VLC_API char * vlc_b64_decode( const char *psz_src ); -VLC_API char * str_format_time( const char * ); +/** + * Convenience wrapper for strftime(). + * + * Formats the current time into a heap-allocated string. + * + * @param tformat time format (as with C strftime()) + * @return an allocated string (must be free()'d), or NULL on memory error. + */ +VLC_API char *vlc_strftime( const char * ); VLC_API char * str_format_meta( input_thread_t *, const char * ); static inline char *str_format( input_thread_t *input, const char *fmt ) { - char *s1 = str_format_time( fmt ); + char *s1 = vlc_strftime( fmt ); char *s2 = str_format_meta( input, s1 ); free( s1 ); return s2; diff --git a/modules/access_output/file.c b/modules/access_output/file.c index d797a1a..3325672 100644 --- a/modules/access_output/file.c +++ b/modules/access_output/file.c @@ -292,7 +292,7 @@ static int Open( vlc_object_t *p_this ) if (var_InheritBool (p_access, SOUT_CFG_PREFIX"format")) { - buf = str_format_time (path); + buf = vlc_strftime (path); path = buf; } diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c index 86d1604..9abea3d 100644 --- a/modules/access_output/livehttp.c +++ b/modules/access_output/livehttp.c @@ -257,7 +257,7 @@ static int Open( vlc_object_t *p_this ) if ( psz_idx ) { char *psz_tmp; - psz_tmp = str_format_time( psz_idx ); + psz_tmp = vlc_strftime( psz_idx ); free( psz_idx ); if ( !psz_tmp ) { @@ -479,7 +479,7 @@ static char *formatSegmentPath( char *psz_path, uint32_t i_seg ) char *psz_result; char *psz_firstNumSign; - if ( ! ( psz_result = str_format_time( psz_path ) ) ) + if ( ! ( psz_result = vlc_strftime( psz_path ) ) ) return NULL; psz_firstNumSign = psz_result + strcspn( psz_result, SEG_NUMBER_PLACEHOLDER ); diff --git a/modules/video_filter/marq.c b/modules/video_filter/marq.c index 4c57931..761d203 100644 --- a/modules/video_filter/marq.c +++ b/modules/video_filter/marq.c @@ -287,7 +287,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) } } - char *msg = str_format_time( p_sys->format ? p_sys->format : "" ); + char *msg = vlc_strftime( p_sys->format ? p_sys->format : "" ); if( unlikely( msg == NULL ) ) goto out; if( p_sys->message != NULL && !strcmp( msg, p_sys->message ) ) diff --git a/src/libvlccore.sym b/src/libvlccore.sym index 32dbaad..41b58bd 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -406,7 +406,7 @@ stream_vaControl stream_ReadDir stream_FilterDefaultReadDir str_format_meta -str_format_time +vlc_strftime subpicture_Delete subpicture_New subpicture_NewFromPicture diff --git a/src/text/strings.c b/src/text/strings.c index 2ebc240..b151ae2 100644 --- a/src/text/strings.c +++ b/src/text/strings.c @@ -34,7 +34,7 @@ #include <vlc_common.h> #include <assert.h> -/* Needed by str_format_time */ +/* Needed by vlc_strftime */ #include <time.h> #include <limits.h> #include <math.h> @@ -468,12 +468,7 @@ char *vlc_b64_decode( const char *psz_src ) return p_dst; } -/** - * Formats current time into a heap-allocated string. - * @param tformat time format (as with C strftime()) - * @return an allocated string (must be free()'d), or NULL on memory error. - */ -char *str_format_time( const char *tformat ) +char *vlc_strftime( const char *tformat ) { time_t curtime; struct tm loctime; _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
