[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 00:18:18 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jun 29 00:16:36 2009 +0200| [698c89004f2a022c630e4f252f1df2465cc3fd37] | committer: Laurent Aimar 

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.

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

 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 9d7a056..d86c0bf 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