mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
avaudenc: Implement flush vfunc properly
This commit is contained in:
parent
9456fb86c7
commit
e281493f29
1 changed files with 12 additions and 0 deletions
|
@ -67,6 +67,7 @@ static gboolean gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder,
|
|||
static GstFlowReturn gst_ffmpegaudenc_handle_frame (GstAudioEncoder * encoder,
|
||||
GstBuffer * inbuf);
|
||||
static gboolean gst_ffmpegaudenc_stop (GstAudioEncoder * encoder);
|
||||
static void gst_ffmpegaudenc_flush (GstAudioEncoder * encoder);
|
||||
|
||||
static void gst_ffmpegaudenc_set_property (GObject * object,
|
||||
guint prop_id, const GValue * value, GParamSpec * pspec);
|
||||
|
@ -155,6 +156,7 @@ gst_ffmpegaudenc_class_init (GstFFMpegAudEncClass * klass)
|
|||
|
||||
gstaudioencoder_class->stop = GST_DEBUG_FUNCPTR (gst_ffmpegaudenc_stop);
|
||||
gstaudioencoder_class->getcaps = GST_DEBUG_FUNCPTR (gst_ffmpegaudenc_getcaps);
|
||||
gstaudioencoder_class->flush = GST_DEBUG_FUNCPTR (gst_ffmpegaudenc_flush);
|
||||
gstaudioencoder_class->set_format =
|
||||
GST_DEBUG_FUNCPTR (gst_ffmpegaudenc_set_format);
|
||||
gstaudioencoder_class->handle_frame =
|
||||
|
@ -196,6 +198,16 @@ gst_ffmpegaudenc_stop (GstAudioEncoder * encoder)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_ffmpegaudenc_flush (GstAudioEncoder * encoder)
|
||||
{
|
||||
GstFFMpegAudEnc *ffmpegauddec = (GstFFMpegAudEnc *) encoder;
|
||||
|
||||
if (ffmpegauddec->opened) {
|
||||
avcodec_flush_buffers (ffmpegauddec->context);
|
||||
}
|
||||
}
|
||||
|
||||
static GstCaps *
|
||||
gst_ffmpegaudenc_getcaps (GstAudioEncoder * encoder, GstCaps * filter)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue