In this case, the meaning is the same. Your choice is a matter of what is sometimes called "information packaging."
Whenever possible, native speakers place new information toward the end of a clause or a sentence. The opposite is also true: we tend to put familiar or given information at or near the beginning of a clause or a sentence.
In #1, the speaker is making the assumption that the audience is familiar with the broken leg—perhaps because the cast is evident, perhaps because they have been discussing it recently. WHEN the speaker broke the leg—when I was playing football—is "the news," the point of the sentence.
In #2, I broke my leg is the news. Presumably, the audience is familiar with the speaker's habit of playing football—or at least familiar with the sport and the fact that people like the speaker play it.
Source: Style: Lessons in Clarity and Grace by Williams and Bizup.
It's worth noting that in speech, any of what I have just described can be altered if the speaker emphasizes another part of the sentence by means of intonation. Imagine the following:
I broke MY LEG when I was playing football. [I did not break my arm.]
I BROKE my leg when I was playing football. [I did not sprain my leg.]