[vlc-devel] [PATCH 7/7] demux: mkv: simplify matroska_stream_c
Zhao Zhili
quinkblack at foxmail.com
Mon May 28 09:00:42 CEST 2018
---
modules/demux/mkv/mkv.cpp | 6 ++----
modules/demux/mkv/mkv.hpp | 9 ++++-----
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 814794f..f5ed6ba 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -31,8 +31,6 @@
#include "chapters.hpp"
#include "Ebml_parser.hpp"
-#include "stream_io_callback.hpp"
-
#include <new>
#include <vlc_fs.h>
@@ -887,8 +885,8 @@ mkv_track_t::~mkv_track_t()
}
matroska_stream_c::matroska_stream_c( stream_t *s, bool owner )
- :io_callback( new vlc_stream_io_callback( s, owner ) )
- ,estream( *io_callback )
+ :io_callback( s, owner )
+ ,estream( io_callback )
{}
bool matroska_stream_c::isUsed() const
diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
index 455256e..ad48219 100644
--- a/modules/demux/mkv/mkv.hpp
+++ b/modules/demux/mkv/mkv.hpp
@@ -86,6 +86,8 @@
#include "matroska/KaxContentEncoding.h"
#include "matroska/KaxVersion.h"
+#include "stream_io_callback.hpp"
+
#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
@@ -153,14 +155,11 @@ class matroska_segment_c;
struct matroska_stream_c
{
matroska_stream_c(stream_t *s, bool owner);
- ~matroska_stream_c()
- {
- delete io_callback;
- }
+ ~matroska_stream_c() {}
bool isUsed() const;
- IOCallback * io_callback;
+ vlc_stream_io_callback io_callback;
EbmlStream estream;
std::vector<matroska_segment_c*> segments;
--
2.9.5
More information about the vlc-devel
mailing list