]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vorbis_enc.c
remove invalid free() forgotten in r12300
[ffmpeg] / libavcodec / vorbis_enc.c
index 3e5d83a170549e730f0ef0be7ad9b01256885859..3912022118c307e79bbc4d99125cde6c38e332d0 100644 (file)
@@ -1,19 +1,21 @@
 /*
  * copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org>
  *
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
@@ -754,7 +756,7 @@ static void floor_encode(venc_context_t * venc, floor_t * fc, PutBitContext * pb
                     int maxval = 1;
                     if (c->books[l] != -1)
                         maxval = venc->codebooks[c->books[l]].nentries;
-                    // coded could be -1, but this still works, cause thats 0
+                    // coded could be -1, but this still works, cause that is 0
                     if (coded[counter + k] < maxval) break;
                 }
                 assert(l != csub);
@@ -904,7 +906,7 @@ static int apply_window_and_mdct(venc_context_t * venc, signed short * audio, in
             float * offset = venc->samples + channel*window_len*2 + window_len;
             j = channel;
             for (i = 0; i < samples; i++, j += venc->channels)
-                offset[i] = audio[j] / 32768. / n * win[window_len - i - 1];
+                offset[i] = -audio[j] / 32768. / n * win[window_len - i - 1]; //FIXME find out why the sign has to be fliped
         }
     } else {
         for (channel = 0; channel < venc->channels; channel++) {
@@ -921,7 +923,7 @@ static int apply_window_and_mdct(venc_context_t * venc, signed short * audio, in
             float * offset = venc->saved + channel*window_len;
             j = channel;
             for (i = 0; i < samples; i++, j += venc->channels)
-                offset[i] = audio[j] / 32768. / n * win[i];
+                offset[i] = -audio[j] / 32768. / n * win[i]; //FIXME find out why the sign has to be fliped
         }
         venc->have_saved = 1;
     } else {
@@ -1031,10 +1033,10 @@ static int vorbis_encode_close(AVCodecContext * avccontext)
     if (venc->floors)
         for (i = 0; i < venc->nfloors; i++) {
             int j;
-            av_freep(&venc->floors[i].classes);
             if (venc->floors[i].classes)
                 for (j = 0; j < venc->floors[i].nclasses; j++)
                     av_freep(&venc->floors[i].classes[j].books);
+            av_freep(&venc->floors[i].classes);
             av_freep(&venc->floors[i].partition_to_class);
             av_freep(&venc->floors[i].list);
         }
@@ -1052,6 +1054,8 @@ static int vorbis_encode_close(AVCodecContext * avccontext)
             av_freep(&venc->mappings[i].mux);
             av_freep(&venc->mappings[i].floor);
             av_freep(&venc->mappings[i].residue);
+            av_freep(&venc->mappings[i].magnitude);
+            av_freep(&venc->mappings[i].angle);
         }
     av_freep(&venc->mappings);