Changeset 39434a18b3a2135fd11f16911ea63289ecf75f35

Show
Ignore:
Timestamp:
14/11/07 16:18:15 (1 year ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1195053495 +0000
git-parent:

[b993600a6bab86f8d4dc8f22f3938f87a1563a93]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1195053495 +0000
Message:

Return pointer to osdmenu object and use that iso NULL pointer.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/osd/osd.c

    r4527fa3 r39434a1  
    2929#include <vlc_keys.h> 
    3030#include <vlc_osd.h> 
     31#include <vlc_image.h> 
     32 
    3133#include "libvlc.h" 
    32 #include <vlc_image.h> 
    3334 
    3435#undef OSD_MENU_DEBUG 
     
    5657 * Wrappers for loading and unloading osd parser modules. 
    5758 *****************************************************************************/ 
    58 static int osd_ParserLoad( vlc_object_t *p_this, const char *psz_file, 
    59                            osd_menu_t **pp_menu ) 
    60 
    61     osd_menu_t *p_menu = *pp_menu; 
    62  
    63     if( pp_menu && p_menu ) return VLC_EGENERIC; 
     59static osd_menu_t *osd_ParserLoad( vlc_object_t *p_this, const char *psz_file ) 
     60
     61    osd_menu_t *p_menu; 
    6462 
    6563    p_menu = vlc_object_create( p_this, VLC_OBJECT_OSDMENU ); 
     
    6765    { 
    6866        msg_Err( p_this, "out of memory" ); 
    69         return VLC_ENOMEM
     67        return NULL
    7068    } 
    7169    vlc_object_attach( p_this, p_menu ); 
     
    7775    { 
    7876        msg_Err( p_this, "unable to load images, aborting .." ); 
    79         osd_ParserUnload( p_this, pp_menu ); 
    80         return VLC_ENOMEM
     77        osd_ParserUnload( p_this, p_menu ); 
     78        return NULL
    8179    } 
    8280    else 
     
    9593        { 
    9694            osd_ParserUnload( p_this, pp_menu ); 
    97             return VLC_ENOOBJ; 
    98         } 
    99     } 
    100     return VLC_SUCCESS; 
    101 
    102  
    103 static void osd_ParserUnload( vlc_object_t *p_this, osd_menu_t **pp_menu ) 
    104 
    105     osd_menu_t *p_menu = (osd_menu_t *) *pp_menu; 
    106  
     95            return NULL; 
     96        } 
     97    } 
     98    return p_menu; 
     99
     100 
     101static void osd_ParserUnload( vlc_object_t *p_this, osd_menu_t *p_menu ) 
     102
    107103    if( p_menu->p_parser ) 
    108104    { 
     
    142138 
    143139        /* Parse configuration file */ 
    144         if( osd_ParserLoad( p_this, psz_file, &p_osd ) ) 
     140        p_osd = osd_ParserLoad( p_this, psz_file ); 
     141        if( !p_osd ) 
    145142            goto error; 
    146143