playbin2: don't try to set invalid stream numbers

Fix a problem with setting the stream numbers because we check for the wrong
range.
See #575239.
This commit is contained in:
Wim Taymans 2009-03-16 16:42:18 +01:00
parent ba6d3b5aca
commit 48f7f6b7c2

View file

@ -1253,7 +1253,7 @@ gst_play_bin_set_current_video_stream (GstPlayBin * playbin, gint stream)
if (!(channels = group->video_channels))
goto no_channels;
if (stream == -1 || channels->len < stream) {
if (stream == -1 || channels->len <= stream) {
sinkpad = NULL;
} else {
/* take channel from selected stream */
@ -1295,7 +1295,7 @@ gst_play_bin_set_current_audio_stream (GstPlayBin * playbin, gint stream)
if (!(channels = group->audio_channels))
goto no_channels;
if (stream == -1 || channels->len < stream) {
if (stream == -1 || channels->len <= stream) {
sinkpad = NULL;
} else {
/* take channel from selected stream */
@ -1337,7 +1337,7 @@ gst_play_bin_set_current_text_stream (GstPlayBin * playbin, gint stream)
if (!(channels = group->text_channels))
goto no_channels;
if (stream == -1 || channels->len < stream) {
if (stream == -1 || channels->len <= stream) {
sinkpad = NULL;
} else {
/* take channel from selected stream */