[vlc-commits] demux: mkv: remove workaround of KaxBlockVirtual

Zhao Zhili git at videolan.org
Mon May 28 10:11:55 CEST 2018


vlc | branch: master | Zhao Zhili <quinkblack at foxmail.com> | Mon May 28 15:00:41 2018 +0800| [c49651c087c7b9b1b265cb911f6d006db914197f] | committer: Steve Lhomme

demux: mkv: remove workaround of KaxBlockVirtual

The workaround was added by ce718de in 2008. The bug was fixed in
upstream in 2010.

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

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

 modules/demux/mkv/Ebml_parser.cpp |  8 --------
 modules/demux/mkv/Ebml_parser.hpp | 11 -----------
 2 files changed, 19 deletions(-)

diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 76bc45a1ea..eb7315c6ae 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -224,8 +224,6 @@ next:
         {
             if( !mb_keep )
             {
-                if( MKV_IS_ID( p_prev, KaxBlockVirtual ) )
-                    static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix(); // !! WARNING : TODO !! this is undefined-behavior
                 delete p_prev;
                 p_prev = NULL;
             }
@@ -285,8 +283,6 @@ next:
             {
                 if( !mb_keep )
                 {
-                    if( MKV_IS_ID( p_prev, KaxBlockVirtual ) )
-                        static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix(); // !! WARNING : TODO !! this is undefined-behavior
                     delete p_prev;
                     p_prev = NULL;
                 }
@@ -318,8 +314,6 @@ next:
             {
                 if( !mb_keep )
                 {
-                    if( MKV_IS_ID( p_prev, KaxBlockVirtual ) )
-                        static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix(); // !! WARNING : TODO !! this is undefined-behavior
                     delete p_prev;
                     p_prev = NULL;
                 }
@@ -333,8 +327,6 @@ next:
     {
         if( !mb_keep )
         {
-            if( MKV_IS_ID( p_prev, KaxBlockVirtual ) )
-                static_cast<KaxBlockVirtualWorkaround*>(p_prev)->Fix();
             delete p_prev;
         }
         mb_keep = false;
diff --git a/modules/demux/mkv/Ebml_parser.hpp b/modules/demux/mkv/Ebml_parser.hpp
index ba0ac712fe..6e427faf18 100644
--- a/modules/demux/mkv/Ebml_parser.hpp
+++ b/modules/demux/mkv/Ebml_parser.hpp
@@ -66,15 +66,4 @@ class EbmlParser
     bool         mb_dummy;
 };
 
-/* This class works around a bug in KaxBlockVirtual implementation */
-class KaxBlockVirtualWorkaround : public KaxBlockVirtual
-{
-public:
-    void Fix()
-    {
-        if( GetBuffer() == DataBlock )
-            SetBuffer( NULL, 0 );
-    }
-};
-
 #endif



More information about the vlc-commits mailing list