avcodec: refactor frame_rate probing into own function
avcodec: refactor frame_rate probing into own function

if codec has list of supported framerates, select highest one
unless user has provided one. If we end up using CLOCK_FREQ in
time_base, it should be quite ok in most cases. Tested with ts/mp4/webm
and mp2v/mp4v/VP80. For some cases it can select higher fps in
mpeg-codecs (60fps) in case of input fps isn't yet known in that point
or is fubared.

Also add special case for MP4V as it doesn't like CLOCK_FREQ in
time_base/frame_rates.

vlc-mirror/vlc,shyamalschandra/vlc,shyamalschandra/vlc,xkfz007/vlc,shyamalschandra/vlc,vlc-mirror/vlc,shyamalschandra/vlc,vlc-mirror/vlc,xkfz007/vlc,vlc-mirror/vlc,xkfz007/vlc,shyamalschandra/vlc,vlc-mirror/vlc,xkfz007/vlc,shyamalschandra/vlc,xkfz007/vlc,shyamalschandra/vlc,vlc-mirror/vlc,xkfz007/vlc,xkfz007/vlc,vlc-mirror/vlc