aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-06-29 22:41:20 +0000
committerMåns Rullgård <mans@mansr.com>2010-06-29 22:41:20 +0000
commit7dbbf6a14a675a654d1d780d33de1a49da6e17ee (patch)
tree64f44c4488c6fc85f12d9917bca963eeb0599327 /ffplay.c
parent82a8d0f1148fa4c484ae7670c362265e22b17ccc (diff)
downloadffmpeg-7dbbf6a14a675a654d1d780d33de1a49da6e17ee.tar.gz
ffplay: remove VLA
Originally committed as revision 23892 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 129cd28871..e65226a453 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -168,6 +168,7 @@ typedef struct VideoState {
int last_i_start;
RDFTContext *rdft;
int rdft_bits;
+ FFTSample *rdft_data;
int xpos;
SDL_Thread *subtitle_tid;
@@ -917,12 +918,15 @@ static void video_audio_display(VideoState *s)
nb_display_channels= FFMIN(nb_display_channels, 2);
if(rdft_bits != s->rdft_bits){
av_rdft_end(s->rdft);
+ av_free(s->rdft_data);
s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
s->rdft_bits= rdft_bits;
+ s->rdft_data= av_malloc(4*nb_freq*sizeof(*s->rdft_data));
}
{
- FFTSample data[2][2*nb_freq];
+ FFTSample *data[2];
for(ch = 0;ch < nb_display_channels; ch++) {
+ data[ch] = s->rdft_data + 2*nb_freq*ch;
i = i_start + ch;
for(x = 0; x < 2*nb_freq; x++) {
double w= (x-nb_freq)*(1.0/nb_freq);