[vlc-devel] [RFC, PATCH 6/6] demux/mkv: Use `StringDispatcher` in `matroska_segment_c::TrackInit`

Denis Charmet typx at dinauz.org
Thu Mar 3 14:10:34 CET 2016


Hi again,

I will look at my sample collection but there are a lot of "test" files 
created when people started implementing the codecs with esoteric names 
(hence the strncmp). While I, personnaly, completely support the idea 
that old crap is old and should be burned with fire and acid while we 
all laugh at it maniacally, the fact is that those file are used as 
references by most of the multimedia industry and dropping support of 
such files might not be such a good idea for now.

Don't hesitate to ping me on that so I don't forget to check.

On 2016-03-03 13:54, Filip Roséen wrote:
> After a conversation with JB it seems like some of the older cases
> that used strncmp are somewhat wrong, which effectively means that the
> patch in which this email is a reply to should replace S_CASE_GLOB
> with a fixed S_CASE in these cases.
> 
> S_CASE_GLOB was introduced in the cases where the old code used
> strncmp to only match a substring of the codec specified.
> 
> See the below:
> 
> index 30696a5..6efb252 100644
> --- a/modules/demux/mkv/matroska_segment_parse.cpp
> +++ b/modules/demux/mkv/matroska_segment_parse.cpp
> @@ -1251,7 +1251,7 @@ int32_t matroska_segment_c::TrackInit(
> mkv_track_t * p_tk )
>  vars.p_fmt->i_codec = VLC_CODEC_MPGV;
>  fill_extra_data( vars.p_tk, 0 );
>  }
> - S_CASE_GLOB("V_THEORA*") {
> + S_CASE("V_THEORA") {
>  vars.p_fmt->i_codec = VLC_CODEC_THEORA;
>  vars.p_tk->b_pts_only = true;
>  fill_extra_data( vars.p_tk, 0 );
> @@ -1277,14 +1277,14 @@ int32_t matroska_segment_c::TrackInit(
> mkv_track_t * p_tk )
>  S_CASE("V_REAL/RV20") { v_real_helper (VLC_CODEC_RV20, vars ); }
>  S_CASE("V_REAL/RV30") { v_real_helper (VLC_CODEC_RV30, vars ); }
>  S_CASE("V_REAL/RV40") { v_real_helper (VLC_CODEC_RV40, vars ); }
> - S_CASE_GLOB("V_DIRAC*") {
> + S_CASE("V_DIRAC") {
>  vars.p_fmt->i_codec = VLC_CODEC_DIRAC;
>  }
> - S_CASE_GLOB("V_VP8*") {
> + S_CASE("V_VP8") {
>  vars.p_fmt->i_codec = VLC_CODEC_VP8;
>  vars.p_tk->b_pts_only = true;
>  }
> - S_CASE_GLOB("V_VP9*") {
> + S_CASE("V_VP9") {
>  vars.p_fmt->i_codec = VLC_CODEC_VP9;
>  vars.p_fmt->b_packetized = false;
>  vars.p_tk->b_pts_only = true;
> @@ -1435,7 +1435,7 @@ int32_t matroska_segment_c::TrackInit(
> mkv_track_t * p_tk )
>  vars.p_fmt->i_codec = VLC_CODEC_VORBIS;
>  fill_extra_data( vars.p_tk, 0 );
>  }
> - S_CASE_GLOB("A_OPUS*") {
> + S_CASE("A_OPUS") {
>  vars.p_fmt->i_codec = VLC_CODEC_OPUS;
>  if( !vars.p_tk->fmt.audio.i_rate )
>  {
> @@ -1626,13 +1626,13 @@ int32_t matroska_segment_c::TrackInit(
> mkv_track_t * p_tk )
> 
>  A_REAL__helper (vars, VLC_CODEC_RA_288);
>  }
> - S_CASE_GLOB("A_QUICKTIME/QDM2*") {
> + S_CASE("A_QUICKTIME/QDM2") {
>  vars.p_fmt->i_cat = AUDIO_ES;
>  vars.p_fmt->i_codec = VLC_CODEC_QDM2;
> 
>  fill_extra_data( vars.p_tk, 0 );
>  }
> - S_CASE_GLOB("A_QUICKTIME/QDMC*") {
> + S_CASE("A_QUICKTIME/QDMC") {
>  vars.p_fmt->i_cat = AUDIO_ES;
>  vars.p_fmt->i_codec = VLC_FOURCC('Q','D','M','C');
> 
> The S_DIRAC case needs a bit more investigation, we might actually
> want that one to be able to match “S_DIRAC*" – but JB knows far more
> than I do on the subject.
> -------------------------
> 
> On 16/03/03 13:30, Filip Roséen wrote:
> 
>> This patch is far too big to be easily reviewed, so if it seems like 
>> a good fix it will have to be split up into a lot of smaller patches 
>> (so that one can prove that the functionality remains the same).
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

Regards,
-- 
Denis Charmet - TypX
Le mauvais esprit est un art de vivre


More information about the vlc-devel mailing list