[MPlayer-cvslog] r20922 - in trunk: libmpcodecs/vf.h libmpcodecs/vf_vo.c mplayer.c
uau
subversion at mplayerhq.hu
Tue Nov 14 15:02:55 CET 2006
Author: uau
Date: Tue Nov 14 15:02:55 2006
New Revision: 20922
Modified:
trunk/libmpcodecs/vf.h
trunk/libmpcodecs/vf_vo.c
trunk/mplayer.c
Log:
Use vf control for reading pts from vf_vo
Modified: trunk/libmpcodecs/vf.h
==============================================================================
--- trunk/libmpcodecs/vf.h (original)
+++ trunk/libmpcodecs/vf.h Tue Nov 14 15:02:55 2006
@@ -79,6 +79,7 @@
#define VFCTRL_SCREENSHOT 14 /* Make a screenshot */
#define VFCTRL_INIT_EOSD 15 /* Select EOSD renderer */
#define VFCTRL_DRAW_EOSD 16 /* Render EOSD */
+#define VFCTRL_GET_PTS 17 /* Return last pts value that reached vf_vo*/
#include "vfcap.h"
Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c (original)
+++ trunk/libmpcodecs/vf_vo.c Tue Nov 14 15:02:55 2006
@@ -21,18 +21,14 @@
extern int sub_visibility;
extern float sub_delay;
-typedef struct vf_vo_data_s {
+struct vf_priv_s {
double pts;
vo_functions_t *vo;
-} vf_vo_data_t;
-
-struct vf_priv_s {
- vf_vo_data_t* vf_vo_data;
#ifdef USE_ASS
ass_renderer_t* ass_priv;
#endif
};
-#define video_out (vf->priv->vf_vo_data->vo)
+#define video_out (vf->priv->vo)
static int query_format(struct vf_instance_s* vf, unsigned int fmt); /* forward declaration */
@@ -115,7 +111,7 @@
case VFCTRL_DRAW_EOSD:
{
ass_image_t* images = 0;
- double pts = vf->priv->vf_vo_data->pts;
+ double pts = vf->priv->pts;
if (!vo_config_count || !vf->priv->ass_priv) return CONTROL_FALSE;
if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE)) {
mp_eosd_res_t res;
@@ -130,6 +126,11 @@
return (video_out->control(VOCTRL_DRAW_EOSD, images) == VO_TRUE) ? CONTROL_TRUE : CONTROL_FALSE;
}
#endif
+ case VFCTRL_GET_PTS:
+ {
+ *(double *)data = vf->priv->pts;
+ return CONTROL_TRUE;
+ }
}
// return video_out->control(request,data);
return CONTROL_UNKNOWN;
@@ -154,7 +155,7 @@
mp_image_t *mpi, double pts){
if(!vo_config_count) return 0; // vo not configured?
// record pts (potentially modified by filters) for main loop
- vf->priv->vf_vo_data->pts = pts;
+ vf->priv->pts = pts;
// first check, maybe the vo/vf plugin implements draw_image using mpi:
if(video_out->control(VOCTRL_DRAW_IMAGE,mpi)==VO_TRUE) return 1; // done.
// nope, fallback to old draw_frame/draw_slice:
@@ -203,7 +204,7 @@
vf->start_slice=start_slice;
vf->uninit=uninit;
vf->priv=calloc(1, sizeof(struct vf_priv_s));
- vf->priv->vf_vo_data=(vf_vo_data_t*)args;
+ vf->priv->vo = (vo_functions_t *)args;
if(!video_out) return 0; // no vo ?
// if(video_out->preinit(args)) return 0; // preinit failed
return 1;
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c (original)
+++ trunk/mplayer.c Tue Nov 14 15:02:55 2006
@@ -3084,8 +3084,6 @@
int gui_no_filename=0;
-struct {double pts; vo_functions_t *vo;} vf_vo_data;
-
srand((int) time(NULL));
InitTimer();
@@ -4107,10 +4105,9 @@
inited_flags|=INITED_VO;
}
-vf_vo_data.vo = video_out;
current_module="init_video_filters";
{
- char* vf_arg[] = { "_oldargs_", (char*)&vf_vo_data , NULL };
+ char* vf_arg[] = { "_oldargs_", (char*)video_out , NULL };
sh_video->vfilter=(void*)vf_open_filter(NULL,"vo",vf_arg);
}
#ifdef HAVE_MENU
@@ -4385,7 +4382,8 @@
eof = 1;
break;
}
- sh_video->pts = vf_vo_data.pts;
+ ((vf_instance_t *)sh_video->vfilter)->control(sh_video->vfilter,
+ VFCTRL_GET_PTS, &sh_video->pts);
if (sh_video->pts == MP_NOPTS_VALUE) {
mp_msg(MSGT_CPLAYER, MSGL_ERR, "pts after filters MISSING\n");
sh_video->pts = last_pts;
More information about the MPlayer-cvslog
mailing list