hmm, this does not match because we use our own types like STREAM_VIDEO
if(m_pFormatContext->streams[idx]->codec->codec_type != m_streams[i]->type)

We could add a paramter origType to the m_streams structure? This would make the check for unknown obsolete.