From 373b8fa049a8e525505d092880152f99de0496fb Mon Sep 17 00:00:00 2001 From: "benjamin.drung@gmail.com" Date: Fri, 23 May 2014 20:28:24 +0000 Subject: [PATCH] Fix audio size Signed-off-by: Michael Niedermayer Signed-off-by: Benjamin Drung --- src/FFmpeg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FFmpeg.cpp b/src/FFmpeg.cpp index 590b3386f..ade484887 100644 --- a/src/FFmpeg.cpp +++ b/src/FFmpeg.cpp @@ -491,7 +491,6 @@ int import_ffmpeg_decode_frame(streamContext *sc, bool flushing) frame, // out &got_output, // out &avpkt); // in - sc->m_decodedAudioSamplesValidSiz = frame->nb_samples; if (nBytesDecoded < 0) { @@ -504,6 +503,7 @@ int import_ffmpeg_decode_frame(streamContext *sc, bool flushing) int channels = sc->m_codecCtx->channels; unsigned int newsize = sc->m_samplesize * frame->nb_samples * channels; + sc->m_decodedAudioSamplesValidSiz = newsize; // Reallocate the audio sample buffer if it's smaller than the frame size. if (newsize > sc->m_decodedAudioSamplesSiz ) {