diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2011-01-20 18:47:18 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2011-01-26 20:39:04 +0200 |
commit | a248c2c7a137517061e6271f22b84d43bcd7191d (patch) | |
tree | 27cb0970881007be820e8dfb74c504cf257afb20 | |
parent | 966340b31a7bc53e922118da1cd4783d6a06483d (diff) | |
download | mpv-a248c2c7a137517061e6271f22b84d43bcd7191d.tar.bz2 mpv-a248c2c7a137517061e6271f22b84d43bcd7191d.tar.xz |
cleanup: rename ass_* functions to mp_ass_*
The various ass_* functions were created when libass was part of the
MPlayer tree and the distinction between MPlayer-specific and other
functions was less clear. Now that libass is a clearly separate
library, using the same ass_* namespace for player functions is ugly.
Rename the functions to use mp_ass_ prefix instead.
-rw-r--r-- | ass_mp.c | 19 | ||||
-rw-r--r-- | ass_mp.h | 18 | ||||
-rw-r--r-- | libmpcodecs/vf_ass.c | 14 | ||||
-rw-r--r-- | libmpcodecs/vf_vo.c | 14 | ||||
-rw-r--r-- | mplayer.c | 8 | ||||
-rw-r--r-- | sub/sd_ass.c | 2 |
6 files changed, 38 insertions, 37 deletions
@@ -72,7 +72,7 @@ static char *sub_cp = 0; void process_force_style(ASS_Track *track); -ASS_Track *ass_default_track(ASS_Library *library) +ASS_Track *mp_ass_default_track(ASS_Library *library) { ASS_Track *track = ass_new_track(library); @@ -211,13 +211,13 @@ static int ass_process_subtitle(ASS_Track *track, subtitle *sub) * \param fps video framerate * \return newly allocated ASS_Track, filled with subtitles from subdata */ -ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata, - double fps) +ASS_Track *mp_ass_read_subdata(ASS_Library *library, sub_data *subdata, + double fps) { ASS_Track *track; int i; - track = ass_default_track(library); + track = mp_ass_default_track(library); track->name = subdata->filename ? strdup(subdata->filename) : 0; for (i = 0; i < subdata->sub_num; ++i) { @@ -232,7 +232,8 @@ ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata, return track; } -ASS_Track *ass_read_stream(ASS_Library *library, const char *fname, char *charset) +ASS_Track *mp_ass_read_stream(ASS_Library *library, const char *fname, + char *charset) { int i; char *buf = NULL; @@ -281,7 +282,7 @@ ASS_Track *ass_read_stream(ASS_Library *library, const char *fname, char *charse return track; } -void ass_configure(ASS_Renderer *priv, int w, int h, bool unscaled) +void mp_ass_configure(ASS_Renderer *priv, int w, int h, bool unscaled) { int hinting; ass_set_frame_size(priv, w, h); @@ -296,7 +297,7 @@ void ass_configure(ASS_Renderer *priv, int w, int h, bool unscaled) ass_set_line_spacing(priv, ass_line_spacing); } -void ass_configure_fonts(ASS_Renderer *priv) +void mp_ass_configure_fonts(ASS_Renderer *priv) { char *dir, *path, *family; dir = get_path("fonts"); @@ -328,7 +329,7 @@ static void message_callback(int level, const char *format, va_list va, void *ct mp_msg(MSGT_ASS, level, "\n"); } -ASS_Library *ass_init(void) +ASS_Library *mp_ass_init(void) { ASS_Library *priv; char *path = get_path("fonts"); @@ -343,7 +344,7 @@ ASS_Library *ass_init(void) int ass_force_reload = 0; // flag set if global ass-related settings were changed -ASS_Image *ass_mp_render_frame(ASS_Renderer *priv, ASS_Track *track, +ASS_Image *mp_ass_render_frame(ASS_Renderer *priv, ASS_Track *track, long long now, int *detect_change) { if (ass_force_reload) { @@ -44,18 +44,18 @@ extern char *ass_border_color; extern char *ass_styles_file; extern int ass_hinting; -ASS_Track *ass_default_track(ASS_Library *library); -ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata, - double fps); -ASS_Track *ass_read_stream(ASS_Library *library, const char *fname, - char *charset); +ASS_Track *mp_ass_default_track(ASS_Library *library); +ASS_Track *mp_ass_read_subdata(ASS_Library *library, sub_data *subdata, + double fps); +ASS_Track *mp_ass_read_stream(ASS_Library *library, const char *fname, + char *charset); -void ass_configure(ASS_Renderer *priv, int w, int h, bool unscaled); -void ass_configure_fonts(ASS_Renderer *priv); -ASS_Library *ass_init(void); +void mp_ass_configure(ASS_Renderer *priv, int w, int h, bool unscaled); +void mp_ass_configure_fonts(ASS_Renderer *priv); +ASS_Library *mp_ass_init(void); extern int ass_force_reload; -ASS_Image *ass_mp_render_frame(ASS_Renderer *priv, ASS_Track *track, +ASS_Image *mp_ass_render_frame(ASS_Renderer *priv, ASS_Track *track, long long now, int *detect_change); #else /* CONFIG_ASS */ diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index d695fd206d..39e5d8f3c5 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -94,10 +94,10 @@ static int config(struct vf_instance *vf, vf->priv->line_limits = malloc((vf->priv->outh + 1) / 2 * sizeof(*vf->priv->line_limits)); if (vf->priv->renderer_realaspect) { - ass_configure(vf->priv->renderer_realaspect, - vf->priv->outw, vf->priv->outh, 0); - ass_configure(vf->priv->renderer_vsfilter, - vf->priv->outw, vf->priv->outh, 0); + mp_ass_configure(vf->priv->renderer_realaspect, + vf->priv->outw, vf->priv->outh, 0); + mp_ass_configure(vf->priv->renderer_vsfilter, + vf->priv->outw, vf->priv->outh, 0); ass_set_aspect_ratio(vf->priv->renderer_realaspect, (double)width / height * d_height / d_width, 1); ass_set_aspect_ratio(vf->priv->renderer_vsfilter, 1, 1); @@ -361,7 +361,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) vf->priv->renderer_vsfilter : vf->priv->renderer_realaspect; if (sub_visibility && renderer && vf->priv->osd->ass_track && (pts != MP_NOPTS_VALUE)) - images = ass_mp_render_frame(renderer, + images = mp_ass_render_frame(renderer, vf->priv->osd->ass_track, (pts + sub_delay) * 1000 + .5, NULL); @@ -398,8 +398,8 @@ static int control(vf_instance_t *vf, int request, void *data) ass_renderer_done(vf->priv->renderer_realaspect); return CONTROL_FALSE; } - ass_configure_fonts(vf->priv->renderer_realaspect); - ass_configure_fonts(vf->priv->renderer_vsfilter); + mp_ass_configure_fonts(vf->priv->renderer_realaspect); + mp_ass_configure_fonts(vf->priv->renderer_vsfilter); return CONTROL_TRUE; case VFCTRL_DRAW_EOSD: if (vf->priv->renderer_realaspect) diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index b10181cf14..4d94569ef3 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -85,10 +85,10 @@ static int config(struct vf_instance *vf, vf->priv->scale_ratio = (double) d_width / d_height * height / width; if (vf->priv->renderer_realaspect) { - ass_configure(vf->priv->renderer_realaspect, width, height, - vf->default_caps & VFCAP_EOSD_UNSCALED); - ass_configure(vf->priv->renderer_vsfilter, width, height, - vf->default_caps & VFCAP_EOSD_UNSCALED); + mp_ass_configure(vf->priv->renderer_realaspect, width, height, + vf->default_caps & VFCAP_EOSD_UNSCALED); + mp_ass_configure(vf->priv->renderer_vsfilter, width, height, + vf->default_caps & VFCAP_EOSD_UNSCALED); } #endif @@ -143,8 +143,8 @@ static int control(struct vf_instance *vf, int request, void* data) ass_renderer_done(vf->priv->renderer_realaspect); return CONTROL_FALSE; } - ass_configure_fonts(vf->priv->renderer_realaspect); - ass_configure_fonts(vf->priv->renderer_vsfilter); + mp_ass_configure_fonts(vf->priv->renderer_realaspect); + mp_ass_configure_fonts(vf->priv->renderer_vsfilter); vf->priv->prev_visibility = false; return CONTROL_TRUE; } @@ -175,7 +175,7 @@ static int control(struct vf_instance *vf, int request, void* data) ass_set_aspect_ratio(renderer, scale, 1); } - images.imgs = ass_mp_render_frame(renderer, + images.imgs = mp_ass_render_frame(renderer, osd->ass_track, (pts+sub_delay) * 1000 + .5, &images.changed); @@ -1100,15 +1100,15 @@ void add_subtitles(struct MPContext *mpctx, char *filename, float fps, int noerr #ifdef CONFIG_ASS if (opts->ass_enabled) { #ifdef CONFIG_ICONV - asst = ass_read_stream(ass_library, filename, sub_cp); + asst = mp_ass_read_stream(ass_library, filename, sub_cp); #else - asst = ass_read_stream(ass_library, filename, 0); + asst = mp_ass_read_stream(ass_library, filename, 0); #endif is_native_ass = asst; if (!asst) { subd = sub_read_file(filename, fps, &mpctx->opts); if (subd) { - asst = ass_read_subdata(ass_library, subd, fps); + asst = mp_ass_read_subdata(ass_library, subd, fps); sub_free(subd); subd = NULL; } @@ -4091,7 +4091,7 @@ if(!codecs_file || !parse_codec_cfg(codecs_file)){ #endif #ifdef CONFIG_ASS - ass_library = ass_init(); + ass_library = mp_ass_init(); #endif #ifdef HAVE_RTC diff --git a/sub/sd_ass.c b/sub/sd_ass.c index a5879873a9..be2740bfa6 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -57,7 +57,7 @@ static void init(struct sh_sub *sh, struct osd_state *osd) ass_process_codec_private(ctx->ass_track, sh->extradata, sh->extradata_len); } else - ctx->ass_track = ass_default_track(ass_library); + ctx->ass_track = mp_ass_default_track(ass_library); } assert(osd->ass_track == NULL); |