Changeset 14246592841d6eb4b398de735a62fa27fdd8f543

Show
Ignore:
Timestamp:
15/04/07 14:34:00 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1176640440 +0000
git-parent:

[975c0e3f6b0ed35408c8072613f8fc7051a810ea]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1176640440 +0000
Message:

Print error message when loading the playlist fails
(which is always)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/playlist/loadsave.c

    r2eeecb4 r1424659  
    8787int playlist_MLLoad( playlist_t *p_playlist ) 
    8888{ 
    89 #ifndef THIS_PIECE_OF_CODE_IS_FIXED // see #1047 and possibly others 
    90     (void)p_playlist; 
    91 #else 
    92     char *psz_uri, *psz_homedir =p_playlist->p_libvlc->psz_homedir; 
     89#if 0 
     90    FIXME: this code breaks streaming output (or streaming output breaks this, 
     91    whichever you prefer). 
     92 
     93    const char *psz_homedir = p_playlist->p_libvlc->psz_homedir; 
     94    char *psz_uri = NULL; 
    9395    input_item_t *p_input; 
    9496 
     
    99101        return VLC_EGENERIC; 
    100102    } 
    101     asprintf( &psz_uri, "file/xspf-open://%s" DIR_SEP CONFIG_DIR DIR_SEP 
    102                         "ml.xsp", psz_homedir ); 
     103 
     104    if( asprintf( &psz_uri, "file/xspf-open://%s" DIR_SEP CONFIG_DIR DIR_SEP 
     105                        "ml.xsp", psz_homedir ) == -1 ) 
     106    { 
     107        psz_uri = NULL; 
     108        goto error; 
     109    } 
    103110 
    104111    p_input = input_ItemNewExt( p_playlist, psz_uri, 
    105112                                _("Media Library"), 0, NULL, -1 ); 
    106     p_playlist->p_ml_category->p_input = p_input; 
    107     p_playlist->p_ml_onelevel->p_input = p_input; 
     113    if( p_input == NULL ) 
     114        goto error; 
     115 
     116    p_playlist->p_ml_onelevel->p_input = 
     117        p_playlist->p_ml_category->p_input = p_input; 
    108118 
    109119    p_playlist->b_doing_ml = VLC_TRUE; 
     
    114124 
    115125    free( psz_uri ); 
     126    return VLC_SUCCESS; 
     127 
     128error: 
     129    free( psz_uri ); 
     130    return VLC_ENOMEM; 
     131#else 
     132    msg_Err( p_playlist, "Reloading playlist not implemented." ); 
     133    return VLC_EGENERIC; 
    116134#endif 
    117     return VLC_SUCCESS; 
    118135} 
    119136