History

ffplay: always show stats at all log levels if requested by user

Since 3b491c5a500, stats would be hidden if loglevel was lower than info, even if -stats was set. Fixes #6962

Gyan Doshi committed 6 years ago

Commit 2d6a8981 parent a6e56d12 files · +27 −14Browse files

Unified · Split

2 files
  1. doc/ffplay.texi +3 −2
  2. fftools/ffplay.c +24 −12
doc/ffplay.texi+3−2
@@ -133,8 +133,9 @@ This option has been deprecated in favor of private options, try -pixel_format. · 132 unmodified lines
133@item -stats133@item -stats
134Print several playback statistics, in particular show the stream134Print several playback statistics, in particular show the stream
135duration, the codec parameters, the current position in the stream and135duration, the codec parameters, the current position in the stream and
136the audio/video synchronisation drift. It is on by default, to136the audio/video synchronisation drift. It is shown by default, unless the
137explicitly disable it you need to specify @code{-nostats}.137log level is lower than @code{info}. Its display can be forced by manually
138specifying this option. To disable it, you need to specify @code{-nostats}.
138 139
139@item -fast140@item -fast
140Non-spec-compliant optimizations.141Non-spec-compliant optimizations.
fftools/ffplay.c+24−12
@@ -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
326static int borderless;327static int borderless;
327static int alwaysontop;328static int alwaysontop;
328static int startup_volume = 100;329static int startup_volume = 100;
329static int show_status = 1;330static int show_status = -1;
330static int av_sync_type = AV_SYNC_AUDIO_MASTER;331static int av_sync_type = AV_SYNC_AUDIO_MASTER;
331static int64_t start_time = AV_NOPTS_VALUE;332static int64_t start_time = AV_NOPTS_VALUE;
332static int64_t duration = AV_NOPTS_VALUE;333static 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 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t