[vlc-commits] commit: MKV: EbmlParser, cleanup (Jean-Baptiste Kempf )
git at videolan.org
git at videolan.org
Fri Apr 30 12:52:53 CEST 2010
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Apr 30 11:55:25 2010 +0200| [18dbd3acd0197d3e2a3f4b6de3b0795045d76666] | committer: Jean-Baptiste Kempf
MKV: EbmlParser, cleanup
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=18dbd3acd0197d3e2a3f4b6de3b0795045d76666
---
modules/demux/mkv/Ebml_parser.cpp | 28 ++++++----------------------
modules/demux/mkv/Ebml_parser.hpp | 12 ++++++++++++
2 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 3305203..21cdd56 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -1,6 +1,6 @@
/*****************************************************************************
- * mkv.cpp : matroska demuxer
+ * EbmlParser for the matroska demuxer
*****************************************************************************
* Copyright (C) 2003-2004 the VideoLAN team
* $Id$
@@ -22,6 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+
#include "Ebml_parser.hpp"
/*****************************************************************************
@@ -29,14 +30,12 @@
*****************************************************************************/
EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux )
{
- int i;
-
m_es = es;
m_got = NULL;
m_el[0] = el_start;
mi_remain_size[0] = el_start->GetSize();
- for( i = 1; i < 6; i++ )
+ for( int i = 1; i < 6; i++ )
{
m_el[i] = NULL;
}
@@ -48,9 +47,7 @@ EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux
EbmlParser::~EbmlParser( void )
{
- int i;
-
- for( i = 1; i < mi_level; i++ )
+ for( int i = 1; i < mi_level; i++ )
{
if( !mb_keep )
{
@@ -94,7 +91,7 @@ void EbmlParser::Up( void )
{
if( mi_user_level == mi_level )
{
- fprintf( stderr," arrrrrrrrrrrrrg Up cannot escape itself\n" );
+ fprintf( stderr,"MKV/Ebml Parser: Up cannot escape itself\n" );
}
mi_user_level--;
@@ -130,18 +127,6 @@ void EbmlParser::Reset( demux_t *p_demux )
mb_dummy = var_InheritInteger( p_demux, "mkv-use-dummy" );
}
-
-/* This function workarounds a bug in KaxBlockVirtual implementation */
-class KaxBlockVirtualWorkaround : public KaxBlockVirtual
-{
-public:
- void Fix()
- {
- if( Data == DataBlock )
- SetBuffer( NULL, 0 );
- }
-};
-
EbmlElement *EbmlParser::Get( void )
{
int i_ulev = 0;
@@ -193,7 +178,7 @@ EbmlElement *EbmlParser::Get( void )
}
else if( m_el[mi_level] == NULL )
{
- fprintf( stderr," m_el[mi_level] == NULL\n" );
+ fprintf( stderr,"MKV/Ebml Parser: m_el[mi_level] == NULL\n" );
}
return m_el[mi_level];
@@ -209,4 +194,3 @@ bool EbmlParser::IsTopPresent( EbmlElement *el )
return false;
}
-
diff --git a/modules/demux/mkv/Ebml_parser.hpp b/modules/demux/mkv/Ebml_parser.hpp
index a4d9bc5..1ca7082 100644
--- a/modules/demux/mkv/Ebml_parser.hpp
+++ b/modules/demux/mkv/Ebml_parser.hpp
@@ -26,6 +26,7 @@
#define _EBML_PARSER_HPP_
#include "mkv.hpp"
+
/*****************************************************************************
* Ebml Stream parser
*****************************************************************************/
@@ -60,4 +61,15 @@ class EbmlParser
bool mb_dummy;
};
+/* This class works around a bug in KaxBlockVirtual implementation */
+class KaxBlockVirtualWorkaround : public KaxBlockVirtual
+{
+public:
+ void Fix()
+ {
+ if( Data == DataBlock )
+ SetBuffer( NULL, 0 );
+ }
+};
+
#endif
More information about the vlc-commits
mailing list