lzo1x_999_compress函数参数问题

CXBTFFrame appendContent(CXBTFWriter &writer, int width, int height, unsigned char *data, unsigned int size, unsigned int format, unsigned int flags)
 {
   CXBTFFrame frame;
-  lzo_uint compressedSize = size;
+  unsigned int packedSize = size;
+#ifdef USE_LZO_PACKING
   if ((flags & FLAGS_USE_LZO) == FLAGS_USE_LZO)
   {
     // grab a temporary buffer for unpacking into
-    squish::u8 *compressed = new squish::u8[size + size / 16 + 64 + 3]; // see simple.c in lzo
-    squish::u8 *working = new squish::u8[LZO1X_999_MEM_COMPRESS];
-    if (compressed && working)
+    unsigned char *packed  = new unsigned char[size + size / 16 + 64 + 3]; // see simple.c in lzo
+    unsigned char *working = new unsigned char[LZO1X_999_MEM_COMPRESS];
+    if (packed && working)
     {
-      if (lzo1x_999_compress(data, size, compressed, (lzo_uint*)&compressedSize, working) != LZO_E_OK || compressedSize > size)
+      if (lzo1x_999_compress(data, size, packed, (lzo_uint*)&packedSize, working) != LZO_E_OK || packedSize > size)
       {
         // compression failed, or compressed size is bigger than uncompressed, so store as uncompressed
-        compressedSize = size;
+        packedSize = size;
         writer.AppendContent(data, size);
       }
       else
       { // success
         lzo_uint optimSize = size;
-        lzo1x_optimize(compressed, compressedSize, data, &optimSize, NULL);
-        writer.AppendContent(compressed, compressedSize);
+        lzo1x_optimize(packed, packedSize, data, &optimSize, NULL);
+        writer.AppendContent(packed, packedSize);
       }
       delete[] working;
-      delete[] compressed;
+      delete[] packed;
     }
   }
   else
+#endif
   {
     writer.AppendContent(data, size);
   }
-  frame.SetPackedSize(compressedSize);
+  frame.SetPackedSize(packedSize);
   frame.SetUnpackedSize(size);
   frame.SetWidth(width);
   frame.SetHeight(height);
@@ -225,16 +243,7 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
   argbFormat.BytesPerPixel = 4;
http://sourceforge.net/mailarchive/forum.php?forum_name=xbmc-svn&style=nested&viewmonth=201104
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值