OSDN Git Service

RIO-7658: Fix issue where an incorrect VOL header for MPEG4 video content results...
authorPacketVideo CM <engbuild@pv.com>
Thu, 8 Oct 2009 05:45:39 +0000 (22:45 -0700)
committerPacketVideo CM <engbuild@pv.com>
Thu, 8 Oct 2009 05:45:39 +0000 (22:45 -0700)
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 006cf27..35ee6be 100644 (file)
@@ -98,6 +98,22 @@ int16 SearchNextM4VFrame(mp4StreamType *psBits)
     return status;
 }
 
+int16 SearchVOLHeader(mp4StreamType *psBits)
+{
+    uint32 codeword = 0;
+    int16 status = 0;
+    do
+    {
+        status = SearchNextM4VFrame(psBits); /* search 0x00 0x00 0x01 */
+        if (status != 0)
+            return MP4_INVALID_VOL_PARAM;
+
+        status = ReadBits(psBits, VOL_START_CODE_LENGTH, &codeword);
+    }
+    while ((codeword != VOL_START_CODE) && (status == 0));
+    return status;
+}
+
 OSCL_EXPORT_REF int16 iGetM4VConfigInfo(uint8 *buffer, int32 length, int32 *width, int32 *height, int32 *display_width, int32 *display_height)
 {
     int16 status;
@@ -152,7 +168,13 @@ OSCL_EXPORT_REF int16 iDecodeVOLHeader(mp4StreamType *psBits, int32 *width, int3
 
 
         ReadBits(psBits, 32, &codeword);
-        if (codeword != VISUAL_OBJECT_START_CODE) return MP4_INVALID_VOL_PARAM;
+        if (codeword != VISUAL_OBJECT_START_CODE)
+        {
+            /* Search for VOL_HEADER */
+            if (SearchVOLHeader(psBits) != 0)
+                return MP4_INVALID_VOL_PARAM;
+            goto decode_vol;
+        }
 
         /*  is_visual_object_identifier            */
         ReadBits(psBits, 1, &codeword);
@@ -191,17 +213,9 @@ OSCL_EXPORT_REF int16 iDecodeVOLHeader(mp4StreamType *psBits, int32 *width, int3
         }
         else
         {
-            int16 status = 0;
-            do
-            {
-                /* Search for VOL_HEADER */
-                status = SearchNextM4VFrame(psBits); /* search 0x00 0x00 0x01 */
-                if (status != 0)
-                    return MP4_INVALID_VOL_PARAM;
-
-                status = ReadBits(psBits, VOL_START_CODE_LENGTH, &codeword);
-            }
-            while ((codeword != VOL_START_CODE) && (status == 0));
+            /* Search for VOL_HEADER */
+            if (SearchVOLHeader(psBits) != 0)
+                return MP4_INVALID_VOL_PARAM;
             goto decode_vol;
         }
         /* next_start_code() */
@@ -235,17 +249,9 @@ OSCL_EXPORT_REF int16 iDecodeVOLHeader(mp4StreamType *psBits, int32 *width, int3
             }
             else
             {
-                int16 status = 0;
-                do
-                {
-                    /* Search for VOL_HEADER */
-                    status = SearchNextM4VFrame(psBits); /* search 0x00 0x00 0x01 */
-                    if (status != 0)
-                        return MP4_INVALID_VOL_PARAM;
-
-                    status = ReadBits(psBits, VOL_START_CODE_LENGTH, &codeword);
-                }
-                while ((codeword != VOL_START_CODE) && (status == 0));
+                /* Search for VOL_HEADER */
+                if (SearchVOLHeader(psBits) != 0)
+                    return MP4_INVALID_VOL_PARAM;
                 goto decode_vol;
             }
         }
@@ -401,17 +407,9 @@ decode_vol:
         else
         {
             {
-                int16 status = 0;
-                do
-                {
-                    /* Search for VOL_HEADER */
-                    status = SearchNextM4VFrame(psBits); /* search 0x00 0x00 0x01 */
-                    if (status != 0)
-                        return MP4_INVALID_VOL_PARAM;
-
-                    status = ReadBits(psBits, VOL_START_CODE_LENGTH, &codeword);
-                }
-                while ((codeword != VOL_START_CODE) && (status == 0));
+                /* Search for VOL_HEADER */
+                if (SearchVOLHeader(psBits) != 0)
+                    return MP4_INVALID_VOL_PARAM;
                 goto decode_vol;
             }
         }
index 403c3f6..1d58458 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 "995757"
-#define PV2WAY_ENGINE_SDKINFO_DATE 0x20091001
+#define PV2WAY_ENGINE_SDKINFO_LABEL "997505"
+#define PV2WAY_ENGINE_SDKINFO_DATE 0x20091002
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index 15fb11e..d1ffbc3 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 "995757"
-#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091001
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "997505"
+#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091002
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index 2c17ec6..0c8894b 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 "995757"
-#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091001
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "997505"
+#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091002
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED