diff mbox

[FFmpeg-devel,3/7] avcodec/utils: Move emms_c() before memory allocation functions in avcodec_encode_video2()

Message ID 20161021133146.11956-3-michael@niedermayer.cc
State Accepted
Commit 966c5c7bb8bad6fef3efce935b943d05ccea0eaa
Headers show

Commit Message

Michael Niedermayer Oct. 21, 2016, 1:31 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Oct. 22, 2016, 12:18 p.m. UTC | #1
On Fri, Oct 21, 2016 at 03:31:42PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/utils.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

applied

[...]
diff mbox

Patch

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 7da6a66..7c26485 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1994,6 +1994,8 @@  int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
     ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
     av_assert0(ret <= 0);
 
+    emms_c();
+
     if (avpkt->data && avpkt->data == avctx->internal->byte_buffer) {
         needs_realloc = 0;
         if (user_pkt.data) {
@@ -2031,7 +2033,6 @@  int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
     if (ret < 0 || !*got_packet_ptr)
         av_packet_unref(avpkt);
 
-    emms_c();
     return ret;
 }