[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[326] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-11 11:47:17
|
Revision: 326 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=326&view=rev Author: nickols_k Date: 2012-11-11 11:47:09 +0000 (Sun, 11 Nov 2012) Log Message: ----------- still one step in antiviral protection Modified Paths: -------------- mplayerxp/libao2/audio_out.c mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/dec_audio.c mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd.h mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/demuxer.c mplayerxp/libvo/video_out.c mplayerxp/libvo/video_out.h mplayerxp/mplayerxp.c mplayerxp/osdep/mp_malloc.c mplayerxp/osdep/mplib.h mplayerxp/postproc/Makefile mplayerxp/postproc/af.c mplayerxp/postproc/af.h mplayerxp/postproc/vf.c mplayerxp/postproc/vf.h Added Paths: ----------- mplayerxp/libmpdemux/demux_null.c mplayerxp/postproc/af_null.c mplayerxp/postproc/vf_null.c Modified: mplayerxp/libao2/audio_out.c =================================================================== --- mplayerxp/libao2/audio_out.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libao2/audio_out.c 2012-11-11 11:47:09 UTC (rev 326) @@ -35,7 +35,7 @@ extern const ao_functions_t audio_out_jack; #endif -const ao_functions_t* audio_out_drivers[] = +static const ao_functions_t* audio_out_drivers[] = { #ifdef USE_OSS_AUDIO &audio_out_oss, @@ -184,18 +184,17 @@ const ao_functions_t* __FASTCALL__ ao_register(const char *driver_name) { - unsigned i; - if(!driver_name) - audio_out=audio_out_drivers[0]; - else - for (i=0; audio_out_drivers[i] != NULL; i++) - { - const ao_info_t *info = audio_out_drivers[i]->info; - if(strcmp(info->short_name,driver_name) == 0){ - audio_out = audio_out_drivers[i];break; + unsigned i; + if(!driver_name) + audio_out=audio_out_drivers[0]; + else + for (i=0; audio_out_drivers[i] != &audio_out_null; i++) { + const ao_info_t *info = audio_out_drivers[i]->info; + if(strcmp(info->short_name,driver_name) == 0){ + audio_out = audio_out_drivers[i];break; + } } - } - return audio_out; + return audio_out; } const ao_info_t* ao_get_info( void ) Modified: mplayerxp/libmpcodecs/ad.c =================================================================== --- mplayerxp/libmpcodecs/ad.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpcodecs/ad.c 2012-11-11 11:47:09 UTC (rev 326) @@ -34,8 +34,7 @@ extern const ad_functions_t mpcodecs_ad_dmo; extern const ad_functions_t mpcodecs_ad_qtaudio; -const ad_functions_t* mpcodecs_ad_drivers[] = { - &mpcodecs_ad_null, +static const ad_functions_t* mpcodecs_ad_drivers[] = { &mpcodecs_ad_mp3, &mpcodecs_ad_a52, &mpcodecs_ad_dca, @@ -58,22 +57,33 @@ &mpcodecs_ad_dmo, &mpcodecs_ad_qtaudio, #endif - NULL + &mpcodecs_ad_null, + }; static unsigned int nddrivers=sizeof(mpcodecs_ad_drivers)/sizeof(ad_functions_t*); void libmpcodecs_ad_register_options(m_config_t* cfg) { - unsigned i; - for(i=0;i<nddrivers;i++) - { - if(mpcodecs_ad_drivers[i]) - if(mpcodecs_ad_drivers[i]->options) - m_config_register_options(cfg,mpcodecs_ad_drivers[i]->options); - } + unsigned i; + for(i=0;i<nddrivers;i++) { + if(mpcodecs_ad_drivers[i]) + if(mpcodecs_ad_drivers[i]->options) + m_config_register_options(cfg,mpcodecs_ad_drivers[i]->options); + if(mpcodecs_ad_drivers[i]==&mpcodecs_ad_null) break; + } } +const ad_functions_t* afm_find_driver(const char *name) { + unsigned i; + for (i=0; mpcodecs_ad_drivers[i] != &mpcodecs_ad_null; i++) { + if(strcmp(mpcodecs_ad_drivers[i]->info->driver_name,name)==0){ + return mpcodecs_ad_drivers[i]; + } + } + return NULL; +} + void afm_help(void) { unsigned i; MSG_INFO("Available audio codec families/drivers:\n"); Modified: mplayerxp/libmpcodecs/ad.h =================================================================== --- mplayerxp/libmpcodecs/ad.h 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpcodecs/ad.h 2012-11-11 11:47:09 UTC (rev 326) @@ -32,7 +32,7 @@ unsigned (* __FASTCALL__ decode)(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts); } ad_functions_t; -extern const ad_functions_t* mpcodecs_ad_drivers[]; +extern const ad_functions_t* afm_find_driver(const char *name); #define FIX_APTS(sh_audio,pts,in_size) (sh_audio->i_bps?((float)(pts)+(float)(in_size)/(float)sh_audio->i_bps):((float)(pts))) #endif Modified: mplayerxp/libmpcodecs/dec_audio.c =================================================================== --- mplayerxp/libmpcodecs/dec_audio.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpcodecs/dec_audio.c 2012-11-11 11:47:09 UTC (rev 326) @@ -28,23 +28,9 @@ static const ad_functions_t* mpadec; -const ad_functions_t* mpca_find_driver(const char *name) { - unsigned i; - for (i=0; mpcodecs_ad_drivers[i] != NULL; i++) { - if(strcmp(mpcodecs_ad_drivers[i]->info->driver_name,name)==0){ - return mpcodecs_ad_drivers[i]; - } - } - return NULL; -} - MPXP_Rc mpca_init(sh_audio_t *sh_audio) { - unsigned i; - for (i=0; mpcodecs_ad_drivers[i] != NULL; i++) - if(strcmp(mpcodecs_ad_drivers[i]->info->driver_name,sh_audio->codec->driver_name)==0){ - mpadec=mpcodecs_ad_drivers[i]; break; - } + mpadec=afm_find_driver(sh_audio->codec->driver_name); if(!mpadec){ MSG_ERR(MSGTR_CODEC_BAD_AFAMILY,sh_audio->codec->codec_name, sh_audio->codec->driver_name); return MPXP_False; // no such driver Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpcodecs/dec_video.c 2012-11-11 11:47:09 UTC (rev 326) @@ -86,13 +86,6 @@ static unsigned smp_num_cpus=1; static unsigned use_vf_threads=0; -static const vd_functions_t* mpcv_find_driver_by_name(const char *name) { - unsigned i; - for (i=0; mpcodecs_vd_drivers[i] != NULL; i++) - if(strcmp(mpcodecs_vd_drivers[i]->info->driver_name,name)==0) break; - return mpcodecs_vd_drivers[i]; -} - static void mpcv_print_codec_info(sh_video_t* sh_video) { MSG_OK("[VC] %s decoder: [%s] drv:%s.%s (%dx%d (aspect %g) %4.2ffps\n" ,mp_conf.video_codec?"Forcing":"Selected" @@ -121,9 +114,14 @@ MPXP_Rc mpcv_ffmpeg_init(sh_video_t*sh_video,any_t* libinput) { /* Use ffmpeg's drivers as last hope */ - mpvdec=mpcv_find_driver_by_name("ffmpeg"); - if(mpvdec->init(sh_video,libinput)!=MPXP_Ok){ - MSG_ERR(MSGTR_CODEC_CANT_INITV); + mpvdec=vfm_find_driver("ffmpeg"); + if(mpvdec) { + if(mpvdec->init(sh_video,libinput)!=MPXP_Ok){ + MSG_ERR(MSGTR_CODEC_CANT_INITV); + return MPXP_False; + } + } else { + MSG_ERR("Cannot find ffmpeg video decoder\n"); return MPXP_False; } mpcv_print_codec_info(sh_video); @@ -155,7 +153,7 @@ } sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it // ok, it matches all rules, let's find the driver! - if(!(mpvdec=mpcv_find_driver_by_name(sh_video->codec->driver_name))) continue; + if(!(mpvdec=vfm_find_driver(sh_video->codec->driver_name))) continue; else MSG_DBG3("mpcv_init: mpcodecs_vd_drivers[%s]->mpvdec==0\n",mpcodecs_vd_drivers[i]->info->driver_name); // it's available, let's try to init! if(mpvdec->init(sh_video,libinput)!=MPXP_Ok){ Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpcodecs/vd.c 2012-11-11 11:47:09 UTC (rev 326) @@ -41,8 +41,7 @@ extern const vd_functions_t mpcodecs_vd_qtvideo; extern const vd_functions_t mpcodecs_vd_theora; -const vd_functions_t* mpcodecs_vd_drivers[] = { - &mpcodecs_vd_null, +static const vd_functions_t* mpcodecs_vd_drivers[] = { &mpcodecs_vd_ffmpeg, #ifdef HAVE_WIN32LOADER &mpcodecs_vd_dshow, @@ -66,6 +65,7 @@ #ifdef HAVE_LIBDV &mpcodecs_vd_libdv, #endif + &mpcodecs_vd_null, NULL }; static unsigned int nddrivers=sizeof(mpcodecs_vd_drivers)/sizeof(vd_functions_t*); @@ -77,9 +77,18 @@ if(mpcodecs_vd_drivers[i]) if(mpcodecs_vd_drivers[i]->options) m_config_register_options(cfg,mpcodecs_vd_drivers[i]->options); + if(mpcodecs_vd_drivers[i]==&mpcodecs_vd_null) break; } } +const vd_functions_t* vfm_find_driver(const char *name) { + unsigned i; + for (i=0; mpcodecs_vd_drivers[i] != &mpcodecs_vd_null; i++) + if(strcmp(mpcodecs_vd_drivers[i]->info->driver_name,name)==0) + return mpcodecs_vd_drivers[i]; + return NULL; +} + void vfm_help(void) { unsigned i; MSG_INFO("Available video codec families/drivers:\n"); Modified: mplayerxp/libmpcodecs/vd.h =================================================================== --- mplayerxp/libmpcodecs/vd.h 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpcodecs/vd.h 2012-11-11 11:47:09 UTC (rev 326) @@ -23,8 +23,7 @@ mp_image_t* (*__FASTCALL__ decode)(sh_video_t *sh,const enc_frame_t* frame); } vd_functions_t; -// NULL terminated array of all drivers -extern const vd_functions_t* mpcodecs_vd_drivers[]; +const vd_functions_t* vfm_find_driver(const char *name); enum { VDCTRL_QUERY_FORMAT =3, /* test for availabilty of a format */ Modified: mplayerxp/libmpdemux/Makefile =================================================================== --- mplayerxp/libmpdemux/Makefile 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpdemux/Makefile 2012-11-11 11:47:09 UTC (rev 326) @@ -39,7 +39,7 @@ SRCS += mpdemux.c demux_bmp.c demux_rawaudio.c demux_aiff.c demux_vqf.c SRCS += demux_pva.c demux_rawvideo.c demux_smjpeg.c demux_ts.c demux_ty.c demux_nsv.c SRCS += demux_mkv.c demux_mpxp64.c sub_cc.c sub_ty.c -SRCS += demux_lavf.c +SRCS += demux_lavf.c demux_null.c ifeq ($(HAVE_LIBVORBIS),yes) SRCS += demux_ogg.c endif Added: mplayerxp/libmpdemux/demux_null.c =================================================================== --- mplayerxp/libmpdemux/demux_null.c (rev 0) +++ mplayerxp/libmpdemux/demux_null.c 2012-11-11 11:47:09 UTC (rev 326) @@ -0,0 +1,54 @@ +#include "mp_config.h" + +#include <stdlib.h> +#include <stdio.h> + +#include "stream.h" +#include "demuxer.h" +#include "stheader.h" +#include "libmpconf/cfgparser.h" + +static const config_t demux_null_opts[] = { + {NULL, NULL, 0, 0, 0, 0, NULL} +}; + +static const config_t null_conf[] = { + { "null", &demux_null_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, "Null specific commands"}, + { NULL,NULL, 0, 0, 0, 0, NULL} +}; + +static int null_probe(demuxer_t* demuxer) +{ + return 0; +} + +static demuxer_t* null_open(demuxer_t* demuxer) { + return NULL; +} + +static int null_demux(demuxer_t* demuxer, demux_stream_t *ds) { + return 0; +} + +static void null_seek(demuxer_t *demuxer,const seek_args_t* seeka){ +} + +static void null_close(demuxer_t* demuxer) {} + +static int null_control(demuxer_t *demuxer,int cmd,any_t*args) +{ + return DEMUX_UNKNOWN; +} + +demuxer_driver_t demux_null = +{ + "NULL parser", + "...", + null_conf, + null_probe, + null_open, + null_demux, + null_seek, + null_close, + null_control +}; Property changes on: mplayerxp/libmpdemux/demux_null.c ___________________________________________________________________ Added: svn:eol-style + native Modified: mplayerxp/libmpdemux/demuxer.c =================================================================== --- mplayerxp/libmpdemux/demuxer.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libmpdemux/demuxer.c 2012-11-11 11:47:09 UTC (rev 326) @@ -53,8 +53,9 @@ extern demuxer_driver_t demux_ty; extern demuxer_driver_t demux_audio; extern demuxer_driver_t demux_lavf; +extern demuxer_driver_t demux_null; -static demuxer_driver_t *ddrivers[] = +static const demuxer_driver_t *ddrivers[] = { &demux_rawaudio, &demux_rawvideo, @@ -84,27 +85,27 @@ &demux_audio, &demux_mpgts, &demux_ty, - &demux_lavf + &demux_lavf, + &demux_null, + NULL }; -static unsigned int nddrivers=sizeof(ddrivers)/sizeof(demuxer_driver_t*); typedef struct demuxer_info_st { - char *id[INFOT_MAX]; + char *id[INFOT_MAX]; } demuxer_info_t; void libmpdemux_register_options(m_config_t* cfg) { - unsigned i; - for(i=0;i<nddrivers;i++) - { - if(ddrivers[i]->options) - m_config_register_options(cfg,ddrivers[i]->options); - } + unsigned i; + for(i=0;ddrivers[i];i++) { + if(ddrivers[i]->options) + m_config_register_options(cfg,ddrivers[i]->options); + if(ddrivers[i]==&demux_null) break; + } } void free_demuxer_stream(demux_stream_t *ds){ - if(ds) - { + if(ds) { ds_free_packs(ds); mp_free(ds); } @@ -159,8 +160,7 @@ sh_audio_t *get_sh_audio(demuxer_t *demuxer, int id) { - if(id > MAX_A_STREAMS-1 || id < 0) - { + if(id > MAX_A_STREAMS-1 || id < 0) { MSG_WARN("Requested audio stream id overflow (%d > %d)\n", id, MAX_A_STREAMS); return NULL; @@ -169,13 +169,12 @@ } sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid){ - if(id > MAX_A_STREAMS-1 || id < 0) - { + if(id > MAX_A_STREAMS-1 || id < 0) { MSG_WARN("Requested audio stream id overflow (%d > %d)\n", id, MAX_A_STREAMS); return NULL; } - if(demuxer->a_streams[id]){ + if(demuxer->a_streams[id]) { MSG_WARN(MSGTR_AudioStreamRedefined,id); } else { sh_audio_t *sh; @@ -199,8 +198,7 @@ sh_video_t *get_sh_video(demuxer_t *demuxer, int id) { - if(id > MAX_V_STREAMS-1 || id < 0) - { + if(id > MAX_V_STREAMS-1 || id < 0) { MSG_WARN("Requested video stream id overflow (%d > %d)\n", id, MAX_V_STREAMS); return NULL; @@ -209,13 +207,12 @@ } sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid){ - if(id > MAX_V_STREAMS-1 || id < 0) - { + if(id > MAX_V_STREAMS-1 || id < 0) { MSG_WARN("Requested video stream id overflow (%d > %d)\n", id, MAX_V_STREAMS); return NULL; } - if(demuxer->v_streams[id]){ + if(demuxer->v_streams[id]) { MSG_WARN(MSGTR_VideoStreamRedefined,id); } else { MSG_V("==> Found video stream: %d\n",id); @@ -263,11 +260,10 @@ // dp->pts=pts; //(float)pts/90000.0f; // dp->pos=pos; // append packet to DS stream: - if(dp->len>0) - { + if(dp->len>0) { ++ds->packs; ds->bytes+=dp->len; - if(ds->last){ + if(ds->last) { // next packet in stream ds->last->next=dp; ds->last=dp; @@ -309,7 +305,7 @@ demuxer_t *demux=ds->demuxer; if(ds->buffer) mp_free(ds->buffer); /* ds_free_packs(ds); */ - if(mp_conf.verbose>2){ + if(mp_conf.verbose>2) { if(ds==demux->audio) MSG_DBG3("ds_fill_buffer(d_audio) called\n"); else @@ -543,16 +539,14 @@ pts_from_bps=0; demux_aid_vid_mismatch = 0; i=0; - again: - for(;i<nddrivers;i++) - { +again: + for(;ddrivers[i]!=&demux_null;i++) { /* don't remove it from loop!!! (for initializing) */ demuxer = new_demuxer(stream,DEMUXER_TYPE_UNKNOWN,audio_id,video_id,dvdsub_id); MSG_V("Probing %s ... ",ddrivers[i]->name); stream_reset(demuxer->stream); stream_seek(demuxer->stream,demuxer->stream->start_pos); - if(ddrivers[i]->probe(demuxer)) - { + if(ddrivers[i]->probe(demuxer)) { MSG_V("OK\n"); demuxer->driver = ddrivers[i]; break; @@ -560,15 +554,13 @@ MSG_V("False\n"); FREE_DEMUXER(demuxer); } - if(!demuxer || !demuxer->driver) - { + if(!demuxer || !demuxer->driver) { MSG_ERR(MSGTR_FormatNotRecognized); FREE_DEMUXER(demuxer); return NULL; } - if(!(new_demux=demuxer->driver->open(demuxer))) - { + if(!(new_demux=demuxer->driver->open(demuxer))) { MSG_ERR("Can't open stream with '%s'\n", demuxer->driver->name); demuxer->driver=NULL; i++; @@ -577,13 +569,10 @@ demuxer=new_demux; MSG_OK("Using: %s\n",demuxer->driver->name); for(i=0;i<sizeof(stream_txt_ids)/sizeof(struct s_stream_txt_ids);i++) - if(!demux_info_get(demuxer,stream_txt_ids[i].demuxer_id)) - { + if(!demux_info_get(demuxer,stream_txt_ids[i].demuxer_id)) { char stream_name[256]; - if(demuxer->stream->driver->control) - { - if(demuxer->stream->driver->control(demuxer->stream,stream_txt_ids[i].stream_id,stream_name) == SCTRL_OK) - { + if(demuxer->stream->driver->control) { + if(demuxer->stream->driver->control(demuxer->stream,stream_txt_ids[i].stream_id,stream_name) == SCTRL_OK) { demux_info_add(demuxer,stream_txt_ids[i].demuxer_id,stream_name); } } Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libvo/video_out.c 2012-11-11 11:47:09 UTC (rev 326) @@ -66,7 +66,7 @@ extern vo_functions_t video_out_xvidix; #endif -const vo_functions_t* video_out_drivers[] = +static const vo_functions_t* video_out_drivers[] = { #ifdef HAVE_XV &video_out_xv, @@ -152,17 +152,16 @@ const vo_functions_t *vo_register(vo_data_t*vo,const char *driver_name) { - unsigned i; - if(!driver_name) - video_out=video_out_drivers[0]; - else - for (i=0; video_out_drivers[i] != NULL; i++){ - const vo_info_t *info = video_out_drivers[i]->get_info (vo); - if(strcmp(info->short_name,driver_name) == 0){ - video_out = video_out_drivers[i];break; + unsigned i; + if(!driver_name) video_out=video_out_drivers[0]; + else + for (i=0; video_out_drivers[i] != &video_out_null; i++){ + const vo_info_t *info = video_out_drivers[i]->get_info (vo); + if(strcmp(info->short_name,driver_name) == 0){ + video_out = video_out_drivers[i];break; + } } - } - return video_out; + return video_out; } const vo_info_t* vo_get_info(vo_data_t*vo) Modified: mplayerxp/libvo/video_out.h =================================================================== --- mplayerxp/libvo/video_out.h 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/libvo/video_out.h 2012-11-11 11:47:09 UTC (rev 326) @@ -279,8 +279,4 @@ unsigned y_mul[4],y_div[4]; }vo_format_desc; extern int __FASTCALL__ vo_describe_fourcc(uint32_t fourcc,vo_format_desc *vd); - -// NULL terminated array of all drivers -extern const vo_functions_t* video_out_drivers[]; - #endif Modified: mplayerxp/mplayerxp.c =================================================================== --- mplayerxp/mplayerxp.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/mplayerxp.c 2012-11-11 11:47:09 UTC (rev 326) @@ -1132,7 +1132,7 @@ } if(mp_conf.audio_codec && strcmp(sh_audio->codec->codec_name,mp_conf.audio_codec)) continue; else if(mp_conf.audio_family && strcmp(sh_audio->codec->driver_name,mp_conf.audio_family)) continue; - if(mpca_find_driver(sh_audio->codec->driver_name)) { + if(afm_find_driver(sh_audio->codec->driver_name)) { MSG_V("%s audio codec: [%s] drv:%s (%s)\n",mp_conf.audio_codec?"Forcing":"Detected",sh_audio->codec->codec_name,sh_audio->codec->driver_name,sh_audio->codec->s_info); found=1; break; Modified: mplayerxp/osdep/mp_malloc.c =================================================================== --- mplayerxp/osdep/mp_malloc.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/osdep/mp_malloc.c 2012-11-11 11:47:09 UTC (rev 326) @@ -173,11 +173,12 @@ } return NULL; } -static __always_inline void print_backtrace(void) { + +static __always_inline void __print_backtrace(unsigned num) { bt_cache_t* cache=init_bt_cache(); - any_t* calls[10]; + any_t* calls[num]; unsigned i,ncalls; - ncalls=backtrace(calls,10); + ncalls=backtrace(calls,num); MSG_INFO("*** Backtrace for suspect call ***\n"); for(i=0;i<ncalls;i++) { MSG_INFO(" %p -> %s\n",calls[i],addr2line(cache,calls[i])); @@ -185,13 +186,15 @@ uninit_bt_cache(cache); } +void print_backtrace(unsigned num) { __print_backtrace(num); } + static void __prot_free_append(any_t*ptr) { any_t *page_ptr=prot_page_align(ptr); mp_slot_t* slot=prot_find_slot(&priv->mallocs,page_ptr); if(!slot) { printf("[__prot_free_append] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,page_ptr); __prot_print_slots(&priv->mallocs); - print_backtrace(); + __print_backtrace(10); kill(getpid(), SIGILL); } size_t fullsize=app_fullsize(slot->size); @@ -208,7 +211,7 @@ if(!slot) { printf("[__prot_realloc_append] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,prot_page_align(ptr)); __prot_print_slots(&priv->mallocs); - print_backtrace(); + __print_backtrace(10); kill(getpid(), SIGILL); } memcpy(rp,ptr,min(slot->size,size)); @@ -242,7 +245,7 @@ if(!slot) { printf("[__prot_free_prepend] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,page_ptr); __prot_print_slots(&priv->mallocs); - print_backtrace(); + __print_backtrace(10); kill(getpid(), SIGILL); } mprotect(page_ptr,__VM_PAGE_SIZE__,MP_PROT_READ|MP_PROT_WRITE); @@ -257,7 +260,7 @@ if(!slot) { printf("[__prot_realloc_prepend] suspect call found! Can't find slot for address: %p [aligned: %p]\n",ptr,pre_page_align(ptr)); __prot_print_slots(&priv->mallocs); - print_backtrace(); + __print_backtrace(10); kill(getpid(), SIGILL); } memcpy(rp,ptr,min(slot->size,size)); @@ -489,5 +492,5 @@ int __FASTCALL__ mp_mprotect(const any_t* addr,size_t len,enum mp_prot_e flags) { - return mprotect(addr,len,flags); + return mprotect((any_t*)addr,len,flags); } Modified: mplayerxp/osdep/mplib.h =================================================================== --- mplayerxp/osdep/mplib.h 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/osdep/mplib.h 2012-11-11 11:47:09 UTC (rev 326) @@ -61,4 +61,6 @@ MP_DENY_ALL =0x0, /* Page can not be accessed. */ }; extern int __FASTCALL__ mp_mprotect(const any_t* addr,size_t len,enum mp_prot_e flags); + +extern void print_backtrace(unsigned num); #endif Modified: mplayerxp/postproc/Makefile =================================================================== --- mplayerxp/postproc/Makefile 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/postproc/Makefile 2012-11-11 11:47:09 UTC (rev 326) @@ -7,9 +7,20 @@ DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done SRCS=postprocess.c swscale.c -SRCS+=af.c af_ao2.c af_crystality.c af_dummy.c af_delay.c af_channels.c af_format.c af_resample.c af_volume.c af_equalizer.c af_tools.c af_comp.c af_gate.c af_pan.c af_surround.c af_sub.c af_export.c af_volnorm.c af_extrastereo.c af_lp.c af_dyn.c af_echo3d.c af_hrtf.c af_ffenc.c af_raw.c af_karaoke.c af_center.c af_sinesuppress.c af_scaletempo.c +SRCS+=af.c af_ao2.c af_crystality.c af_dummy.c af_delay.c af_channels.c +SRCS+=af_format.c af_resample.c af_volume.c af_equalizer.c af_tools.c af_comp.c +SRCS+=af_gate.c af_pan.c af_surround.c af_sub.c af_export.c af_volnorm.c +SRCS+=af_extrastereo.c af_lp.c af_dyn.c af_echo3d.c af_hrtf.c af_ffenc.c +SRCS+=af_raw.c af_karaoke.c af_center.c af_sinesuppress.c af_scaletempo.c +SRCS+=af_null.c SRCS+=aflib.c -SRCS+=vf.c vf_vo.c vf_expand.c vf_flip.c vf_format.c vf_yuy2.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_eq.c vf_dint.c vf_1bpp.c vf_unsharp.c vf_swapuv.c vf_il.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_denoise3d.c vf_aspect.c vf_softpulldown.c vf_delogo.c vf_yuvcsp.c vf_pp.c vf_scale.c vf_panscan.c vf_raw.c vf_ow.c vf_2xsai.c vf_framestep.c vf_menu.c +SRCS+=vf.c vf_vo.c vf_expand.c vf_flip.c vf_format.c vf_yuy2.c vf_rgb2bgr.c +SRCS+=vf_rotate.c vf_mirror.c vf_palette.c vf_test.c vf_noise.c vf_yvu9.c +SRCS+=vf_rectangle.c vf_eq.c vf_dint.c vf_1bpp.c vf_unsharp.c vf_swapuv.c +SRCS+=vf_il.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_denoise3d.c +SRCS+=vf_aspect.c vf_softpulldown.c vf_delogo.c vf_yuvcsp.c vf_pp.c vf_scale.c +SRCS+=vf_panscan.c vf_raw.c vf_ow.c vf_2xsai.c vf_framestep.c vf_menu.c +SRCS+=vf_null.c OBJS=$(SRCS:.c=.o) CFLAGS = $(OPTFLAGS) -I. -I.. -Wall Modified: mplayerxp/postproc/af.c =================================================================== --- mplayerxp/postproc/af.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/postproc/af.c 2012-11-11 11:47:09 UTC (rev 326) @@ -40,8 +40,9 @@ extern const af_info_t af_info_karaoke; extern const af_info_t af_info_sinesuppress; extern const af_info_t af_info_scaletempo; +extern const af_info_t af_info_null; -static const af_info_t* filter_list[]={ +static const af_info_t* filter_list[]={ &af_info_ao, &af_info_center, &af_info_channels, @@ -72,6 +73,7 @@ &af_info_ffenc, &af_info_scaletempo, &af_info_raw, + &af_info_null, NULL }; @@ -80,10 +82,10 @@ /* Find a filter in the static list of filters using it's name. This function is used internally */ -static const af_info_t* __FASTCALL__ af_find(char*name) +static const af_info_t* __FASTCALL__ af_find(const char* name) { int i=0; - while(filter_list[i]){ + while(filter_list[i]!=&af_info_null){ if(!strcmp(filter_list[i]->name,name)) return filter_list[i]; i++; @@ -94,7 +96,7 @@ /* Find filter in the dynamic filter list using it's name This function is used for finding already initialized filters */ -af_instance_t* __FASTCALL__ af_get(af_stream_t* s, char* name) +af_instance_t* __FASTCALL__ af_get(af_stream_t* s,const char* name) { af_instance_t* af=s->first; // Find the filter @@ -108,7 +110,7 @@ /*/ Function for creating a new filter of type name. The name may contain the commandline parameters for the filter */ -static af_instance_t* __FASTCALL__ af_create(af_stream_t* s, char* name) +static af_instance_t* __FASTCALL__ af_create(af_stream_t* s,const char* name) { char* cmdline = name; @@ -159,7 +161,7 @@ /* Create and insert a new filter of type name before the filter in the argument. This function can be called during runtime, the return value is the new filter */ -static af_instance_t* __FASTCALL__ af_prepend(af_stream_t* s, af_instance_t* af, char* name) +static af_instance_t* __FASTCALL__ af_prepend(af_stream_t* s, af_instance_t* af,const char* name) { // Create the new filter and make sure it is OK af_instance_t* new=af_create(s,name); @@ -184,7 +186,7 @@ /* Create and insert a new filter of type name after the filter in the argument. This function can be called during runtime, the return value is the new filter */ -af_instance_t* af_append(af_stream_t* s, af_instance_t* af, char* name) +static af_instance_t* af_append(af_stream_t* s, af_instance_t* af,const char* name) { // Create the new filter and make sure it is OK af_instance_t* new=af_create(s,name); @@ -325,8 +327,8 @@ } // Check if there are any filters left in the list if(NULL == af){ - if(!(af=af_append(s,s->first,"dummy"))) - return -1; + if(!(af=af_append(s,s->first,"dummy"))) + return -1; } else af=af->next; @@ -476,7 +478,7 @@ to the stream s. The filter will be inserted somewhere nice in the list of filters. The return value is a pointer to the new filter, If the filter couldn't be added the return value is NULL. */ -af_instance_t* af_add(af_stream_t* s, char* name){ +af_instance_t* af_add(af_stream_t* s,const char* name){ af_instance_t* new; // Sanity check if(!s || !s->first || !name) Modified: mplayerxp/postproc/af.h =================================================================== --- mplayerxp/postproc/af.h 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/postproc/af.h 2012-11-11 11:47:09 UTC (rev 326) @@ -125,14 +125,14 @@ to the stream s. The filter will be inserted somewhere nice in the list of filters. The return value is a pointer to the new filter, If the filter couldn't be added the return value is NULL. */ -af_instance_t* af_add(af_stream_t* s, char* name); +af_instance_t* af_add(af_stream_t* s,const char* name); // Uninit and remove the filter "af" void af_remove(af_stream_t* s, af_instance_t* af); /* Find filter in the dynamic filter list using it's name This function is used for finding already initialized filters */ -af_instance_t* __FASTCALL__ af_get(af_stream_t* s, char* name); +af_instance_t* __FASTCALL__ af_get(af_stream_t* s,const char* name); // Filter data chunk through the filters in the list mp_aframe_t* __FASTCALL__ af_play(af_stream_t* s, mp_aframe_t* data); Added: mplayerxp/postproc/af_null.c =================================================================== --- mplayerxp/postproc/af_null.c (rev 0) +++ mplayerxp/postproc/af_null.c 2012-11-11 11:47:09 UTC (rev 326) @@ -0,0 +1,16 @@ +#include "af.h" + +// Allocate memory and set function pointers +static MPXP_Rc open(af_instance_t* af){ + return MPXP_Error; +} + +// Description of this filter +const af_info_t af_info_null = { + "Null audio filter", + "null", + "Nickols_K", + "", + AF_FLAGS_REENTRANT, + open +}; Property changes on: mplayerxp/postproc/af_null.c ___________________________________________________________________ Added: svn:eol-style + native Modified: mplayerxp/postproc/vf.c =================================================================== --- mplayerxp/postproc/vf.c 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/postproc/vf.c 2012-11-11 11:47:09 UTC (rev 326) @@ -57,6 +57,7 @@ extern const vf_info_t vf_info_yuvcsp; extern const vf_info_t vf_info_yuy2; extern const vf_info_t vf_info_yvu9; +extern const vf_info_t vf_info_null; // list of available filters: static const vf_info_t* filter_list[]={ @@ -98,6 +99,7 @@ &vf_info_yuvcsp, &vf_info_yuy2, &vf_info_yvu9, + &vf_info_null, NULL }; @@ -278,18 +280,18 @@ return 1;//vf_next_query_format(vf,fmt,w,h); } -vf_instance_t* __FASTCALL__ vf_open_plugin(const vf_info_t** _filter_list,vf_instance_t* next,sh_video_t *sh,char *name, char *args,any_t* libinput){ +static vf_instance_t* __FASTCALL__ vf_open_plugin(vf_instance_t* next,sh_video_t *sh,const char *name,const char *args,any_t* libinput){ vf_instance_t* vf; int i; for(i=0;;i++){ - if(!_filter_list[i]){ + if(filter_list[i]==&vf_info_null){ MSG_ERR("Can't find video filter: %s\n",name); return NULL; // no such filter! } - if(!strcmp(_filter_list[i]->name,name)) break; + if(!strcmp(filter_list[i]->name,name)) break; } vf=mp_mallocz(sizeof(vf_instance_t)); - vf->info=_filter_list[i]; + vf->info=filter_list[i]; vf->next=next; vf->prev=NULL; vf->config=vf_next_config; @@ -310,11 +312,11 @@ return NULL; } -vf_instance_t* __FASTCALL__ vf_open_filter(vf_instance_t* next,sh_video_t *sh,char *name, char *args,any_t*libinput){ +vf_instance_t* __FASTCALL__ vf_open_filter(vf_instance_t* next,sh_video_t *sh,const char *name,const char *args,any_t*libinput){ if(strcmp(name,"vo")) { MSG_V("Open video filter: [%s]\n", name); } - return vf_open_plugin(filter_list,next,sh,name,args,libinput); + return vf_open_plugin(next,sh,name,args,libinput); } //============================================================================ @@ -422,9 +424,6 @@ //============================================================================ vf_instance_t* __FASTCALL__ append_filters(vf_instance_t* last){ - vf_instance_t* vf; - int i; - return last; } @@ -475,7 +474,7 @@ arg=strchr(vf_last,'='); if(arg) { *arg=0; arg++; } MSG_V("Attach filter %s\n",vf_last); - vfi=vf_open_plugin(filter_list,vfi,sh,vf_last,arg,libinput); + vfi=vf_open_plugin(vfi,sh,vf_last,arg,libinput); if(!vfi) vfi=vfi_prev; vfi_prev=vfi; } Modified: mplayerxp/postproc/vf.h =================================================================== --- mplayerxp/postproc/vf.h 2012-11-11 10:14:52 UTC (rev 325) +++ mplayerxp/postproc/vf.h 2012-11-11 11:47:09 UTC (rev 326) @@ -104,9 +104,8 @@ mp_image_t* __FASTCALL__ vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h,unsigned idx); int __FASTCALL__ vf_query_format(vf_instance_t* vf, unsigned int fmt,unsigned width,unsigned height); -vf_instance_t* __FASTCALL__ vf_open_plugin(const vf_info_t** filter_list, vf_instance_t* next,sh_video_t *sh, char *name, char *args,any_t*libinput); -vf_instance_t* __FASTCALL__ vf_open_filter(vf_instance_t* next,sh_video_t *sh,char *name, char *args,any_t*libinput); -vf_instance_t* __FASTCALL__ vf_open_encoder(vf_instance_t* next, char *name, char *args); +vf_instance_t* __FASTCALL__ vf_open_filter(vf_instance_t* next,sh_video_t *sh,const char *name,const char *args,any_t*libinput); +vf_instance_t* __FASTCALL__ vf_open_encoder(vf_instance_t* next,const char *name,const char *args); unsigned int __FASTCALL__ vf_match_csp(vf_instance_t** vfp,unsigned int* list,unsigned int preferred,unsigned w,unsigned h); void __FASTCALL__ vf_clone_mpi_attributes(mp_image_t* dst, mp_image_t* src); Added: mplayerxp/postproc/vf_null.c =================================================================== --- mplayerxp/postproc/vf_null.c (rev 0) +++ mplayerxp/postproc/vf_null.c 2012-11-11 11:47:09 UTC (rev 326) @@ -0,0 +1,17 @@ +#include "mp_config.h" +#include "vf.h" + +static MPXP_Rc __FASTCALL__ vf_open(vf_instance_t *vf,const char* args){ + return MPXP_False; +} + +const vf_info_t vf_info_null = { + "null filter", + "null", + "Nickols_K", + "", + VF_FLAGS_THREADS, + vf_open +}; + +//===========================================================================// Property changes on: mplayerxp/postproc/vf_null.c ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |