From 30f5125fcaaaf89d5018a9fdd8d2c2f14dfa53bc Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 20 Dec 2012 15:55:02 +0100 Subject: [PATCH] jpegenc: pass flowreturn upstream --- ext/jpeg/gstjpegenc.c | 5 +++-- ext/jpeg/gstjpegenc.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index 8ed4a922f1..0f6d8699a3 100644 --- a/ext/jpeg/gstjpegenc.c +++ b/ext/jpeg/gstjpegenc.c @@ -250,7 +250,7 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo) GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (jpegenc->current_frame); - gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (jpegenc), + jpegenc->res = gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (jpegenc), jpegenc->current_frame); jpegenc->current_frame = NULL; } @@ -463,6 +463,7 @@ gst_jpegenc_handle_frame (GstVideoEncoder * encoder, GstVideoCodecFrame * frame) i) * stride[i]; } + jpegenc->res = GST_FLOW_OK; jpegenc->output_mem = gst_allocator_alloc (NULL, jpegenc->bufsize, ¶ms); gst_memory_map (jpegenc->output_mem, &jpegenc->output_map, GST_MAP_READWRITE); @@ -520,7 +521,7 @@ gst_jpegenc_handle_frame (GstVideoEncoder * encoder, GstVideoCodecFrame * frame) jpeg_finish_compress (&jpegenc->cinfo); GST_LOG_OBJECT (jpegenc, "compressing done"); - return GST_FLOW_OK; + return jpegenc->res; invalid_frame: { diff --git a/ext/jpeg/gstjpegenc.h b/ext/jpeg/gstjpegenc.h index 0f8699bf08..d72ca046c5 100644 --- a/ext/jpeg/gstjpegenc.h +++ b/ext/jpeg/gstjpegenc.h @@ -56,6 +56,7 @@ struct _GstJpegEnc GstVideoCodecState *input_state; GstVideoFrame current_vframe; GstVideoCodecFrame *current_frame; + GstFlowReturn res; guint channels;