summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_ass.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vf_ass.c')
-rw-r--r--libmpcodecs/vf_ass.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c
index a04f0e557a..e4a82741b9 100644
--- a/libmpcodecs/vf_ass.c
+++ b/libmpcodecs/vf_ass.c
@@ -29,6 +29,7 @@
#include "config.h"
#include "mp_msg.h"
#include "help_mp.h"
+#include "options.h"
#include "img_format.h"
#include "mp_image.h"
@@ -66,23 +67,21 @@ static const struct vf_priv_s {
unsigned char* dirty_rows;
} vf_priv_dflt;
-extern int opt_screen_size_x;
-extern int opt_screen_size_y;
-
extern ass_track_t* ass_track;
extern float sub_delay;
extern int sub_visibility;
-static int config(struct vf_instance_s* vf,
+static int config(struct vf_instance* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt)
{
+ struct MPOpts *opts = vf->opts;
if (outfmt == IMGFMT_IF09) return 0;
vf->priv->outh = height + ass_top_margin + ass_bottom_margin;
vf->priv->outw = width;
- if(!opt_screen_size_x && !opt_screen_size_y){
+ if (!opts->screen_size_x && !opts->screen_size_y) {
d_width = d_width * vf->priv->outw / width;
d_height = d_height * vf->priv->outh / height;
}
@@ -99,7 +98,7 @@ static int config(struct vf_instance_s* vf,
return vf_next_config(vf, vf->priv->outw, vf->priv->outh, d_width, d_height, flags, outfmt);
}
-static void get_image(struct vf_instance_s* vf, mp_image_t *mpi)
+static void get_image(struct vf_instance* vf, mp_image_t *mpi)
{
if(mpi->type == MP_IMGTYPE_IPB) return;
if(mpi->flags & MP_IMGFLAG_PRESERVE) return;
@@ -158,7 +157,7 @@ static void blank(mp_image_t *mpi, int y1, int y2)
}
}
-static int prepare_image(struct vf_instance_s* vf, mp_image_t *mpi)
+static int prepare_image(struct vf_instance* vf, mp_image_t *mpi)
{
if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){
vf->dmpi = mpi->priv;
@@ -206,7 +205,7 @@ static int prepare_image(struct vf_instance_s* vf, mp_image_t *mpi)
/**
* \brief Copy specified rows from render_context.dmpi to render_context.planes, upsampling to 4:4:4
*/
-static void copy_from_image(struct vf_instance_s* vf, int first_row, int last_row)
+static void copy_from_image(struct vf_instance* vf, int first_row, int last_row)
{
int pl;
int i, j, k;
@@ -248,7 +247,7 @@ static void copy_from_image(struct vf_instance_s* vf, int first_row, int last_ro
/**
* \brief Copy all previously copied rows back to render_context.dmpi
*/
-static void copy_to_image(struct vf_instance_s* vf)
+static void copy_to_image(struct vf_instance* vf)
{
int pl;
int i, j, k;
@@ -279,7 +278,7 @@ static void copy_to_image(struct vf_instance_s* vf)
}
}
-static void my_draw_bitmap(struct vf_instance_s* vf, unsigned char* bitmap, int bitmap_w, int bitmap_h, int stride, int dst_x, int dst_y, unsigned color)
+static void my_draw_bitmap(struct vf_instance* vf, unsigned char* bitmap, int bitmap_w, int bitmap_h, int stride, int dst_x, int dst_y, unsigned color)
{
unsigned char y = rgba2y(color);
unsigned char u = rgba2u(color);
@@ -307,7 +306,7 @@ static void my_draw_bitmap(struct vf_instance_s* vf, unsigned char* bitmap, int
}
}
-static int render_frame(struct vf_instance_s* vf, mp_image_t *mpi, const ass_image_t* img)
+static int render_frame(struct vf_instance* vf, mp_image_t *mpi, const ass_image_t* img)
{
if (img) {
memset(vf->priv->dirty_rows, 0, vf->priv->outh); // reset dirty rows
@@ -322,7 +321,7 @@ static int render_frame(struct vf_instance_s* vf, mp_image_t *mpi, const ass_ima
return 0;
}
-static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts)
+static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts)
{
ass_image_t* images = 0;
if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE))
@@ -334,7 +333,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts)
return vf_next_put_image(vf, vf->dmpi, pts);
}
-static int query_format(struct vf_instance_s* vf, unsigned int fmt)
+static int query_format(struct vf_instance* vf, unsigned int fmt)
{
switch(fmt){
case IMGFMT_YV12:
@@ -360,7 +359,7 @@ static int control(vf_instance_t *vf, int request, void *data)
return vf_next_control(vf, request, data);
}
-static void uninit(struct vf_instance_s* vf)
+static void uninit(struct vf_instance* vf)
{
if (vf->priv->ass_priv)
ass_renderer_done(vf->priv->ass_priv);