It was you who told me that the structure doesn't like gaps. If we don't have a stream at index 0, it returns 0.

```

int CDVDDemuxFFmpeg::GetNrOfStreams()
{
  int i = 0;
  while (i < MAX_STREAMS && m_streams[i]) i++;
  return i;
}
```

The structure m_streams uses index given by m_pFormatContext->streams[iId].
The program m_pFormatContext->programs[m_program]->stream_index[i] is only a subset of the streams in m_pFormatContext->streams[iId].
Consider the case that we have e.g. 10 streams in m_pFormatContext->streams[iId] but the program only references stream 5 and 10. 
pFormatContext->programs[m_program]->stream_index[0]   ----> 5
pFormatContext->programs[m_program]->stream_index[1]   ----> 10
This would result in a structure with gaps.