Something along the following lines:

if(m_pFormatContext->programs[m_program]->nb_stream_indexes != m_stream_count)
  return true;

for (unsigned int i = 0; i < m_pFormatContext->programs[m_program]->nb_stream_indexes; i++) {
  int idx = m_pFormatContext->programs[m_program]->stream_index[i];
  if(idx != m_streams[i].id)
     return true;
  if(m_pFormatContext->streams[idx]->codec->codec_type != m_streams[i].type)
     return true;
}