[vlc-devel] commit: Made sure that our output buffer is large enough with TTA. ( Laurent Aimar )

git version control git at videolan.org
Mon Jun 29 11:39:59 CEST 2009


vlc | branch: 1.0-bugfix | Laurent Aimar <fenrir at videolan.org> | Mon Jun 29 00:16:36 2009 +0200| [c4ab699ce734f130a2181b4d6b701a36a759a9cf] | committer: Derk-Jan Hartman 

Made sure that our output buffer is large enough with TTA.

It allows playing multi-channels TTA and fixed a segfault as the decoder
does not check for sufficient space.
(cherry picked from commit 698c89004f2a022c630e4f252f1df2465cc3fd37)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4ab699ce734f130a2181b4d6b701a36a759a9cf
---

 modules/codec/avcodec/audio.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 36a1b8c..90c5e7e 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -187,6 +187,11 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
         p_sys->i_output_max = 8 * sizeof(int32_t) * 131072;
         break;
 #endif
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 4, 0 )
+    case CODEC_ID_TTA:
+        p_sys->i_output_max = p_sys->p_context->channels * sizeof(int32_t) * p_sys->p_context->sample_rate * 2;
+        break;
+#endif
     case CODEC_ID_FLAC:
         p_sys->i_output_max = 8 * sizeof(int32_t) * 65535;
         break;




More information about the vlc-devel mailing list