[vlc-commits] adaptive: fix mpeg4 object profile parsing

Francois Cartegnie git at videolan.org
Thu Oct 22 18:52:51 CEST 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 22 00:58:43 2020 +0200| [ce3821b35db6b00fa9b5a4ba39065945472e810d] | committer: Francois Cartegnie

adaptive: fix mpeg4 object profile parsing

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce3821b35db6b00fa9b5a4ba39065945472e810d
---

 modules/demux/adaptive/tools/FormatNamespace.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/adaptive/tools/FormatNamespace.cpp b/modules/demux/adaptive/tools/FormatNamespace.cpp
index bf1edb7260..834d57d2a3 100644
--- a/modules/demux/adaptive/tools/FormatNamespace.cpp
+++ b/modules/demux/adaptive/tools/FormatNamespace.cpp
@@ -57,7 +57,7 @@ void FormatNamespace::ParseMPEG4Elements(const std::vector<std::string> &element
     if(elements.size() < 1)
         return;
 
-    uint8_t objectType = std::stoi(elements.at(0).substr(0,1), nullptr, 16);
+    uint8_t objectType = std::stoi(elements.at(0).substr(0,2), nullptr, 16);
     if(!MPEG4_Codec_By_ObjectType(objectType, NULL, 0,
                                   &fmt.i_codec,
                                   &fmt.i_profile))
@@ -67,7 +67,7 @@ void FormatNamespace::ParseMPEG4Elements(const std::vector<std::string> &element
     {
         case 0x40:
             if(elements.size() > 1)
-                fmt.i_profile = std::stoi(elements.at(1).substr(0,1), nullptr, 16);
+                fmt.i_profile = std::stoi(elements.at(1).substr(0,2), nullptr, 16);
             break;
         default:
             break;
@@ -98,7 +98,7 @@ void FormatNamespace::Parse(vlc_fourcc_t fcc, const std::vector<std::string> &el
         /* VIDEO */
         case MP4RA("mp4v"):
             /* set default if no elements */
-            es_format_Change(&fmt, AUDIO_ES, VLC_CODEC_MP4V);
+            es_format_Change(&fmt, VIDEO_ES, VLC_CODEC_MP4V);
             ParseMPEG4Elements(elements);
             break;
         case MP4RA("avc1"):



More information about the vlc-commits mailing list