Originally committed to SVN as r2395.
Also moved the indexing function to ffmpegsource_common.cpp. Originally committed to SVN as r2387.
Originally committed to SVN as r2378.