Changeset 0020f8223ca647e68fa0f2d58cbe97fc9c149cdc

Show
Ignore:
Timestamp:
29/04/05 09:37:20 (4 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1114760240 +0000
git-parent:

[40641a7b34709bb4de951d7a4114e85d9d3180fc]

git-author:
Laurent Aimar <fenrir@videolan.org> 1114760240 +0000
Message:
  • record: use add_directory (instead of add_string) + parse the name to
    remove the uri/path part.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_filter/record.c

    r2078691 r0020f82  
    5555    add_shortcut( "record" ); 
    5656 
    57     add_string( "record-path", NULL, NULL, 
    58                 RECORD_PATH_TXT, RECORD_PATH_LONGTXT, VLC_TRUE ); 
     57    add_directory( "record-path", NULL, NULL, 
     58                   RECORD_PATH_TXT, RECORD_PATH_LONGTXT, VLC_TRUE ); 
    5959 
    6060    set_callbacks( Open, Close ); 
     
    342342        { 
    343343            vlc_mutex_lock( &p_input->input.p_item->lock ); 
    344             if( p_input->input.p_item->psz_name && 
    345                 strlen( p_input->input.p_item->psz_name ) < 64 ) 
    346                 psz_name = strdup( p_input->input.p_item->psz_name ); 
     344            if( p_input->input.p_item->psz_name ) 
     345            { 
     346                char *p = strrchr( p_input->input.p_item->psz_name, '/' ); 
     347                if( p == NULL ) 
     348                    p = strrchr( p_input->input.p_item->psz_name, '\\' ); 
     349 
     350                if( p == NULL ) 
     351                    psz_name = strdup( p_input->input.p_item->psz_name ); 
     352                else if( p[1] != '\0' ) 
     353                    psz_name = strdup( &p[1] ); 
     354            } 
    347355            vlc_mutex_unlock( &p_input->input.p_item->lock ); 
    348356 
    349357            vlc_object_release( p_input ); 
    350358        } 
     359 
    351360        if( psz_name == NULL ) 
    352361            psz_name = strdup( "Unknown" );