vlc/vlc-3.0 | branch: master | Steve Lhomme <rob...@ycbcr.xyz> | Tue Jan 30 
09:02:14 2018 +0100| [ce068422edb2955cd452cd7b82e12647f42c9262] | committer: 
Jean-Baptiste Kempf

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

(cherry picked from commit 488e6712143de4ea71acf828c82df9c9f000088f)
Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 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 cfd39dea03..46ba14cd68 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1632,6 +1632,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 e6dd08a795..bbeba71471 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -545,15 +545,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 )
         {
@@ -575,6 +576,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;

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to