[MPlayer-dev-eng] Re: [PATCH] -identify vids, aids, sids, alangs and slangs

Moritz Bunkus moritz at bunkus.org
Wed Nov 10 09:39:15 CET 2004


Hey,

> Well, yeah, except now you have to do it anyway, unless you happen to
> know what demuxer is going to be used...

File extension? :)

> _and_ remember what numbering scheme that particular demuxer uses.

True, but most of the files I watch are...

1) AVI -- usually not multi-audio,
2) VCD MPEG1 -- same,
3) OGM -- zero-based,
4) MKV -- zero-based.

No problem for me so far :) This is is subjective, of course.

> And by the way, if you do run it (with -v), demux_ogg and demux_mkv
> will report wrong values.

Nope, demux_mkv.c reports correct values:

[mkv] Track ID 1: video (V_MS/VFW/FOURCC), -vid 0
[mkv] Track ID 2: audio (A_MPEG/L3), -aid 0, -alang und

demux_ogg.c reports the wrong ones, that's true. But that could be fixed
easily after your patch has been applied because you store the -Xid to
be used in your new .id element.

> Do you think we should at least turn that
> output off based on that same demux_aid_vid_mismatch flag?

No, we should fix demux_ogg.c's output.

> I'm not sure my knowledge of demux_ogg.c is sufficient for that.
> Plus, I would really prefer that to be a separate patch.

True.

> > Well, the "best" way IMHO would be to have demux_ogg_open parse ALL
> > header packets of ALL streams before returning. That way we could also
> > enable -alang.
> 
> That would be great.

True, but a lot of work ;)

>  extern int verbose; // defined in mplayer.c
> +extern int identify; // defined in mplayer.c

Those comments aren't really correct anymore. Maybe you could change
those to 'defined in mplayer.c/mencoder.c'?

The vobsub.c part looks ok.

demux_mkv.c:

> +          if (identify)
> +          {
> +            mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", aid);
> +            mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AID_%d_LANG=%s\n", aid, mkv_d->tracks[i]->language);
> +          }

Could you please try to use the same indentation style as the source
files use? A lot of files don't have one, but demux_mkv.c does, and it
implies indenting the parenthesis like this:

  if (abc)
    {
      do_something();
    }

Even if I think that ugly ;)

demux_ogg.c looks ok now.

> --- libmpdemux/open.c	22 Aug 2004 18:47:48 -0000	1.99
> +++ libmpdemux/open.c	9 Nov 2004 19:54:44 -0000
> @@ -378,6 +378,11 @@ if(strncmp("dvd://",filename,6) == 0){
>  	    tmp,
>  	    d->audio_streams[d->nr_of_channels].id
>  	    );
> +	  if (identify)
> +	  {
> +	    mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AUDIO_ID=%d\n", d->audio_streams[d->nr_of_channels].id);
> +	    mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_AID_%d_LANG=%s\n", d->audio_streams[d->nr_of_channels].id, tmp);
> +	  }
>  	    
>  	  d->nr_of_channels++;
>  	 }
> @@ -414,6 +419,11 @@ if(strncmp("dvd://",filename,6) == 0){
>  	  d->nr_of_subtitles,
>  	  tmp
>  	  );
> +        if (identify)
> +        {
> +	  mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", d->nr_of_subtitles);
> +	  mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_SID_%d_LANG=%s\n", d->nr_of_subtitles, tmp);
> +        }
>          d->nr_of_subtitles++;
>         }
>       mp_msg(MSGT_OPEN,MSGL_V,"[open] number of subtitles on disk: %d\n",d->nr_of_subtitles );

Hmm, if the language is not known then ID_SID_1_LANG=unknown will be
output. I'd suggest only to print this info if the language IS know
because '-slang unknown' won't select anything.

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds




More information about the MPlayer-dev-eng mailing list