From 6c8b1cb16443056d9820186a7e5bf41d93585401 Mon Sep 17 00:00:00 2001 From: PacketVideo CM Date: Wed, 7 Oct 2009 22:45:39 -0700 Subject: [PATCH] RIO-7658: Fix issue where an incorrect VOL header for MPEG4 video content results in no video playback --- .../m4v_config_parser/src/m4v_config_parser.cpp | 66 +++++++++++----------- engines/2way/src/pv_2way_sdkinfo.h | 4 +- engines/author/src/pv_author_sdkinfo.h | 4 +- engines/player/src/pv_player_sdkinfo.h | 4 +- 4 files changed, 38 insertions(+), 40 deletions(-) diff --git a/codecs_v2/utilities/m4v_config_parser/src/m4v_config_parser.cpp b/codecs_v2/utilities/m4v_config_parser/src/m4v_config_parser.cpp index 006cf277..35ee6be1 100644 --- a/codecs_v2/utilities/m4v_config_parser/src/m4v_config_parser.cpp +++ b/codecs_v2/utilities/m4v_config_parser/src/m4v_config_parser.cpp @@ -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; } } diff --git a/engines/2way/src/pv_2way_sdkinfo.h b/engines/2way/src/pv_2way_sdkinfo.h index 403c3f69..1d584582 100644 --- a/engines/2way/src/pv_2way_sdkinfo.h +++ b/engines/2way/src/pv_2way_sdkinfo.h @@ -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 diff --git a/engines/author/src/pv_author_sdkinfo.h b/engines/author/src/pv_author_sdkinfo.h index 15fb11e7..d1ffbc3a 100644 --- a/engines/author/src/pv_author_sdkinfo.h +++ b/engines/author/src/pv_author_sdkinfo.h @@ -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 diff --git a/engines/player/src/pv_player_sdkinfo.h b/engines/player/src/pv_player_sdkinfo.h index 2c17ec67..0c8894ba 100644 --- a/engines/player/src/pv_player_sdkinfo.h +++ b/engines/player/src/pv_player_sdkinfo.h @@ -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 -- 2.11.0