summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorYeongjin Jeong <yeongjin.jeong@navercorp.com>2019-04-29 15:22:52 +0900
committerYeongjin Jeong <yeongjin.jeong@navercorp.com>2019-04-29 15:40:08 +0900
commit472f2ef104e574e524c2b707ddb028911ebdfe09 (patch)
treec73b17e949ff1fd2cac1b58b82bef0c16816765b /ext
parent93e2466115172a858ec1a70a3dac2c3d13bec87f (diff)
downloadgst-libav-472f2ef104e574e524c2b707ddb028911ebdfe09.tar.gz
avauddec: Ensure drain even if codec has not delay capabilities
There are decoders that need to be drained if they work on multi-threads, even if AV_CODEC_CAP_DELAY is not set.
Diffstat (limited to 'ext')
-rw-r--r--ext/libav/gstavauddec.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c
index f400d86..45eda1c 100644
--- a/ext/libav/gstavauddec.c
+++ b/ext/libav/gstavauddec.c
@@ -597,29 +597,20 @@ no_codec:
static void
gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec)
{
- GstFFMpegAudDecClass *oclass;
gboolean got_any_frames = FALSE;
+ gboolean got_frame;
- oclass = (GstFFMpegAudDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
-
- if (oclass->in_plugin->capabilities & AV_CODEC_CAP_DELAY) {
- gboolean got_frame;
-
- GST_LOG_OBJECT (ffmpegdec,
- "codec has delay capabilities, calling until libav has drained everything");
-
- if (avcodec_send_packet (ffmpegdec->context, NULL))
- goto send_packet_failed;
+ if (avcodec_send_packet (ffmpegdec->context, NULL))
+ goto send_packet_failed;
- do {
- GstFlowReturn ret;
+ do {
+ GstFlowReturn ret;
- got_frame = gst_ffmpegauddec_frame (ffmpegdec, &ret);
- if (got_frame)
- got_any_frames = TRUE;
- } while (got_frame);
- avcodec_flush_buffers (ffmpegdec->context);
- }
+ got_frame = gst_ffmpegauddec_frame (ffmpegdec, &ret);
+ if (got_frame)
+ got_any_frames = TRUE;
+ } while (got_frame);
+ avcodec_flush_buffers (ffmpegdec->context);
if (got_any_frames)
gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (ffmpegdec), NULL, 1);