Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
7269a868
Commit
7269a868
authored
Sep 23, 2004
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* zlib decompressor for mkv. not working. (i don't get c++ :) )
parent
de33443d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
configure.ac
configure.ac
+1
-1
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+62
-0
No files found.
configure.ac
View file @
7269a868
...
...
@@ -2116,7 +2116,7 @@ dnl
dnl MP4 module
dnl
AC_CHECK_HEADERS(zlib.h, [
VLC_ADD_LDFLAGS([mp4 skins2 sap],[-lz])
VLC_ADD_LDFLAGS([mp4 skins2 sap
mkv
],[-lz])
] )
AC_CHECK_HEADERS(sysfs/libsysfs.h, [
...
...
modules/demux/mkv.cpp
View file @
7269a868
...
...
@@ -71,9 +71,17 @@
#include "matroska/KaxTrackAudio.h"
#include "matroska/KaxTrackVideo.h"
#include "matroska/KaxTrackEntryData.h"
#include "matroska/KaxContentEncoding.h"
#include "ebml/StdIOCallback.h"
#ifdef HAVE_ZLIB_H
# include <zlib.h>
#endif
#define MATROSKA_COMPRESSION_NONE 0
#define MATROSKA_COMPRESSION_ZLIB 1
using
namespace
LIBMATROSKA_NAMESPACE
;
using
namespace
std
;
...
...
@@ -103,6 +111,50 @@ static int Demux ( demux_t * );
static
int
Control
(
demux_t
*
,
int
,
va_list
);
static
void
Seek
(
demux_t
*
,
mtime_t
i_date
,
int
i_percent
);
#ifdef HAVE_ZLIB_H
int
do_zlib_decompress
(
unsigned
char
*
src
,
unsigned
char
**
_dst
,
int
slen
)
{
int
result
,
dstsize
,
n
;
unsigned
char
*
dst
;
z_stream
d_stream
;
d_stream
.
zalloc
=
(
alloc_func
)
0
;
d_stream
.
zfree
=
(
free_func
)
0
;
d_stream
.
opaque
=
(
voidpf
)
0
;
result
=
inflateInit
(
&
d_stream
);
if
(
result
!=
Z_OK
)
{
printf
(
"inflateInit() failed. Result: %d
\n
"
,
result
);
return
(
-
1
);
}
d_stream
.
next_in
=
(
Bytef
*
)
src
;
d_stream
.
avail_in
=
slen
;
n
=
0
;
dst
=
NULL
;
do
{
n
++
;
dst
=
(
unsigned
char
*
)
realloc
(
dst
,
n
*
1000
);
d_stream
.
next_out
=
(
Bytef
*
)
&
dst
[(
n
-
1
)
*
1000
];
d_stream
.
avail_out
=
1000
;
result
=
inflate
(
&
d_stream
,
Z_NO_FLUSH
);
if
(
(
result
!=
Z_OK
)
&&
(
result
!=
Z_STREAM_END
)
)
{
printf
(
"Zlib decompression failed. Result: %d
\n
"
,
result
);
return
(
-
1
);
}
}
while
(
(
d_stream
.
avail_out
==
0
)
&&
(
d_stream
.
avail_in
!=
0
)
&&
(
result
!=
Z_STREAM_END
)
);
dstsize
=
d_stream
.
total_out
;
inflateEnd
(
&
d_stream
);
*
_dst
=
(
unsigned
char
*
)
realloc
(
dst
,
dstsize
);
return
dstsize
;
}
#endif
/*****************************************************************************
* Stream managment
...
...
@@ -195,6 +247,9 @@ typedef struct
char
*
psz_codec_settings
;
char
*
psz_codec_info_url
;
char
*
psz_codec_download_url
;
/* encryption/compression */
vlc_bool_t
b_compression_zlib
;
}
mkv_track_t
;
...
...
@@ -1773,6 +1828,8 @@ static void ParseTrackEntry( demux_t *p_demux, EbmlMaster *m )
tk
->
psz_codec_settings
=
NULL
;
tk
->
psz_codec_info_url
=
NULL
;
tk
->
psz_codec_download_url
=
NULL
;
tk
->
b_compression_zlib
=
MATROSKA_COMPRESSION_NONE
;
for
(
i
=
0
;
i
<
m
->
ListSize
();
i
++
)
{
...
...
@@ -1906,6 +1963,11 @@ static void ParseTrackEntry( demux_t *p_demux, EbmlMaster *m )
tk
->
psz_codec_name
=
UTF8ToStr
(
UTFstring
(
cname
)
);
msg_Dbg
(
p_demux
,
"| | | + Track Codec Name=%s"
,
tk
->
psz_codec_name
);
}
else
if
(
MKV_IS_ID
(
l
,
KaxContentEncoding
)
)
{
KaxContentEncoding
&
cenc
=
*
(
KaxContentEncoding
*
)
l
;
msg_Dbg
(
p_demux
,
"| | | + Track Content Compression: ZLIB"
);
}
// else if( EbmlId( *l ) == KaxCodecSettings::ClassInfos.GlobalId )
// {
// KaxCodecSettings &cset = *(KaxCodecSettings*)l;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment