Author: arekm                        Date: Sun Nov  9 19:17:40 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new/updated

---- Files affected:
SOURCES:
   mjpegtools-gcc4.patch (1.1 -> 1.2) , mjpegtools-lavrec-memleak.patch (NONE 
-> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/mjpegtools-gcc4.patch
diff -u SOURCES/mjpegtools-gcc4.patch:1.1 SOURCES/mjpegtools-gcc4.patch:1.2
--- SOURCES/mjpegtools-gcc4.patch:1.1   Mon Mar 20 02:20:17 2006
+++ SOURCES/mjpegtools-gcc4.patch       Sun Nov  9 20:17:35 2008
@@ -19,3 +19,147 @@
  #include <iostream>
  
  
+--- mjpegtools-1.8.0/mpeg2enc/encodertypes.h.org       2008-11-09 
20:07:29.783454289 +0100
++++ mjpegtools-1.8.0/mpeg2enc/encodertypes.h   2008-11-09 20:07:51.390118792 
+0100
+@@ -25,6 +25,7 @@
+  */
+ 
+ 
++#include <stdlib.h>
+ 
+ 
+ class Parity
+--- mjpegtools-1.8.0/mpeg2enc/macroblock.cc.org        2008-11-09 
20:08:15.910324594 +0100
++++ mjpegtools-1.8.0/mpeg2enc/macroblock.cc    2008-11-09 20:08:26.857407091 
+0100
+@@ -20,6 +20,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <limits.h>
+ 
+ #include "macroblock.hh"
+ #include "mpeg2syntaxcodes.h"
+--- mjpegtools-1.8.0/mpeg2enc/picturereader.cc.org     2008-11-09 
20:09:58.260106210 +0100
++++ mjpegtools-1.8.0/mpeg2enc/picturereader.cc 2008-11-09 20:10:08.073439077 
+0100
+@@ -24,6 +24,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <limits.h>
+ #include <string.h>
+ #include <errno.h>
+ #include "simd.h"
+--- mjpegtools-1.8.0/mplex/inputstrm.cpp.org   2008-11-09 20:11:37.320513190 
+0100
++++ mjpegtools-1.8.0/mplex/inputstrm.cpp       2008-11-09 20:11:46.486762448 
+0100
+@@ -22,6 +22,7 @@
+ 
+ 
+ #include <config.h>
++#include <limits.h>
+ #include <assert.h>
+ 
+ #include "mjpeg_types.h"
+--- mjpegtools-1.8.0/mplex/multiplexor.cpp.org 2008-11-09 20:12:19.707175286 
+0100
++++ mjpegtools-1.8.0/mplex/multiplexor.cpp     2008-11-09 20:12:28.357174433 
+0100
+@@ -22,6 +22,7 @@
+ #include <config.h>
+ #include <math.h>
+ #include <stdlib.h>
++#include <string.h>
+ 
+ #include <mjpeg_types.h>
+ #include <mjpeg_logging.h>
+--- mjpegtools-1.8.0/mplex/padstrm.cpp.org     2008-11-09 20:13:15.013419657 
+0100
++++ mjpegtools-1.8.0/mplex/padstrm.cpp 2008-11-09 20:13:23.670088487 +0100
+@@ -24,6 +24,8 @@
+ #include "config.h"
+ #endif
+ 
++#include <string.h>
++
+ #include "padstrm.hpp"
+ 
+ 
+--- mjpegtools-1.8.0/mplex/main.cpp.org        2008-11-09 20:13:52.250083036 
+0100
++++ mjpegtools-1.8.0/mplex/main.cpp    2008-11-09 20:14:01.164248184 +0100
+@@ -30,6 +30,7 @@
+ #ifdef HAVE_GETOPT_H
+ #include <getopt.h>
+ #endif
++#include <string.h>
+ #include <string>
+ #include <memory>
+ #include <sys/stat.h>
+--- mjpegtools-1.9.0rc3/y4mdenoise/Set.hh
++++ mjpegtools-1.9.0rc3/y4mdenoise/Set.hh
+@@ -23,7 +23,7 @@
+               // How we implement ourselves.
+       
+ public:
+-      typedef typename Imp::Allocator Allocator;
++      typedef typename Imp::Allocator_t Allocator;
+               // The type of allocator to use to allocate items in the set.
+ 
+       Set (const PRED &a_rPred = PRED(),
+--- mjpegtools-1.9.0rc3/y4mdenoise/SkipList.hh
++++ mjpegtools-1.9.0rc3/y4mdenoise/SkipList.hh
+@@ -57,19 +57,19 @@
+               // Will give good sorting for up to e^10 items.
+       
+ public:
+-      typedef Allocator<Node,HEADERCHUNK> Allocator;
++      typedef Allocator<Node,HEADERCHUNK> Allocator_t;
+               // The type of node allocator to use.
+ 
+-      static Allocator sm_oNodeAllocator;
++      static Allocator_t sm_oNodeAllocator;
+               // The default node allocator.
+ 
+       SkipList (const PRED &a_rPred = PRED(),
+-                      Allocator &a_rAlloc = sm_oNodeAllocator);
++                      Allocator_t &a_rAlloc = sm_oNodeAllocator);
+               // Default constructor.  Must be followed by Init().
+ 
+       SkipList (Status_t &a_reStatus, bool a_bAllowDuplicates,
+                       uint32_t a_nRandSeed, const PRED &a_rPred = PRED(),
+-                      Allocator &a_rAlloc = sm_oNodeAllocator);
++                      Allocator_t &a_rAlloc = sm_oNodeAllocator);
+               // Constructor.  Specify whether or not duplicates are allowed,
+               // and provide a random number seed.
+ 
+@@ -255,7 +255,7 @@
+ 
+ private:
+       
+-      Allocator &m_rNodeAllocator;
++      Allocator_t &m_rNodeAllocator;
+               // Where we get memory to allocate nodes.
+ 
+       bool m_bAllowDuplicates;
+@@ -337,7 +337,7 @@
+ 
+ // The default node allocator.  Allocates 64K at a time.
+ template <class KEY, class VALUE, class KEYFN, class PRED>
+-typename SkipList<KEY,VALUE,KEYFN,PRED>::Allocator
++typename SkipList<KEY,VALUE,KEYFN,PRED>::Allocator_t
+       SkipList<KEY,VALUE,KEYFN,PRED>::sm_oNodeAllocator (65536);
+ 
+ 
+@@ -345,7 +345,7 @@
+ // Default constructor.  Must be followed by Init().
+ template <class KEY, class VALUE, class KEYFN, class PRED>
+ SkipList<KEY,VALUE,KEYFN,PRED>::SkipList (const PRED &a_rPred,
+-              Allocator &a_rAlloc)
++              Allocator_t &a_rAlloc)
+       : m_rNodeAllocator (a_rAlloc), m_oPred (a_rPred)
+ {
+       // Set up some defaults.
+@@ -371,7 +371,7 @@
+ template <class KEY, class VALUE, class KEYFN, class PRED>
+ SkipList<KEY,VALUE,KEYFN,PRED>::SkipList (Status_t &a_reStatus,
+               bool a_bAllowDuplicates, uint32_t a_nRandSeed,
+-              const PRED &a_rPred, Allocator &a_rAlloc)
++              const PRED &a_rPred, Allocator_t &a_rAlloc)
+       : m_rNodeAllocator (a_rAlloc), m_oPred (a_rPred)
+ {
+       // Make sure they didn't start us off with an error.

================================================================
Index: SOURCES/mjpegtools-lavrec-memleak.patch
diff -u /dev/null SOURCES/mjpegtools-lavrec-memleak.patch:1.1
--- /dev/null   Sun Nov  9 20:17:41 2008
+++ SOURCES/mjpegtools-lavrec-memleak.patch     Sun Nov  9 20:17:34 2008
@@ -0,0 +1,78 @@
+--- mjpegtools-1.8.0/lavtools/lav_io.c 2005-08-27 13:47:20.000000000 +0200
++++ mjpegtools-1.8.0___fixed/lavtools/lav_io.c 2006-05-14 05:45:48.000000000 
+0200
+@@ -540,15 +540,12 @@
+ 
+ int lav_write_audio(lav_file_t *lav_file, uint8_t *buff, long samps)
+ {
+-   int res;
++   int res = -1;
+ #ifdef HAVE_LIBQUICKTIME
+    int i, j;
+-   int16_t *qt_audio = (int16_t *)buff, **qt_audion;
++   int16_t *buff16 = (int16_t *)buff, **qt_audion;
+    int channels = lav_audio_channels(lav_file);
+-
+-   qt_audion = malloc(channels * sizeof (int16_t **));
+-   for (i = 0; i < channels; i++)
+-      qt_audion[i] = (int16_t *)malloc(samps * lav_file->bps);
++   int bits = lav_audio_bits(lav_file);
+ #endif
+ 
+    video_format = lav_file->format; internal_error = 0; /* for error messages 
*/
+@@ -557,24 +554,43 @@
+    {
+       case 'a':
+       case 'A':
+-         res = AVI_write_audio( lav_file->avi_fd, buff, samps*lav_file->bps);
++         res = AVI_write_audio(lav_file->avi_fd, buff, samps*lav_file->bps);
+          break;
+ #ifdef HAVE_LIBQUICKTIME
+       case 'q':
+-      /* Deinterleave the audio into the two channels. */
+-      for (i = 0; i < samps; i++)
+-          {
+-          for (j = 0; j < channels; j++)
+-              qt_audion[j][i] = qt_audio[(channels*i) + j];
+-          }
+-      res = lqt_encode_audio_track(lav_file->qt_fd, qt_audion, NULL,samps,0);
+-      for (j = 0; j < channels; j++)
+-          free(qt_audion[j]);
+-      free(qt_audion);
+-        break;
++       if (bits != 16 || channels > 1)
++       {
++          /* Deinterleave the audio into the two channels and/or convert
++           * bits per sample to the required format.
++           */
++          qt_audion = malloc(channels * sizeof(*qt_audion));
++          for (i = 0; i < channels; i++)
++            qt_audion[i] = malloc(samps * sizeof(**qt_audion));
++
++          if (bits == 16)
++            for (i = 0; i < samps; i++)
++              for (j = 0; j < channels; j++)
++                qt_audion[j][i] = buff16[channels * i + j];
++          else 
++            if (bits == 8)
++              for (i = 0; i < samps; i++)
++                for (j = 0; j < channels; j++)
++                  qt_audion[j][i] = ((int16_t)(buff[channels * i + j]) << 8) 
^ 0x8000;
++
++          if (bits == 8 || bits == 16)
++            res = lqt_encode_audio_track(lav_file->qt_fd, qt_audion, NULL, 
samps, 0);
++
++          for (i = 0; i < channels; i++)
++            free(qt_audion[i]);
++          free(qt_audion);
++        } else {
++          qt_audion = &buff16;
++          res = lqt_encode_audio_track(lav_file->qt_fd, qt_audion, NULL, 
samps, 0);
++        }
++        break;
+ #endif
+       default:
+-         res = -1;
++         break;
+    }
+ 
+    return res;
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/mjpegtools-gcc4.patch?r1=1.1&r2=1.2&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to