summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 00:29:51 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 00:29:51 +0200
commit02bc48b67dd88c974c8f9298a0c50cbfcd51af41 (patch)
tree9e826e3d0494ce20cc115d85866f3e7472e21d60 /libmpcodecs
parentc1b80dcbbb34d63df65c0f52c0bede66dfa225e8 (diff)
parent38a76f7fdf5c03bc49072b693d7c53b343f2994a (diff)
downloadmpv-02bc48b67dd88c974c8f9298a0c50cbfcd51af41.tar.bz2
mpv-02bc48b67dd88c974c8f9298a0c50cbfcd51af41.tar.xz
Merge branch 'pause'
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/dec_video.c9
-rw-r--r--libmpcodecs/dec_video.h1
-rw-r--r--libmpcodecs/vf.h1
-rw-r--r--libmpcodecs/vf_expand.c6
-rw-r--r--libmpcodecs/vf_tfields.c9
-rw-r--r--libmpcodecs/vf_vo.c3
-rw-r--r--libmpcodecs/vf_yadif.c7
7 files changed, 29 insertions, 7 deletions
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index 291859abb2..8cdc3e7b1d 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -6,6 +6,7 @@
#include <malloc.h>
#endif
#include <stdlib.h>
+#include <stdbool.h>
#include <unistd.h>
#include "mp_msg.h"
@@ -138,6 +139,14 @@ int set_rectangle(sh_video_t *sh_video, int param, int value)
return 0;
}
+int redraw_osd(struct sh_video *sh_video, struct osd_state *osd)
+{
+ struct vf_instance *vf = sh_video->vfilter;
+ if (vf->control(vf, VFCTRL_REDRAW_OSD, osd) == true)
+ return 0;
+ return -1;
+}
+
void resync_video_stream(sh_video_t *sh_video)
{
const struct vd_functions *vd = sh_video->vd_driver;
diff --git a/libmpcodecs/dec_video.h b/libmpcodecs/dec_video.h
index 42aa56ecb5..463304bde5 100644
--- a/libmpcodecs/dec_video.h
+++ b/libmpcodecs/dec_video.h
@@ -21,6 +21,7 @@ void set_video_quality(sh_video_t *sh_video, int quality);
int get_video_colors(sh_video_t *sh_video, const char *item, int *value);
int set_video_colors(sh_video_t *sh_video, const char *item, int value);
int set_rectangle(sh_video_t *sh_video, int param, int value);
+int redraw_osd(struct sh_video *sh_video, struct osd_state *osd);
void resync_video_stream(sh_video_t *sh_video);
int get_current_video_decoder_lag(sh_video_t *sh_video);
diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h
index 504c616a73..24d86214d6 100644
--- a/libmpcodecs/vf.h
+++ b/libmpcodecs/vf.h
@@ -91,6 +91,7 @@ typedef struct vf_seteq_s
/* Hack to make the OSD state object available to vf_expand which accesses
* the OSD state outside of normal OSD draw time. */
#define VFCTRL_SET_OSD_OBJ 20
+#define VFCTRL_REDRAW_OSD 21 /* Change user-visible OSD immediately */
#include "vfcap.h"
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c
index cdde44f82b..dec0c524b6 100644
--- a/libmpcodecs/vf_expand.c
+++ b/libmpcodecs/vf_expand.c
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdbool.h>
#include "config.h"
#include "mp_msg.h"
@@ -419,6 +420,11 @@ static int control(struct vf_instance* vf, int request, void* data){
break;
case VFCTRL_DRAW_OSD:
if(vf->priv->osd_enabled) return CONTROL_TRUE;
+ break;
+ case VFCTRL_REDRAW_OSD:
+ if (vf->priv->osd_enabled)
+ return false;
+ break;
}
#endif
return vf_next_control(vf,request,data);
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c
index 0d88119371..347cd4bb9e 100644
--- a/libmpcodecs/vf_tfields.c
+++ b/libmpcodecs/vf_tfields.c
@@ -310,9 +310,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
return continue_buffered_image(vf);
}
+extern const int under_mencoder;
+
static int continue_buffered_image(struct vf_instance *vf)
{
- struct MPOpts *opts = vf->opts;
int i=vf->priv->buffered_i;
double pts = vf->priv->buffered_pts;
mp_image_t *mpi = vf->priv->buffered_mpi;
@@ -363,7 +364,7 @@ static int continue_buffered_image(struct vf_instance *vf)
dmpi->stride[2] = 2*mpi->stride[2];
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
@@ -393,7 +394,7 @@ static int continue_buffered_image(struct vf_instance *vf)
mpi->chroma_width, mpi->chroma_height, (i^!tff));
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
@@ -419,7 +420,7 @@ static int continue_buffered_image(struct vf_instance *vf)
dmpi->stride[2], mpi->stride[2]*2, (i^!tff));
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c
index 4f47bc1847..85088487ed 100644
--- a/libmpcodecs/vf_vo.c
+++ b/libmpcodecs/vf_vo.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdbool.h>
#include "config.h"
#include "mp_msg.h"
@@ -88,6 +89,8 @@ static int control(struct vf_instance* vf, int request, void* data)
if(!video_out->config_ok) return CONTROL_FALSE; // vo not configured?
vo_draw_osd(video_out, data);
return CONTROL_TRUE;
+ case VFCTRL_REDRAW_OSD:
+ return vo_control(video_out, VOCTRL_REDRAW_OSD, data) == true;
case VFCTRL_FLIP_PAGE:
{
if(!video_out->config_ok) return CONTROL_FALSE; // vo not configured?
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index fd46f241cd..2c80a2ec5b 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -416,9 +416,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
return continue_buffered_image(vf);
}
+extern const int under_mencoder;
+
static int continue_buffered_image(struct vf_instance *vf)
{
- struct MPOpts *opts = vf->opts;
mp_image_t *mpi = vf->priv->buffered_mpi;
int tff = vf->priv->buffered_tff;
double pts = vf->priv->buffered_pts;
@@ -435,10 +436,10 @@ static int continue_buffered_image(struct vf_instance *vf)
mpi->width,mpi->height);
vf_clone_mpi_attributes(dmpi, mpi);
filter(vf->priv, dmpi->planes, dmpi->stride, mpi->w, mpi->h, i ^ tff ^ 1, tff);
- if (opts->correct_pts && i < (vf->priv->mode & 1))
+ if (i < (vf->priv->mode & 1) && !under_mencoder)
vf_queue_frame(vf, continue_buffered_image);
ret |= vf_next_put_image(vf, dmpi, pts /*FIXME*/);
- if (opts->correct_pts)
+ if (!under_mencoder)
break;
if(i<(vf->priv->mode&1))
vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);