Skip to content

Commit

Permalink
f_decoder_wrapper: rename fps option to override-container-fps
Browse files Browse the repository at this point in the history
This better reflects what it actually does. As a bonus, script writers
won't be misled into thinking that fps displays the actual video or
display fps.
  • Loading branch information
Dudemanguy committed Oct 15, 2023
1 parent 056072b commit edb12ed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions DOCS/interface-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Interface changes
- change the default of `metadata-codepage` to `auto`
- add `playlist-next-playlist` and `playlist-prev-playlist` commands
- change `video-codec` to show description or name, not both
- rename `--fps` to `--override-container-fps`
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.
Expand Down
12 changes: 6 additions & 6 deletions DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1629,13 +1629,13 @@ Video

``--correct-pts``, ``--no-correct-pts``
``--no-correct-pts`` switches mpv to a mode where video timing is
determined using a fixed framerate value (either using the ``--fps``
option, or using file information). Sometimes, files with very broken
timestamps can be played somewhat well in this mode. Note that video
filters, subtitle rendering, seeking (including hr-seeks and backstepping),
and audio synchronization can be completely broken in this mode.
determined using a fixed framerate value (either using the
``--override-container-fps`` option, or using file information). Sometimes,
files with very broken timestamps can be played somewhat well in this mode.
Note that video filters, subtitle rendering, seeking (including hr-seeks and
backstepping), and audio synchronization can be completely broken in this mode.

``--fps=<float>``
``--override-container-fps=<float>``
Override video framerate. Useful if the original value is wrong or missing.

.. note::
Expand Down
13 changes: 7 additions & 6 deletions filters/f_decoder_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static const struct m_sub_options adec_queue_conf = {
struct dec_wrapper_opts {
double movie_aspect;
int aspect_method;
double force_fps;
double override_fps;
bool correct_pts;
int video_rotate;
char *audio_decoders;
Expand All @@ -113,7 +113,7 @@ static int decoder_list_help(struct mp_log *log, const m_option_t *opt,
const struct m_sub_options dec_wrapper_conf = {
.opts = (const struct m_option[]){
{"correct-pts", OPT_BOOL(correct_pts)},
{"fps", OPT_DOUBLE(force_fps), M_RANGE(0, DBL_MAX)},
{"override-container-fps", OPT_DOUBLE(override_fps), M_RANGE(0, DBL_MAX)},
{"ad", OPT_STRING(audio_decoders),
.help = decoder_list_help},
{"vd", OPT_STRING(video_decoders),
Expand All @@ -132,7 +132,8 @@ const struct m_sub_options dec_wrapper_conf = {
{"video-reversal-buffer", OPT_BYTE_SIZE(video_reverse_size),
M_RANGE(0, M_MAX_MEM_BYTES)},
{"audio-reversal-buffer", OPT_BYTE_SIZE(audio_reverse_size),
M_RANGE(0, M_MAX_MEM_BYTES)} ,
M_RANGE(0, M_MAX_MEM_BYTES)},
{"fps", OPT_REPLACED("override-container-fps")},
{0}
},
.size = sizeof(struct dec_wrapper_opts),
Expand Down Expand Up @@ -1208,9 +1209,9 @@ struct mp_decoder_wrapper *mp_decoder_wrapper_create(struct mp_filter *parent,

MP_VERBOSE(p, "Container reported FPS: %f\n", p->fps);

if (p->opts->force_fps) {
p->fps = p->opts->force_fps;
MP_INFO(p, "FPS forced to %5.3f.\n", p->fps);
if (p->opts->override_fps) {
p->fps = p->opts->override_fps;
MP_INFO(p, "Container FPS forced to %5.3f.\n", p->fps);
MP_INFO(p, "Use --no-correct-pts to force FPS based timing.\n");
}

Expand Down

0 comments on commit edb12ed

Please sign in to comment.