It seems you are calling prepare() twice, first in the constructor of AudioVideoEntry, and second in the method prepareMedia(), that's why it's giving an IllegalStateException.
If you read carefully the documentation you can understand the State Diagram and why gives such exceptions.