[vlc-commits] [Git][videolan/vlc][3.0.x] demux: mkv: add support for S_DVBSUB
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Mon Apr 18 15:28:44 UTC 2022
Hugo Beauzée-Luyssen pushed to branch 3.0.x at VideoLAN / VLC
Commits:
8f6ec51c by Filip Roséen at 2022-04-18T15:15:41+00:00
demux: mkv: add support for S_DVBSUB
backport of 4d22be6dcc60eed789a278b1105a01f59168f8cb
Signed-off-by: Maxime Chapelet <umxprime at videolabs.io>
- - - - -
2 changed files:
- modules/demux/mkv/matroska_segment_parse.cpp
- modules/demux/mkv/mkv.cpp
Changes:
=====================================
modules/demux/mkv/matroska_segment_parse.cpp
=====================================
@@ -2125,6 +2125,18 @@ bool matroska_segment_c::TrackInit( mkv_track_t * p_tk )
}
}
}
+ S_CASE("S_DVBSUB")
+ {
+ vars.p_fmt->i_codec = VLC_CODEC_DVBS;
+
+ if( vars.p_tk->i_extra_data < 4 )
+ throw std::runtime_error( "not enough codec data for S_DVBSUB" );
+
+ uint16_t page_id = GetWBE( &vars.p_tk->p_extra_data[0] );
+ uint16_t ancillary_id = GetWBE( &vars.p_tk->p_extra_data[2] );
+
+ vars.p_fmt->subs.dvb.i_id = ( ancillary_id << 16 ) | page_id;
+ }
S_CASE("S_HDMV/PGS") {
vars.p_fmt->i_codec = VLC_CODEC_BD_PG;
}
=====================================
modules/demux/mkv/mkv.cpp
=====================================
@@ -642,6 +642,19 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
break;
}
+ case VLC_CODEC_DVBS:
+ {
+ p_block = block_Realloc( p_block, 2, p_block->i_buffer + 1);
+
+ if( unlikely( !p_block ) )
+ continue;
+
+ p_block->p_buffer[0] = 0x20; // data identifier
+ p_block->p_buffer[1] = 0x00; // subtitle stream id
+ p_block->p_buffer[ p_block->i_buffer - 1 ] = 0x3f; // end marker
+ }
+ break;
+
case VLC_CODEC_AV1:
p_block = AV1_Unpack_Sample( p_block );
if( unlikely( !p_block ) )
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8f6ec51cd05a0c8b75c8d7d55399fe60511c8117
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8f6ec51cd05a0c8b75c8d7d55399fe60511c8117
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list