Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miscellaneous cosmetic fixes #12438

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/msg_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define MP_MSG_CONTROL_H

#include <stdbool.h>
#include "common/msg.h"

struct mpv_global;
struct MPOpts;
Expand Down
1 change: 1 addition & 0 deletions demux/timeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define MP_TIMELINE_H_

#include "common/common.h"
#include "misc/bstr.h"

// Single segment in a timeline.
struct timeline_part {
Expand Down
1 change: 1 addition & 0 deletions filters/f_async_queue.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <stdint.h>
llyyr marked this conversation as resolved.
Show resolved Hide resolved
#include "filter.h"

// A thread safe queue, which buffers a configurable number of frames like a
Expand Down
1 change: 1 addition & 0 deletions filters/f_decoder_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#pragma once

#include <stdbool.h>
#include <stddef.h>

#include "filter.h"

Expand Down
1 change: 1 addition & 0 deletions filters/f_lavfi.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct mp_lavfi *mp_lavfi_create_filter(struct mp_filter *parent,
char **graph_opts,
const char *filter, char **filter_opts);

struct mp_log;
// Print libavfilter list for --vf/--af
void print_lavfi_help_list(struct mp_log *log, int media_type);

Expand Down
1 change: 1 addition & 0 deletions misc/thread_pool.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef MPV_MP_THREAD_POOL_H
#define MPV_MP_THREAD_POOL_H

#include <stdbool.h>
struct mp_thread_pool;

// Create a thread pool with the given number of worker threads. This can return
Expand Down
1 change: 1 addition & 0 deletions player/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <stdbool.h>

#include "libmpv/client.h"
#include "osdep/compiler.h"

struct MPContext;
struct mp_cmd;
Expand Down
7 changes: 5 additions & 2 deletions sub/ass_mp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
#include <ass/ass.h>
#include <ass/ass_types.h>

// This is probably arbitrary.
// sd_lavc_conv might indirectly still assume this PlayResY, though.
// These PlayResX and PlayResY values are arbitrary and taken from lavc.
// lavc assumes these values when converting to ass generally. Moreover, these
// values are also used by default in VSFilter, so it isn't that arbitrary.
#define MP_ASS_FONT_PLAYRESX 384
llyyr marked this conversation as resolved.
Show resolved Hide resolved
#define MP_ASS_FONT_PLAYRESY 288

#define MP_ASS_RGBA(r, g, b, a) \
Expand All @@ -40,6 +42,7 @@ struct MPOpts;
struct mpv_global;
struct mp_osd_res;
struct osd_style_opts;
struct mp_log;

void mp_ass_flush_old_events(ASS_Track *track, long long ts);
void mp_ass_set_style(ASS_Style *style, double res_y,
Expand Down
10 changes: 5 additions & 5 deletions sub/sd_ass.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ static void mp_ass_add_default_styles(ASS_Track *track, struct mp_subtitle_opts

if (track->n_styles == 0) {
if (!track->PlayResY) {
track->PlayResX = MP_ASS_FONT_PLAYRESX;
track->PlayResY = MP_ASS_FONT_PLAYRESY;
track->PlayResX = track->PlayResY * 4 / 3;
}
track->Kerning = true;
int sid = ass_alloc_style(track);
Expand Down Expand Up @@ -220,8 +220,8 @@ static void assobjects_init(struct sd *sd)
ctx->ass_track->track_type = TRACK_TYPE_ASS;

ctx->shadow_track = ass_new_track(ctx->ass_library);
ctx->shadow_track->PlayResX = 384;
ctx->shadow_track->PlayResY = 288;
ctx->shadow_track->PlayResX = MP_ASS_FONT_PLAYRESX;
ctx->shadow_track->PlayResY = MP_ASS_FONT_PLAYRESY;
mp_ass_add_default_styles(ctx->shadow_track, opts);

char *extradata = sd->codec->extradata;
Expand Down Expand Up @@ -436,7 +436,7 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
#endif
ass_set_selective_style_override_enabled(priv, set_force_flags);
ASS_Style style = {0};
mp_ass_set_style(&style, 288, opts->sub_style);
mp_ass_set_style(&style, MP_ASS_FONT_PLAYRESY, opts->sub_style);
ass_set_selective_style_override(priv, &style);
free(style.FontName);
if (converted && track->default_style < track->n_styles) {
Expand Down Expand Up @@ -473,7 +473,7 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
track->PlayResX = track->PlayResY * (double)vidw / MPMAX(vidh, 1);
// ffmpeg and mpv use a default PlayResX of 384 when it is not known,
// this comes from VSFilter.
double fix_margins = track->PlayResX / 384.0;
double fix_margins = track->PlayResX / (double)MP_ASS_FONT_PLAYRESX;
track->styles->MarginL = round(track->styles->MarginL * fix_margins);
track->styles->MarginR = round(track->styles->MarginR * fix_margins);
}
Expand Down