Changeset 2ffa2bd3d0a506be2a6c9e53edffeee442350397

Show
Ignore:
Timestamp:
01/10/06 21:07:48 (2 years ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1159729668 +0000
git-parent:

[19f542a35b43fadc821547fea49f7cbd90ad0b69]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1159729668 +0000
Message:

src/input/item.c: if we don't have an item name and item is a file, then only use the filename (and not the full path) as the item's name
others: if we only have a path and no interesting name, let the core decide what name to use

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/control/http/rpn.c

    r857b51f r2ffa2bd  
    844844            mrl = tmp; 
    845845 
    846             if( !*psz_name ) 
    847             { 
    848                 p_input = E_(MRLParse)( p_intf, mrl, mrl ); 
    849             } 
    850             else 
    851             { 
    852                 p_input = E_(MRLParse)( p_intf, mrl, psz_name ); 
    853             } 
     846            p_input = E_(MRLParse)( p_intf, mrl, psz_name ); 
    854847 
    855848            if( !p_input || !p_input->psz_uri || !*p_input->psz_uri ) 
  • modules/control/rc.c

    r9ec7c59 r2ffa2bd  
    22912291    if( psz_item_mrl ) 
    22922292    { 
    2293         p_item = input_ItemNew( p_intf, psz_item_mrl, psz_item_mrl ); 
     2293        p_item = input_ItemNew( p_intf, psz_item_mrl, NULL ); 
    22942294        for( i = 0; i < i_options; i++ ) 
    22952295        { 
  • modules/demux/playlist/gvp.c

    r857b51f r2ffa2bd  
    6969    byte_t *p_peek; 
    7070 
     71    /* FIXME: we need to skip comment lines !!!! */ 
    7172    CHECK_PEEK( p_peek, 12 ); 
    7273    if( !POKE( p_peek, "gvp_version:", 12 ) ) 
  • modules/demux/playlist/qtl.c

    r857b51f r2ffa2bd  
    370370        { 
    371371            p_input = input_ItemNewExt( p_sys->p_playlist, 
    372                                         psz_qtnext, psz_qtnext, 0, NULL, -1 ); 
     372                                        psz_qtnext, NULL, 0, NULL, -1 ); 
    373373            playlist_AddWhereverNeeded( p_sys->p_playlist, p_input, 
    374374                            p_sys->p_current, p_sys->p_item_in_category, 
  • modules/gui/beos/InterfaceWindow.cpp

    r91c5596 r2ffa2bd  
    750750                if( p_playlist ) 
    751751                { 
    752                     playlist_PlaylistAdd( p_playlist, path.Path(), path.Path()
     752                    playlist_PlaylistAdd( p_playlist, path.Path(), NULL
    753753                                  PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); 
    754754                } 
  • modules/gui/qt4/dialogs_provider.cpp

    r18efcf5 r2ffa2bd  
    208208    { 
    209209        const char * psz_utf8 = qtu( file ); 
    210         playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8
     210        playlist_PlaylistAdd( THEPL, psz_utf8, NULL
    211211                     PLAYLIST_APPEND | PLAYLIST_PREPARSE, PLAYLIST_END ); 
    212212    } 
     
    233233        const char * psz_utf8 = qtu( files[i] ); 
    234234        /* Play the first one, parse and enqueue the other ones */ 
    235         playlist_PlaylistAdd( THEPL, psz_utf8, psz_utf8
     235        playlist_PlaylistAdd( THEPL, psz_utf8, NULL
    236236                     PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | 
    237237                     ( i ? PLAYLIST_PREPARSE : 0 ), 
     
    257257                                                     _("Open directory") ); 
    258258    const char *psz_utf8 = qtu( dir ); 
    259     input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8
     259    input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL
    260260                                               0, NULL, -1 ); 
    261261    playlist_PlaylistAddInput( THEPL, p_input, 
     
    268268                                                     _("Open directory") ); 
    269269    const char *psz_utf8 = qtu( dir ); 
    270     input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, psz_utf8
     270    input_item_t *p_input = input_ItemNewExt( THEPL, psz_utf8, NULL
    271271                                               0, NULL, -1 ); 
    272272    playlist_MLAddInput( THEPL, p_input, PLAYLIST_APPEND, PLAYLIST_END ); 
  • modules/gui/skins2/commands/cmd_add_item.cpp

    red0b72e r2ffa2bd  
    3838    { 
    3939        // Enqueue and play the item 
    40         playlist_PlaylistAdd( pPlaylist, m_name.c_str(),m_name.c_str()
     40        playlist_PlaylistAdd( pPlaylist, m_name.c_str(), NULL
    4141                              PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END ); 
    4242    } 
     
    4444    { 
    4545        // Enqueue the item only 
    46         playlist_PlaylistAdd( pPlaylist, m_name.c_str(), m_name.c_str()
     46        playlist_PlaylistAdd( pPlaylist, m_name.c_str(), NULL
    4747                              PLAYLIST_APPEND, PLAYLIST_END ); 
    4848    } 
  • modules/gui/wxwidgets/dialogs.cpp

    rdfb262b r2ffa2bd  
    447447            char *psz_utf8 = wxFromLocale( paths[i] ); 
    448448            if( event.GetInt() ) 
    449                 playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8
     449                playlist_PlaylistAdd( p_playlist, psz_utf8, NULL
    450450                              PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO) | 
    451451                              (i ? PLAYLIST_PREPARSE : 0 ), 
    452452                              PLAYLIST_END ); 
    453453            else 
    454                 playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8
     454                playlist_PlaylistAdd( p_playlist, psz_utf8, NULL
    455455                              PLAYLIST_APPEND | PLAYLIST_PREPARSE , PLAYLIST_END ); 
    456456            wxLocaleFree( psz_utf8 ); 
     
    478478        wxString path = p_dir_dialog->GetPath(); 
    479479        char *psz_utf8 = wxFromLocale( path ); 
    480         playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8
     480        playlist_PlaylistAdd( p_playlist, psz_utf8, NULL
    481481                      PLAYLIST_APPEND | (event.GetInt() ? PLAYLIST_GO : 0), 
    482482                      PLAYLIST_END ); 
  • modules/gui/wxwidgets/dialogs/open.cpp

    r857b51f r2ffa2bd  
    11701170 
    11711171        psz_utf8 = wxFromLocale( mrl[i] ); 
    1172         p_input = input_ItemNew( p_intf, psz_utf8, psz_utf8 ); 
     1172        p_input = input_ItemNew( p_intf, psz_utf8, NULL ); 
    11731173        wxLocaleFree( psz_utf8 ); 
    11741174 
  • modules/gui/wxwidgets/interface.cpp

    rf485214 r2ffa2bd  
    13051305        char *psz_utf8 = wxDnDFromLocale( filenames[i] ); 
    13061306 
    1307         playlist_PlaylistAdd( p_playlist, psz_utf8, psz_utf8
     1307        playlist_PlaylistAdd( p_playlist, psz_utf8, NULL
    13081308                      PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO), 
    13091309                      PLAYLIST_END ); 
  • src/input/item.c

    r857b51f r2ffa2bd  
    242242        p_input->psz_uri = NULL; 
    243243 
     244    p_input->i_type = i_type; 
     245    p_input->b_prefers_tree = VLC_FALSE; 
     246 
     247    if( p_input->i_type == ITEM_TYPE_UNKNOWN ) 
     248        GuessType( p_input ); 
     249 
    244250    if( psz_name != NULL ) 
    245251        p_input->psz_name = strdup( psz_name ); 
     252    else if( p_input->i_type == ITEM_TYPE_AFILE 
     253             || p_input->i_type == ITEM_TYPE_VFILE ) 
     254    { 
     255        char *psz_filename = strrchr( p_input->psz_uri, DIR_SEP_CHAR ); 
     256        if( psz_filename && *psz_filename == DIR_SEP_CHAR ) 
     257            psz_filename++; 
     258        p_input->psz_name = strdup( psz_filename && *psz_filename 
     259                                    ? psz_filename : p_input->psz_uri ); 
     260    } 
    246261    else 
    247         p_input->psz_name = strdup ( p_input->psz_uri ); 
    248  
    249     p_input->i_type = i_type; 
    250     p_input->b_prefers_tree = VLC_FALSE; 
    251  
    252     if( p_input->i_type == ITEM_TYPE_UNKNOWN ) 
    253         GuessType( p_input ); 
     262        p_input->psz_name = strdup( p_input->psz_uri ); 
    254263 
    255264    p_input->i_duration = i_duration; 
  • src/libvlc-common.c

    r18efcf5 r2ffa2bd  
    163163    vlc_mutex_lock( lockval.p_address ); 
    164164 
    165      
    166  
    167165    i_instances++; 
    168166 
  • src/libvlc.c

    r18efcf5 r2ffa2bd  
    316316    LIBVLC_PLAYLIST_FUNC; 
    317317    i_err = playlist_PlaylistAddExt( p_libvlc->p_playlist, psz_target, 
    318                                      psz_target,  i_mode, i_pos, -1, 
     318                                     NULL,  i_mode, i_pos, -1, 
    319319                                     ppsz_options, i_options ); 
    320320    LIBVLC_PLAYLIST_FUNC_END; 
  • src/misc/win32_specific.c

    rfcfc11b r2ffa2bd  
    323323                { 
    324324                  playlist_PlaylistAddExt( p_playlist, ppsz_argv[i_opt], 
    325                     ppsz_argv[i_opt], PLAYLIST_APPEND , 
     325                    NULL, PLAYLIST_APPEND , 
    326326                    PLAYLIST_END, -1, 
    327327                    (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ), 
     
    329329                } else { 
    330330                  playlist_PlaylistAddExt( p_playlist, ppsz_argv[i_opt], 
    331                     ppsz_argv[i_opt], PLAYLIST_APPEND | PLAYLIST_GO, 
     331                    NULL, PLAYLIST_APPEND | PLAYLIST_GO, 
    332332                    PLAYLIST_END, -1, 
    333333                    (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ),