Bug 1219134: P2. Use LibAV/FFmpeg logic to detect invalid pts. r=edwin a=sylvestre
The logic was extracted from LibAV cmdutils.c. FFmpeg provides an API for that (av_frame_get_best_effort_timestamp()) unfortunately this isn't provided by LibAV.
So copy the logic instead in order to keep compatibility with the two forks.