avformat/utils: Try to correct the codec_framerate in ff_compute_frame_duration() for the encoding case

No testcase where this makes a difference is known

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/util: Simplify av_guess_frame_rate() by using AVCodecContext.framerate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mpegts: add the judgement if a new program is created successfully

Add the judement after create a new program to avoid segment fault.

Signed-off-by: Di Wu <di1028.wu@samsung.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>