[MPlayer-cvslog] r20162 - in trunk: help/help_mp-en.h libmpdemux/demux_mkv.c libmpdemux/matroska.h mplayer.c stream/stream_dvd.c stream/stream_dvd.h

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Oct 11 19:57:16 CEST 2006


Hello,
On Wed, Oct 11, 2006 at 07:25:46PM +0200, ptt wrote:
> Log:
> added OSD audio switching visualization

I would have appreciated a warning before applying.

> +  num = 0;
> +  for (i = 0; i < mkv_d->num_tracks; i++)
> +    {
> +      track = mkv_d->tracks[i];
> +      if (track->type == MATROSKA_TRACK_AUDIO)
> +        num++;
> +      if (num == (track_num + 1))

demux_mkv_find_track_by_num ??

> +            char lang[40] = MSGTR_Unknown;
> +            demux_mkv_get_audio_lang(demuxer, audio_id, lang, 9);

Why 9? 20 would still be safe or is there anything that guarantees a
valid mkv will not have more? 9 might just be enough for only 2 unicode
characters...

> +            char lang[3] = "\0\0\0";

Hmm. Is this a actually valid C? Also, just removing the if(code) below
and adding lang[2] = 0 would work as well.

> +            int code = 0;
> +            code = dvd_lang_from_aid(stream, audio_id);
> +            if (code) {
> +                lang[0] = code >> 8;
> +                lang[1] = code;
> +            }

Greetings,
Reimar Döffinger



More information about the MPlayer-cvslog mailing list