summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-13 18:06:08 +0200
committerwm4 <wm4@nowhere>2013-09-13 21:32:28 +0200
commit6cec60a454889907df46bf37adddfd874884b24d (patch)
tree662b3b7c6ce6924af8161566b3c9180ba086ffa8 /demux
parentddd3ade02309259cda20de14bdeef334a006ad1f (diff)
downloadmpv-6cec60a454889907df46bf37adddfd874884b24d.tar.bz2
mpv-6cec60a454889907df46bf37adddfd874884b24d.tar.xz
core: add --deinterlace option, restore it with resume functionality
The --deinterlace option does on playback start what the "deinterlace" property normally does at runtime. You could do this before by using the --vf option or by messing with the vo_vdpau default options, but this new option is supposed to be a "foolproof" way. The main motivation for adding this is so that the deinterlace property can be restored when using the video resume functionality (quit_watch_later command). Implementation-wise, this is a bit messy. The video chain is rebuilt in mpcodecs_reconfig_vo(), where we don't have access to MPContext, so the usual mechanism for enabling deinterlacing can't be used. Further, mpcodecs_reconfig_vo() is called by the video decoder, which doesn't have access to MPContext either. Moving this call to mplayer.c isn't currently possible either (see below). So we just do this before frames are filtered, which potentially means setting the deinterlacing every frame. Fortunately, setting deinterlacing is stable and idempotent, so this is hopefully not a problem. We also add a counter that is incremented on each reconfig to reduce the amount of additional work per frame to nearly zero. The reason we can't move mpcodecs_reconfig_vo() to mplayer.c is because of hardware decoding: we need to check whether the video chain works before we decide that we can use hardware decoding. Changing it so that this can be decided in advance without building a filter chain sounds like a good idea and should be done, but we aren't there yet.
Diffstat (limited to 'demux')
-rw-r--r--demux/stheader.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/demux/stheader.h b/demux/stheader.h
index 6109221442..1c2f8a2a3e 100644
--- a/demux/stheader.h
+++ b/demux/stheader.h
@@ -131,6 +131,7 @@ typedef struct sh_video {
struct vf_instance *vfilter; // video filter chain
const struct vd_functions *vd_driver;
int vf_initialized; // -1 failed, 0 not done, 1 done
+ long vf_reconfig_count; // incremented each mpcodecs_reconfig_vo() call
struct mp_image_params *vf_input; // video filter input params
struct mp_hwdec_info *hwdec_info; // video output hwdec handles
// win32-compatible codec parameters: