summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2015-10-25 04:45:44 -0500
committerwm4 <wm4@nowhere>2015-10-25 15:21:11 +0100
commitd6e7190836118542b1dba8f0f2d2f1d9821d10dd (patch)
tree559b4e30b2e2fecc947599f8f2fc23fd369b164e /video/decode/vd_lavc.c
parentd1a46c2c327dad53f1e8808e16c626530be163d1 (diff)
downloadmpv-d6e7190836118542b1dba8f0f2d2f1d9821d10dd.tar.bz2
mpv-d6e7190836118542b1dba8f0f2d2f1d9821d10dd.tar.xz
vd_lavc: make software decoding fallback an option
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 5c97526d7c..91569b99f3 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -74,6 +74,7 @@ struct vd_lavc_params {
int threads;
int bitexact;
int check_hw_profile;
+ int software_fallback;
char **avopts;
};
@@ -101,6 +102,7 @@ const struct m_sub_options vd_lavc_conf = {
OPT_INT("threads", threads, M_OPT_MIN, .min = 0),
OPT_FLAG("bitexact", bitexact, 0),
OPT_FLAG("check-hw-profile", check_hw_profile, 0),
+ OPT_FLAG("software-fallback", software_fallback, 0),
OPT_KEYVALUELIST("o", avopts, 0),
{0}
},
@@ -108,6 +110,7 @@ const struct m_sub_options vd_lavc_conf = {
.defaults = &(const struct vd_lavc_params){
.show_all = 0,
.check_hw_profile = 1,
+ .software_fallback = 1,
.skip_loop_filter = AVDISCARD_DEFAULT,
.skip_idct = AVDISCARD_DEFAULT,
.skip_frame = AVDISCARD_DEFAULT,
@@ -627,7 +630,8 @@ static void decode(struct dec_video *vd, struct demux_packet *packet,
if (ret < 0) {
MP_WARN(vd, "Error while decoding frame!\n");
- ctx->hwdec_failed = true;
+ if (lavc_param->software_fallback)
+ ctx->hwdec_failed = true;
return;
}