[vlc-commits] demux:mkv: add support for V_PRORES
Steve Lhomme
git at videolan.org
Tue Jan 30 09:03:04 CET 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan 30 09:02:14 2018 +0100| [488e6712143de4ea71acf828c82df9c9f000088f] | committer: Steve Lhomme
demux:mkv: add support for V_PRORES
The decoder wants the atom header that has been stripped so we add it on every
frame we read.
Fixes #19568
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=488e6712143de4ea71acf828c82df9c9f000088f
---
modules/demux/mkv/matroska_segment_parse.cpp | 4 ++++
modules/demux/mkv/mkv.cpp | 7 +++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 44c82b50a9..81b674b62d 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1630,6 +1630,10 @@ bool matroska_segment_c::TrackInit( mkv_track_t * p_tk )
vars.p_fmt->i_codec = VLC_CODEC_FFV1;
fill_extra_data( vars.p_tk, 0 );
}
+ S_CASE("V_PRORES") {
+ vars.p_fmt->i_codec = VLC_CODEC_PRORES;
+ fill_extra_data( vars.p_tk, 0 );
+ }
S_CASE("A_MS/ACM") {
mkv_track_t * p_tk = vars.p_tk;
es_format_t * p_fmt = &vars.p_tk->fmt;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index edc594bf5e..86b4a3ad26 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -570,15 +570,16 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
msg_Warn( p_demux, "Cannot read frame (too long or no frame)" );
break;
}
+ size_t extra_data = track.fmt.i_codec == VLC_CODEC_PRORES ? 8 : 0;
if( track.i_compression_type == MATROSKA_COMPRESSION_HEADER &&
track.p_compression_data != NULL &&
track.i_encoding_scope & MATROSKA_ENCODING_SCOPE_ALL_FRAMES )
- p_block = MemToBlock( data->Buffer(), data->Size(), track.p_compression_data->GetSize() );
+ p_block = MemToBlock( data->Buffer(), data->Size(), track.p_compression_data->GetSize() + extra_data );
else if( unlikely( track.fmt.i_codec == VLC_CODEC_WAVPACK ) )
p_block = packetize_wavpack( track, data->Buffer(), data->Size() );
else
- p_block = MemToBlock( data->Buffer(), data->Size(), 0 );
+ p_block = MemToBlock( data->Buffer(), data->Size(), extra_data );
if( p_block == NULL )
{
@@ -600,6 +601,8 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
{
memcpy( p_block->p_buffer, track.p_compression_data->GetBuffer(), track.p_compression_data->GetSize() );
}
+ if ( track.fmt.i_codec == VLC_CODEC_PRORES )
+ memcpy( p_block->p_buffer + 4, "icpf", 4 );
if ( b_key_picture )
p_block->i_flags |= BLOCK_FLAG_TYPE_I;
More information about the vlc-commits
mailing list