Browse code

qsvenc: do not re-execute encoding on all positive status codes

It should only be done for DEVICE_BUSY/IN_EXECUTION

(cherry picked from commit 0956fd460681e8ccbdae19f135f0d3970bf95c2f)
Fixes ticket #5924.

Anton Khirnov authored on 2016/07/14 19:52:20
Showing 1 changed files
... ...
@@ -982,7 +982,7 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q,
982 982
         ret = MFXVideoENCODE_EncodeFrameAsync(q->session, enc_ctrl, surf, bs, sync);
983 983
         if (ret == MFX_WRN_DEVICE_BUSY)
984 984
             av_usleep(500);
985
-    } while (ret > 0);
985
+    } while (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_WRN_IN_EXECUTION);
986 986
 
987 987
     if (ret < 0) {
988 988
         av_packet_unref(&new_pkt);