From 8fc3da62c17a022df40938456ab268e0be19b683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 3 Jan 2014 16:26:10 +0100 Subject: [PATCH] avauddec: Stop using AVCODEC_MAX_AUDIO_FRAME_SIZE And properly use the have_data variable. It's a boolean. --- ext/libav/gstavauddec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c index f195ca059d..e074f5d427 100644 --- a/ext/libav/gstavauddec.c +++ b/ext/libav/gstavauddec.c @@ -461,7 +461,7 @@ gst_ffmpegauddec_audio_frame (GstFFMpegAudDec * ffmpegdec, GstBuffer ** outbuf, GstFlowReturn * ret) { gint len = -1; - gint have_data = AVCODEC_MAX_AUDIO_FRAME_SIZE; + gint have_data = 0; AVPacket packet; AVFrame frame; @@ -475,7 +475,7 @@ gst_ffmpegauddec_audio_frame (GstFFMpegAudDec * ffmpegdec, GST_DEBUG_OBJECT (ffmpegdec, "Decode audio: len=%d, have_data=%d", len, have_data); - if (len >= 0 && have_data > 0) { + if (len >= 0 && have_data) { BufferInfo *buffer_info = frame.opaque; gint nsamples, channels, byte_per_sample; gsize output_size; @@ -569,7 +569,8 @@ gst_ffmpegauddec_audio_frame (GstFFMpegAudDec * ffmpegdec, gst_buffer_fill (*outbuf, 0, frame.data[0], output_size); } - GST_DEBUG_OBJECT (ffmpegdec, "Buffer created. Size: %d", have_data); + GST_DEBUG_OBJECT (ffmpegdec, "Buffer created. Size: %" G_GSIZE_FORMAT, + output_size); /* Reorder channels to the GStreamer channel order */ if (ffmpegdec->needs_reorder) {