summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-15 00:52:17 +0200
committerwm4 <wm4@nowhere>2013-07-15 01:49:26 +0200
commit17ab38bc664308ea6fe17249b9ddd434b6e05d8e (patch)
treec5f087573f4f36c19cf6b81129f67791001d4b4d /video
parent5f0fc0e914e7bdf7ec536ff83638c8a416dfa6ac (diff)
downloadmpv-17ab38bc664308ea6fe17249b9ddd434b6e05d8e.tar.bz2
mpv-17ab38bc664308ea6fe17249b9ddd434b6e05d8e.tar.xz
dec_video: add vd_control wrapper
Slightly cleaner.
Diffstat (limited to 'video')
-rw-r--r--video/decode/dec_video.c18
-rw-r--r--video/decode/dec_video.h1
2 files changed, 12 insertions, 7 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index d101237699..ac351db6b6 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -43,6 +43,14 @@
#include "video/decode/dec_video.h"
+int vd_control(struct sh_video *sh_video, int cmd, void *arg)
+{
+ const struct vd_functions *vd = sh_video->vd_driver;
+ if (vd)
+ return vd->control(sh_video, cmd, arg);
+ return CONTROL_UNKNOWN;
+}
+
int get_video_quality_max(sh_video_t *sh_video)
{
vf_instance_t *vf = sh_video->vfilter;
@@ -146,24 +154,20 @@ void set_video_colorspace(struct sh_video *sh)
void resync_video_stream(sh_video_t *sh_video)
{
const struct vd_functions *vd = sh_video->vd_driver;
- if (vd)
- vd->control(sh_video, VDCTRL_RESYNC_STREAM, NULL);
+ vd_control(sh_video, VDCTRL_RESYNC_STREAM, NULL);
sh_video->prev_codec_reordered_pts = MP_NOPTS_VALUE;
sh_video->prev_sorted_pts = MP_NOPTS_VALUE;
}
void video_reinit_vo(struct sh_video *sh_video)
{
- sh_video->vd_driver->control(sh_video, VDCTRL_REINIT_VO, NULL);
+ vd_control(sh_video, VDCTRL_REINIT_VO, NULL);
}
int get_current_video_decoder_lag(sh_video_t *sh_video)
{
- const struct vd_functions *vd = sh_video->vd_driver;
- if (!vd)
- return -1;
int ret = -1;
- vd->control(sh_video, VDCTRL_QUERY_UNSEEN_FRAMES, &ret);
+ vd_control(sh_video, VDCTRL_QUERY_UNSEEN_FRAMES, &ret);
return ret;
}
diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h
index 05e3c7f0a1..6bca7fb573 100644
--- a/video/decode/dec_video.h
+++ b/video/decode/dec_video.h
@@ -43,6 +43,7 @@ void set_video_colorspace(struct sh_video *sh);
void resync_video_stream(sh_video_t *sh_video);
void video_reinit_vo(struct sh_video *sh_video);
int get_current_video_decoder_lag(sh_video_t *sh_video);
+int vd_control(struct sh_video *sh_video, int cmd, void *arg);
extern int divx_quality;