Skip to content

Commit

Permalink
AvFormatDecoder: Prefer average frame rate over estimated
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Jun 18, 2019
1 parent cc6bf76 commit 7010586
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
Expand Up @@ -1429,12 +1429,11 @@ float AvFormatDecoder::normalized_fps(AVStream *stream, AVCodecContext *enc)
fps = codec_fps;
else if (container_fps < 121.0 && container_fps > 3.0)
fps = container_fps;
else if (avg_fps < 121.0 && avg_fps > 3.0)
fps = avg_fps;
// certain H.264 interlaced streams are detected at 2x using estimated (i.e. wrong)
else if (estimated_fps < 121.0 && estimated_fps > 3.0)
fps = estimated_fps;
// but average is less reliable as it does not account for issues like repeat frames
else if (avg_fps < 121.0 && avg_fps > 3.0)
fps = avg_fps;
else
fps = 30000.0 / 1001.0; // 29.97 fps

Expand Down

0 comments on commit 7010586

Please sign in to comment.