stream_index = 0;
{ if (codec_type == CODEC_TYPE_SUBTITLE) { stream_index = -1; goto the_end; } else stream_index = 0; }
void stream_cycle_channel(VideoState *is, int codec_type){    AVFormatContext *ic = is->ic;    int start_index, stream_index;    AVStream *st;    if (codec_type == CODEC_TYPE_VIDEO)        start_index = is->video_stream;    else        start_index = is->audio_stream;    if (start_index < 0)        return;    stream_index = start_index;    for(;;) {        if (++stream_index >= is->ic->nb_streams)            stream_index = 0;        if (stream_index == start_index)            return;        st = ic->streams[stream_index];        if (st->codec->codec_type == codec_type) {            /* check that parameters are OK */            switch(codec_type) {            case CODEC_TYPE_AUDIO:                if (st->codec->sample_rate != 0 &&                    st->codec->channels != 0)                    goto the_end;                break;            case CODEC_TYPE_VIDEO:                goto the_end;            default:                break;            }        }    } the_end:    stream_component_close(is, start_index);    stream_component_open(is, stream_index);}