lavf: fix av_find_best_stream when providing a wanted stream.
authorMarton Balint <cus@passwd.hu>
Sun, 20 Feb 2011 00:18:30 +0000 (01:18 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 12 May 2011 16:02:27 +0000 (18:02 +0200)
commit2c7158169859eb2dd49a72337f9f3f28347da77a
treef860ab9f0a616b3c70d1a2ea1f98274b598db85e
parent6b35a795f8ca34c92da8de81f7b20b2d47d71468
lavf: fix av_find_best_stream when providing a wanted stream.

In the main loop, stream_number is incremented after checking the stream type,
so the search usually will not find the wanted stream.

This patch eliminates the useless stream_number variable and introduces a new
one, called real_stream_index to store the real stream index of the current
stream, no matter if we are looping through all the streams or only the streams
of a program.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/utils.c