[MPlayer-dev-eng] [PATCH] fix -aid matching in demux_ogg.c
Moritz Bunkus
moritz at bunkus.org
Thu Oct 28 13:25:36 CEST 2004
Hey,
> Well, in that case all of demux_ogg.c is broken, because it uses sequential
> id numbering, which in practice means that only the very first stream found
> ever gets id=0, usually the video stream.
Wrong. If the user selects '-aid 1' then demuxer->audio->id will be =
1. Example code from demux_ogg.c checks for that by comparing the wanted
stream with the number of audio streams so far:
/// Is it the stream we want
if(demuxer->audio->id == (n_audio - 1)) {
demuxer->audio->sh = sh_a;
sh_a->ds = demuxer->audio;
ds = demuxer->audio;
audio_id = ogg_d->num_sub;
}
Don't confuse the id selected on the command line with the stream ids in
the Ogg file! Identification inside the demuxer is done based on the
overall stream number, but stream selection is based on the 'Nth stream
of type x'.
The IDs used internally really don't have to match the IDs used
externally. That's why I said that the -v output should be changed to
something more like...
Ogg: Stream %d in file is audio stream number %d (selectable with '-aid
%d')
or something like that.
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