avvidenc: Don't send any frames downstream when draining unless requested to do so

This commit is contained in:
Sebastian Dröge 2012-11-20 11:53:52 +01:00
parent 5ffd21f1ee
commit d3f8c5f0cc

View file

@ -787,8 +787,9 @@ gst_ffmpegvidenc_flush_buffers (GstFFMpegVidEnc * ffmpegenc, gboolean send)
(("Could not write to file \"%s\"."), ffmpegenc->filename),
GST_ERROR_SYSTEM);
if (gst_video_encoder_allocate_output_frame (GST_VIDEO_ENCODER (ffmpegenc),
frame, ret_size) != GST_FLOW_OK) {
if (send) {
if (gst_video_encoder_allocate_output_frame (GST_VIDEO_ENCODER
(ffmpegenc), frame, ret_size) != GST_FLOW_OK) {
#ifndef GST_DISABLE_GST_DEBUG
GstFFMpegVidEncClass *oclass =
(GstFFMpegVidEncClass *) (G_OBJECT_GET_CLASS (ffmpegenc));
@ -805,6 +806,9 @@ gst_ffmpegvidenc_flush_buffers (GstFFMpegVidEnc * ffmpegenc, gboolean send)
GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (ffmpegenc), frame);
} else {
gst_video_codec_frame_unref (frame);
}
}
}