OSDN Git Service

RIO-7882: Fix a bug in SPS length calculation.
authorPacketVideo CM <engbuild@pv.com>
Wed, 4 Nov 2009 17:40:55 +0000 (09:40 -0800)
committerPacketVideo CM <engbuild@pv.com>
Wed, 4 Nov 2009 17:40:55 +0000 (09:40 -0800)
codecs_v2/utilities/m4v_config_parser/src/m4v_config_parser.cpp
engines/2way/src/pv_2way_sdkinfo.h
engines/author/src/pv_author_sdkinfo.h
engines/player/src/pv_player_sdkinfo.h

index 35ee6be..2d67a35 100644 (file)
@@ -820,8 +820,7 @@ OSCL_EXPORT_REF int16 iGetAVCConfigInfo(uint8 *buffer, int32 length, int32 *widt
 
             sps_length = 0;
             // search for the next start code
-            while (!(sps[sps_length] == 0 && sps[sps_length+1] == 0 && sps[sps_length+2] == 1) &&
-                    sps_length < length - i - 2)
+            while (sps_length < length - i - 2 && !(sps[sps_length] == 0 && sps[sps_length+1] == 0 && sps[sps_length+2] == 1))
             {
                 sps_length++;
             }
@@ -834,6 +833,12 @@ OSCL_EXPORT_REF int16 iGetAVCConfigInfo(uint8 *buffer, int32 length, int32 *widt
 
             pps_length = length - i - sps_length - 3;
             pps = sps + sps_length + 3;
+
+            // for zero_byte
+            if (sps_length > 0 && sps[sps_length-1] == 0)
+            {
+                sps_length--;
+            }
         }
         else
         {
index d2538e1..37a4779 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PV2WAY_ENGINE_SDKINFO_LABEL "1050795"
-#define PV2WAY_ENGINE_SDKINFO_DATE 0x20091028
+#define PV2WAY_ENGINE_SDKINFO_LABEL "1051372"
+#define PV2WAY_ENGINE_SDKINFO_DATE 0x20091029
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index 08fdeb5..c06f926 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1050795"
-#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091028
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1051372"
+#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091029
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index f7c602d..5d95309 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "1050795"
-#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091028
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1051372"
+#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091029
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED