OSDN Git Service

RIO-7579: PVPlayer crashes when trying to do Progressive Streaming of an MP4 Clip
authorPacketVideo CM <engbuild@pv.com>
Wed, 21 Oct 2009 16:46:38 +0000 (09:46 -0700)
committerPacketVideo CM <engbuild@pv.com>
Wed, 21 Oct 2009 16:46:38 +0000 (09:46 -0700)
engines/2way/src/pv_2way_sdkinfo.h
engines/author/src/pv_author_sdkinfo.h
engines/player/src/pv_player_sdkinfo.h
fileformats/mp4/parser/include/movieatom.h
fileformats/mp4/parser/include/movieheaderatom.h
fileformats/mp4/parser/include/mpeg4file.h
fileformats/mp4/parser/include/pvuserdataatom.h
fileformats/mp4/parser/src/movieheaderatom.cpp
fileformats/mp4/parser/src/mpeg4file.cpp

index 8de71b8..9daf951 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 "1021272"
+#define PV2WAY_ENGINE_SDKINFO_LABEL "1021968"
 #define PV2WAY_ENGINE_SDKINFO_DATE 0x20091015
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index 99b04c2..bb406c6 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 "1021272"
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1021968"
 #define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091015
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index c010b08..b0256d6 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 "1021272"
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1021968"
 #define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091015
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED
index 400baa0..882c724 100644 (file)
@@ -161,7 +161,7 @@ class MovieAtom : public Atom
             }
         }
 
-        OSCL_wHeapString<OsclMemAllocator> getCreationDate()
+        OSCL_wString& getCreationDate()
         {
             if (_pmovieHeaderAtom != NULL)
             {
index e4a92d4..cbf8916 100644 (file)
@@ -84,14 +84,16 @@ class MovieHeaderAtom : public FullAtom
             return _nextTrackID;
         }
 
-        OSCL_wHeapString<OsclMemAllocator> getCreationDate()
+        OSCL_wString& getCreationDate()
         {
-            return (convertTimeToDate(_creationTime));
+            convertTimeToDate();
+            return (iCreationDataString);
         }
 
     private:
 
-        OSCL_wHeapString<OsclMemAllocator> convertTimeToDate(uint32 time);
+        OSCL_wHeapString<OsclMemAllocator> iCreationDataString;
+        void convertTimeToDate();
 
         uint32 _creationTime; // 4/8 (32/64bits) -- Will templatize later - using 32bits (version 0) for now
         uint64 _creationTime64;
index b89ba58..ed17df1 100644 (file)
@@ -243,7 +243,7 @@ class Mpeg4File : public IMpeg4File, public Parentable
         OSCL_wString& getPVRating(MP4FFParserOriginalCharEnc &charType) ;
         OSCL_wString& getPVCopyright(MP4FFParserOriginalCharEnc &charType) ;
         OSCL_wString& getPVVersion(MP4FFParserOriginalCharEnc &charType) ;
-        OSCL_wHeapString<OsclMemAllocator> getCreationDate(MP4FFParserOriginalCharEnc &charType) ;
+        OSCL_wString& getCreationDate(MP4FFParserOriginalCharEnc &charType) ;
 
         // from 'ftyp' atom
         uint32 getCompatibiltyMajorBrand()
index b84472e..47ed05a 100644 (file)
@@ -83,7 +83,7 @@ class PVUserDataAtom : public Atom
             charType = ORIGINAL_CHAR_TYPE_UTF16;
             return _rating;
         }
-        OSCL_wHeapString<OsclMemAllocator> getPVCreationDate(MP4FFParserOriginalCharEnc &charType)
+        OSCL_wString& getPVCreationDate(MP4FFParserOriginalCharEnc &charType)
         {
             charType = ORIGINAL_CHAR_TYPE_UTF16;
             return _creationDate;
index e5e60d1..83f4a3a 100644 (file)
@@ -118,9 +118,10 @@ MovieHeaderAtom::~MovieHeaderAtom()
     // Empty
 }
 
