* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include "Nsf_Emu.h"
#include "Gbs_Emu.h"
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-vlc_module_begin();
- set_shortname( "GME");
- set_description( _("GME demuxer (Game_Music_Emu)" ) );
- set_capability( "demux2", 10 );
- set_category( CAT_INPUT );
- set_subcategory( SUBCAT_INPUT_DEMUX );
- set_callbacks( Open, Close );
- add_shortcut( "gme" );
-vlc_module_end();
+vlc_module_begin ()
+ set_shortname( "GME")
+ set_description( N_("GME demuxer (Game_Music_Emu)" ) )
+ set_capability( "demux", 10 )
+ set_category( CAT_INPUT )
+ set_subcategory( SUBCAT_INPUT_DEMUX )
+ set_callbacks( Open, Close )
+ add_shortcut( "gme" )
+vlc_module_end ()
/*****************************************************************************
* Local prototypes
vlc_value_t val;
/* We accept file based on extention match */
- if( strcasecmp( p_demux->psz_demux, "gme" ) )
+ if( !p_demux->b_force )
{
if( ( ext = strrchr( p_demux->psz_path, '.' ) ) == NULL ||
stream_Size( p_demux->s ) == 0 ) return VLC_EGENERIC;
p_demux->pf_demux = Demux;
p_demux->pf_control = Control;
p_demux->p_sys = p_sys = (demux_sys_t *)malloc( sizeof( demux_sys_t ) );
+ assert(p_sys);
msg_Dbg( p_demux, "loading complete file (could be long)" );
p_sys->i_data = stream_Size( p_demux->s );
p_sys->p_data = (uint8_t *)malloc( p_sys->i_data );
+ assert(p_sys->p_data);
p_sys->i_data = stream_Read( p_demux->s, p_sys->p_data, p_sys->i_data );
if( p_sys->i_data <= 0 )
{
{
ModPlug_Seek( p_sys->f, i64 / 1000 );
p_sys->i_time = i64 + 1;
- es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
return VLC_SUCCESS;
}
{
ModPlug_Seek( p_sys->f, i64 / 1000 );
p_sys->i_time = i64 + 1;
- es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
return VLC_SUCCESS;
}
*pi_int = p_sys->i_tracks;
*ppp_title = (input_title_t**)malloc( sizeof( input_title_t**) * p_sys->i_tracks );
+ assert( *ppp_sitle );
for( int i = 0; i < p_sys->i_tracks; i++ )
{
out_size = i_size * 2;
out_buffer = (uint8_t*)malloc(out_size);
+ assert(out_buffer);
z_str.next_in = (unsigned char*)p_buffer;
z_str.avail_in = i_size;
case Z_BUF_ERROR:
offset = z_str.next_out - out_buffer;
out_size *= 2;
- out_buffer = (uint8_t *)realloc(out_buffer, out_size);
+ out_buffer = (uint8_t *)realloc_or_free(out_buffer, out_size);
+ assert(out_buffer);
z_str.next_out = out_buffer + offset;
z_str.avail_out = out_size - offset;
break;
inflateEnd(&z_str);
- out_buffer = (uint8_t *)realloc(out_buffer, *pi_osize);
+ out_buffer = (uint8_t *)realloc_or_free(out_buffer, *pi_osize);
+ assert(out_buffer);
(*pp_obuffer) = out_buffer;
}
#endif