summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-06 22:54:03 +0100
committerwm4 <wm4@nowhere>2013-02-06 23:04:18 +0100
commitae070a6f1eff9f38dcd3ec785dd1f251e3761472 (patch)
treed498b49781dcbe656b324f813ba83b9b90f2495b /video
parent4628ea3c46fe64cc9989e5a3e6f9b01f72563c36 (diff)
downloadmpv-ae070a6f1eff9f38dcd3ec785dd1f251e3761472.tar.bz2
mpv-ae070a6f1eff9f38dcd3ec785dd1f251e3761472.tar.xz
audio/out, video/out: hide encoding VO/AO
mpv -ao help and mpv -vo help shouldn't show the encoding outputs (named "lavc" on both cases). Also make it impossible to select these manually when not encoding.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c12
-rw-r--r--video/out/vo.h3
-rw-r--r--video/out/vo_lavc.c1
3 files changed, 12 insertions, 4 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index e2e2d2d675..9a1516930c 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -131,6 +131,8 @@ const struct vo_driver *video_out_drivers[] =
static int vo_preinit(struct vo *vo, char *arg)
{
+ if (vo->driver->encode != !!vo->encode_lavc_ctx)
+ return -1;
if (vo->driver->priv_size) {
vo->priv = talloc_zero_size(vo, vo->driver->priv_size);
if (vo->driver->priv_defaults)
@@ -268,12 +270,14 @@ void vo_destroy(struct vo *vo)
void list_video_out(void)
{
- int i = 0;
mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Available video output drivers:\n");
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_OUTPUTS\n");
- while (video_out_drivers[i]) {
- const vo_info_t *info = video_out_drivers[i++]->info;
- mp_msg(MSGT_GLOBAL, MSGL_INFO,"\t%s\t%s\n", info->short_name, info->name);
+ for (int i = 0; video_out_drivers[i]; i++) {
+ const vo_info_t *info = video_out_drivers[i]->info;
+ if (!video_out_drivers[i]->encode) {
+ mp_msg(MSGT_GLOBAL, MSGL_INFO,"\t%s\t%s\n",
+ info->short_name, info->name);
+ }
}
mp_msg(MSGT_GLOBAL, MSGL_INFO,"\n");
}
diff --git a/video/out/vo.h b/video/out/vo.h
index 73eb19c8d7..a41b5466fb 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -146,6 +146,9 @@ struct vo_driver {
// of pts values itself
bool buffer_frames;
+ // Encoding functionality, which can be invoked via --o only.
+ bool encode;
+
const vo_info_t *info;
/*
* Preinitializes driver (real INITIALIZATION)
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 2aced9351a..2a07a67b0b 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -514,6 +514,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
const struct vo_driver video_out_lavc = {
.buffer_frames = false,
+ .encode = true,
.info = &(const struct vo_info_s){
"video encoding using libavcodec",
"lavc",