From 1423bd0bfd671ffc023778839a540fffd1dd3686 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Jul 2014 23:24:08 +0200 Subject: player: move video display code out of the playloop Basically move the code from playloop.c to video.c. The new function write_video() now contains the code that was part of run_playloop(). There are no functional changes, except handling "new_frame_shown" slightly differently. This is done so that we don't need new a new MPContext field or a return value for write_video() to signal this condition. Instead, it's handled indirectly. --- player/core.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'player/core.h') diff --git a/player/core.h b/player/core.h index c24a6c1f94..6b3cf55f8b 100644 --- a/player/core.h +++ b/player/core.h @@ -88,6 +88,8 @@ enum { MAX_TERM_OSD_LEVEL = 1, OSD_LEVEL_INVISIBLE = 4, OSD_BAR_SEEK = 256, + + MAX_NUM_VO_PTS = 100, }; enum seek_type { @@ -138,17 +140,6 @@ struct track { bool preloaded; }; -enum { - MAX_NUM_VO_PTS = 100, - - // update_video() - code also uses: <0 error, 0 eof, >0 progress - VD_ERROR = -1, - VD_EOF = 0, // end of file - no new output - VD_PROGRESS = 1, // progress, but no output; repeat call with no waiting - VD_NEW_FRAME = 2, // the call produced a new frame - VD_WAIT = 3, // no EOF, but no output; wait until wakeup -}; - /* Note that playback can be paused, stopped, etc. at any time. While paused, * playback restart is still active, because you want seeking to work even * if paused. @@ -501,8 +492,7 @@ void build_cue_timeline(struct MPContext *mpctx); void reset_video_state(struct MPContext *mpctx); int reinit_video_chain(struct MPContext *mpctx); int reinit_video_filters(struct MPContext *mpctx); -int update_video(struct MPContext *mpctx, double endpts, bool reconfig_ok, - double *frame_duration); +void write_video(struct MPContext *mpctx, double endpts); void mp_force_video_refresh(struct MPContext *mpctx); void update_fps(struct MPContext *mpctx); -- cgit v1.2.3