summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-16 07:11:12 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-23 13:41:05 +0300
commit9b06b5ed85ec28097428e7fe35631ce3a04685b5 (patch)
tree8fbb0ad6eecb1f337e153d5c6eb7fa2378b805f4 /libmpcodecs
parent0d59f81e546946648dfca93da6b74479d31369bc (diff)
downloadmpv-9b06b5ed85ec28097428e7fe35631ce3a04685b5.tar.bz2
mpv-9b06b5ed85ec28097428e7fe35631ce3a04685b5.tar.xz
Move correct_pts to options struct
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/dec_video.c6
-rw-r--r--libmpcodecs/vf_tfields.c9
-rw-r--r--libmpcodecs/vf_yadif.c7
3 files changed, 13 insertions, 9 deletions
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index ab63ec4006..24f674e049 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -1,5 +1,6 @@
#include "config.h"
+#include "options.h"
#include <stdio.h>
#ifdef HAVE_MALLOC_H
@@ -335,8 +336,9 @@ void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size,
unsigned int t = GetTimer();
unsigned int t2;
double tt;
+ struct MPOpts *opts = sh_video->opts;
- if (correct_pts && pts != MP_NOPTS_VALUE) {
+ if (opts->correct_pts && pts != MP_NOPTS_VALUE) {
int delay = get_current_video_decoder_lag(sh_video);
if (delay >= 0) {
if (delay > sh_video->num_buffered_pts)
@@ -393,7 +395,7 @@ void *decode_video(sh_video_t *sh_video, unsigned char *start, int in_size,
else if (field_dominance == 1)
mpi->fields &= ~MP_IMGFIELD_TOP_FIRST;
- if (correct_pts) {
+ if (opts->correct_pts) {
if (sh_video->num_buffered_pts) {
sh_video->num_buffered_pts--;
sh_video->pts = sh_video->buffered_pts[sh_video->num_buffered_pts];
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c
index b95b4f83ef..eba28e3723 100644
--- a/libmpcodecs/vf_tfields.c
+++ b/libmpcodecs/vf_tfields.c
@@ -3,6 +3,7 @@
#include <string.h>
#include "config.h"
+#include "options.h"
#include "mp_msg.h"
#include "cpudetect.h"
@@ -300,7 +301,6 @@ static void (*qpel_li)(unsigned char *d, unsigned char *s, int w, int h, int ds,
static void (*qpel_4tap)(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up);
static int continue_buffered_image(struct vf_instance_s *);
-extern int correct_pts;
static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts)
{
@@ -312,6 +312,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts)
static int continue_buffered_image(struct vf_instance_s *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;
@@ -362,7 +363,7 @@ static int continue_buffered_image(struct vf_instance_s *vf)
dmpi->stride[2] = 2*mpi->stride[2];
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (correct_pts)
+ if (opts->correct_pts)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
@@ -392,7 +393,7 @@ static int continue_buffered_image(struct vf_instance_s *vf)
mpi->chroma_width, mpi->chroma_height, (i^!tff));
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (correct_pts)
+ if (opts->correct_pts)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
@@ -418,7 +419,7 @@ static int continue_buffered_image(struct vf_instance_s *vf)
dmpi->stride[2], mpi->stride[2]*2, (i^!tff));
}
ret |= vf_next_put_image(vf, dmpi, pts);
- if (correct_pts)
+ if (opts->correct_pts)
break;
else
if (!i) vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index 880c4cdaeb..19c1453166 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -24,6 +24,7 @@
#include "config.h"
#include "cpudetect.h"
+#include "options.h"
#include "mp_msg.h"
@@ -391,7 +392,6 @@ static int config(struct vf_instance_s* vf,
}
static int continue_buffered_image(struct vf_instance_s *vf);
-extern int correct_pts;
static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
int tff;
@@ -422,6 +422,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
static int continue_buffered_image(struct vf_instance_s *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;
@@ -438,10 +439,10 @@ static int continue_buffered_image(struct vf_instance_s *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 (correct_pts && i < (vf->priv->mode & 1))
+ if (opts->correct_pts && i < (vf->priv->mode & 1))
vf_queue_frame(vf, continue_buffered_image);
ret |= vf_next_put_image(vf, dmpi, pts /*FIXME*/);
- if (correct_pts)
+ if (opts->correct_pts)
break;
if(i<(vf->priv->mode&1))
vf_next_control(vf, VFCTRL_FLIP_PAGE, NULL);