From: Yukinori Yamazoe <[email protected]>
Signed-off-by: Luca Barbato <[email protected]>
---
MFX_WRN_DEVICE_BUSY handling should use an avoption to set the timeout.
The MFX_WRN_VIDEO_PARAM_CHANGED should be accounted in the patch introducing
the loop probably.
libavcodec/qsv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index cd6c7b3..3c01eab 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -27,6 +27,7 @@
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/log.h"
+#include "libavutil/time.h"
#include "internal.h"
#include "avcodec.h"
#include "qsv.h"
@@ -308,6 +309,8 @@ int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
} else {
break;
}
+ } else if (ret == MFX_WRN_DEVICE_BUSY) {
+ av_usleep(1000);
}
if (!(insurf = get_surface(q)))
@@ -315,7 +318,8 @@ int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q,
ret = MFXVideoDECODE_DecodeFrameAsync(q->session, bs,
insurf, &outsurf, &sync);
- } while (ret == MFX_ERR_MORE_SURFACE || ret == MFX_ERR_MORE_DATA);
+ } while (ret == MFX_ERR_MORE_SURFACE || ret == MFX_ERR_MORE_DATA ||
+ ret == MFX_WRN_VIDEO_PARAM_CHANGED || ret == MFX_WRN_DEVICE_BUSY);
q->last_decode_status = ret;
--
1.8.3.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel