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

Francois Cartegnie git at videolan.org
Fri Oct 23 17:15:59 CEST 2020


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

adaptive: fix mpeg4 object profile parsing

(cherry picked from commit ce3821b35db6b00fa9b5a4ba39065945472e810d)

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

 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 e1e36e8260..f760948d7c 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