mirror of https://github.com/mpv-player/mpv
video/out: replace VFCAP_TIMER with vo->untimed, fix vo_image and vo_lavc
VFCAP_TIMER disables any additional waiting done by mpv in the playloop. Remove VFCAP_TIMER, but re-use the idea for vo_image and vo_lavc. This means --untimed doesn't have to be passed when using --vo=image.
This commit is contained in:
parent
1f32250629
commit
b7cacf9165
|
@ -3321,7 +3321,7 @@ static void run_playloop(struct MPContext *mpctx)
|
|||
* If untimed is set always output frames immediately
|
||||
* without sleeping.
|
||||
*/
|
||||
if (mpctx->time_frame < -0.2 || opts->untimed)
|
||||
if (mpctx->time_frame < -0.2 || opts->untimed || vo->untimed)
|
||||
mpctx->time_frame = 0;
|
||||
}
|
||||
|
||||
|
@ -3344,8 +3344,7 @@ static void run_playloop(struct MPContext *mpctx)
|
|||
|
||||
mpctx->time_frame -= get_relative_time(mpctx);
|
||||
mpctx->time_frame -= vo->flip_queue_offset;
|
||||
if (mpctx->time_frame > 0.001
|
||||
&& !(mpctx->sh_video->output_flags & VFCAP_TIMER))
|
||||
if (mpctx->time_frame > 0.001)
|
||||
mpctx->time_frame = timing_sleep(mpctx, mpctx->time_frame);
|
||||
mpctx->time_frame += vo->flip_queue_offset;
|
||||
|
||||
|
@ -4446,7 +4445,6 @@ int main(int argc, char *argv[])
|
|||
m_config_set_option0(mpctx->mconfig, "ao", "lavc");
|
||||
m_config_set_option0(mpctx->mconfig, "fixed-vo", "yes");
|
||||
m_config_set_option0(mpctx->mconfig, "gapless-audio", "yes");
|
||||
m_config_set_option0(mpctx->mconfig, "untimed", "yes");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -228,6 +228,8 @@ struct vo {
|
|||
int config_count; // Total number of successful config calls
|
||||
int default_caps; // query_format() result for configured video format
|
||||
|
||||
bool untimed; // non-interactive, don't do sleep calls in playloop
|
||||
|
||||
bool frame_loaded; // Is there a next frame the VO could flip to?
|
||||
struct mp_image *waiting_mpi;
|
||||
double next_pts; // pts value of the next frame if any
|
||||
|
|
|
@ -137,6 +137,7 @@ static void uninit(struct vo *vo)
|
|||
|
||||
static int preinit(struct vo *vo, const char *arg)
|
||||
{
|
||||
vo->untimed = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ static int preinit(struct vo *vo, const char *arg)
|
|||
vc = vo->priv;
|
||||
vc->harddup = vo->encode_lavc_ctx->options->harddup;
|
||||
vc->colorspace = (struct mp_csp_details) MP_CSP_DETAILS_DEFAULTS;
|
||||
vo->untimed = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
// driver/filter can do vertical flip (upside-down)
|
||||
#define VFCAP_FLIP 0x80
|
||||
|
||||
// driver/hardware handles timing (blocking)
|
||||
#define VFCAP_TIMER 0x100
|
||||
// filter does postprocessing (so you shouldn't scale/filter image before it)
|
||||
#define VFCAP_POSTPROC 0x800
|
||||
|
||||
|
|
Loading…
Reference in New Issue