-OSCL_wHeapString<OsclMemAllocator> MovieHeaderAtom::convertTimeToDate(uint32 time)
+void MovieHeaderAtom::convertTimeToDate()
 {
     OSCL_HeapString<OsclMemAllocator> date;
+    uint32 time = _creationTime;
 
     char buf[64];
 
@@ -240,8 +241,7 @@ OSCL_wHeapString<OsclMemAllocator> MovieHeaderAtom::convertTimeToDate(uint32 tim
                        wDate,
                        (int32)(wDateBufLen));
 
-    OSCL_wHeapString<OsclMemAllocator> wDateStr;
-    wDateStr += wDate;
+    iCreationDataString = wDate;
 
-    return (wDateStr);
+    return;
 }
index c237d5f..1ac5d36 100644 (file)
@@ -579,25 +579,28 @@ Mpeg4File::Mpeg4File(MP4_FF_FILE *fp,
         _success = false;
     }
 
-    // skip ID3 tag parsing for progressive playback for now
-    uint32 bufferCapacity = AtomUtils::getFileBufferingCapacity(fp);
-    if (0 == bufferCapacity)
+    //populate metadata only if parsing was successful
+    if (_success)
     {
-        //Check to see if ID3V2 was present. In case it was present, ID3Parcom would have
-        //traversed ID3V1 as well. In case it was not there, ID3V2Atom would not have been created
-        //in MetaData Atom and hence parse ID3V1 now
-        if (!IsID3V2Present())
+        // skip ID3 tag parsing for progressive playback for now
+        uint32 bufferCapacity = AtomUtils::getFileBufferingCapacity(fp);
+        if (0 == bufferCapacity)
         {
-            PV_MP4_FF_NEW(fp->auditCB, PVID3ParCom, (), _pID3Parser);
-            parseID3Header(fp);
+            //Check to see if ID3V2 was present. In case it was present, ID3Parcom would have
+            //traversed ID3V1 as well. In case it was not there, ID3V2Atom would not have been created
+            //in MetaData Atom and hence parse ID3V1 now
+            if (!IsID3V2Present())
+            {
+                PV_MP4_FF_NEW(fp->auditCB, PVID3ParCom, (), _pID3Parser);
+                parseID3Header(fp);
+            }
+        }
+        //Populate the title vector with all the title metadata values.
+        if (!populateMetadataVectors())
+        {
+            PVMF_MP4FFPARSER_LOGMEDIASAMPELSTATEVARIABLES((0, "Mpeg4File::populateMetadataVector() Failed"));
         }
     }
-    //Populate the title vector with all the title metadata values.
-    if (!populateMetadataVectors())
-    {
-        PVMF_MP4FFPARSER_LOGMEDIASAMPELSTATEVARIABLES((0, "Mpeg4File::populateMetadataVector() Failed"));
-    }
-
 }
 
 
@@ -1348,7 +1351,7 @@ OSCL_wString& Mpeg4File::getPVRating(MP4FFParserOriginalCharEnc &charType)
     }
 }
 
-OSCL_wHeapString<OsclMemAllocator> Mpeg4File::getCreationDate(MP4FFParserOriginalCharEnc &charType)
+OSCL_wString& Mpeg4File::getCreationDate(MP4FFParserOriginalCharEnc &charType)
 {
     PVUserDataAtom *patom = NULL;
     if (_puserDataAtom != NULL)
@@ -1364,10 +1367,14 @@ OSCL_wHeapString<OsclMemAllocator> Mpeg4File::getCreationDate(MP4FFParserOrigina
             return _emptyString;
         }
     }
-    else
+    else if (_pmovieAtom != NULL)
     {
         return (_pmovieAtom->getCreationDate());
     }
+    else
+    {
+        return _emptyString;
+    }
 }
 
 // Destructor