Since 3b491c5a500, stats would be hidden if loglevel was lower than info, even if -stats was set. Fixes #6962
Unified · Split
| @@ -133,8 +133,9 @@ This option has been deprecated in favor of private options, try -pixel_format. · 132 unmodified lines | |||
| 133 | @item -stats | 133 | @item -stats |
| 134 | Print several playback statistics, in particular show the stream | 134 | Print several playback statistics, in particular show the stream |
| 135 | duration, the codec parameters, the current position in the stream and | 135 | duration, the codec parameters, the current position in the stream and |
| 136 | the audio/video synchronisation drift. It is on by default, to | 136 | the audio/video synchronisation drift. It is shown by default, unless the |
| 137 | explicitly disable it you need to specify @code{-nostats}. | 137 | log level is lower than @code{info}. Its display can be forced by manually |
| 138 | specifying this option. To disable it, you need to specify @code{-nostats}. | ||
| 138 | 139 | ||
| 139 | @item -fast | 140 | @item -fast |
| 140 | Non-spec-compliant optimizations. | 141 | Non-spec-compliant optimizations. |
| @@ -40,6 +40,7 @@ · 39 unmodified lines | |||
| 40 | #include "libavutil/samplefmt.h" | 40 | #include "libavutil/samplefmt.h" |
| 41 | #include "libavutil/avassert.h" | 41 | #include "libavutil/avassert.h" |
| 42 | #include "libavutil/time.h" | 42 | #include "libavutil/time.h" |
| 43 | #include "libavutil/bprint.h" | ||
| 43 | #include "libavformat/avformat.h" | 44 | #include "libavformat/avformat.h" |
| 44 | #include "libavdevice/avdevice.h" | 45 | #include "libavdevice/avdevice.h" |
| 45 | #include "libswscale/swscale.h" | 46 | #include "libswscale/swscale.h" |
| @@ -326,7 +327,7 @@ static int display_disable; · 280 unmodified lines | |||
| 326 | static int borderless; | 327 | static int borderless; |
| 327 | static int alwaysontop; | 328 | static int alwaysontop; |
| 328 | static int startup_volume = 100; | 329 | static int startup_volume = 100; |
| 329 | static int show_status = 1; | 330 | static int show_status = -1; |
| 330 | static int av_sync_type = AV_SYNC_AUDIO_MASTER; | 331 | static int av_sync_type = AV_SYNC_AUDIO_MASTER; |
| 331 | static int64_t start_time = AV_NOPTS_VALUE; | 332 | static int64_t start_time = AV_NOPTS_VALUE; |
| 332 | static int64_t duration = AV_NOPTS_VALUE; | 333 | static int64_t duration = AV_NOPTS_VALUE; |
| @@ -1692,6 +1693,7 @@ display: · 1359 unmodified lines | |||
| 1692 | } | 1693 | } |
| 1693 | is->force_refresh = 0; | 1694 | is->force_refresh = 0; |
| 1694 | if (show_status) { | 1695 | if (show_status) { |
| 1696 | AVBPrint buf; | ||
| 1695 | static int64_t last_time; | 1697 | static int64_t last_time; |
| 1696 | int64_t cur_time; | 1698 | int64_t cur_time; |
| 1697 | int aqsize, vqsize, sqsize; | 1699 | int aqsize, vqsize, sqsize; |
| @@ -1715,18 +1717,28 @@ display: · 17 unmodified lines | |||
| 1715 | av_diff = get_master_clock(is) - get_clock(&is->vidclk); | 1717 | av_diff = get_master_clock(is) - get_clock(&is->vidclk); |
| 1716 | else if (is->audio_st) | 1718 | else if (is->audio_st) |
| 1717 | av_diff = get_master_clock(is) - get_clock(&is->audclk); | 1719 | av_diff = get_master_clock(is) - get_clock(&is->audclk); |
| 1718 | av_log(NULL, AV_LOG_INFO, | 1720 | |
| 1719 | "%7.2f %s:%7.3f fd=%4d aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r", | 1721 | av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC); |
| 1720 | get_master_clock(is), | 1722 | av_bprintf(&buf, |
| 1721 | (is->audio_st && is->video_st) ? "A-V" : (is->video_st ? "M-V" : (is->audio_st ? "M-A" : " ")), | 1723 | "%7.2f %s:%7.3f fd=%4d aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r", |
| 1722 | av_diff, | 1724 | get_master_clock(is), |
| 1723 | is->frame_drops_early + is->frame_drops_late, | 1725 | (is->audio_st && is->video_st) ? "A-V" : (is->video_st ? "M-V" : (is->audio_st ? "M-A" : " ")), |
| 1724 | aqsize / 1024, | 1726 | av_diff, |
| 1725 | vqsize / 1024, | 1727 | is->frame_drops_early + is->frame_drops_late, |
| 1726 | sqsize, | 1728 | aqsize / 1024, |
| 1727 | is->video_st ? is->viddec.avctx->pts_correction_num_faulty_dts : 0, | 1729 | vqsize / 1024, |
| 1728 | is->video_st ? is->viddec.avctx->pts_correction_num_faulty_pts : 0); | 1730 | sqsize, |
| 1731 | is->video_st ? is->viddec.avctx->pts_correction_num_faulty_dts : 0, | ||
| 1732 | is->video_st ? is->viddec.avctx->pts_correction_num_faulty_pts : 0); | ||
| 1733 | |||
| 1734 | if (show_status == 1 && AV_LOG_INFO > av_log_get_level()) | ||
| 1735 | fprintf(stderr, "%s", buf.str); | ||
| 1736 | else | ||
| 1737 | av_log(NULL, AV_LOG_INFO, "%s", buf.str); | ||
| 1738 | |||
| 1729 | fflush(stdout); | 1739 | fflush(stdout); |
| 1740 | av_bprint_finalize(&buf, NULL); | ||
| 1741 | |||
| 1730 | last_time = cur_time; | 1742 | last_time = cur_time; |
| 1731 | } | 1743 | } |
| 1732 | } | 1744 | } |