diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-20 23:58:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-20 23:59:09 +0100 |
commit | f2387152bcdc4b3a4e650f8b00600796aa0504de (patch) | |
tree | 08ab3c858d056e314f253283ca5fd679a59c8a55 | |
parent | 9026c49c82dce0a7658e7cd116f98fdd020d2bed (diff) | |
parent | 5c79d2e12d13959fc6aed92d102c25194a06de05 (diff) | |
download | ffmpeg-f2387152bcdc4b3a4e650f8b00600796aa0504de.tar.gz |
Merge commit '5c79d2e12d13959fc6aed92d102c25194a06de05'
* commit '5c79d2e12d13959fc6aed92d102c25194a06de05':
avconv: Do not divide by zero
Conflicts:
ffmpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | ffmpeg.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1340,7 +1340,12 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti } if (is_last_report) { - int64_t raw= audio_size + video_size + data_size + subtitle_size + extra_size; + int64_t raw = audio_size + video_size + data_size + subtitle_size + extra_size; + float percent = 0.0; + + if (raw) + percent = 100.0 * (total_size - raw) / raw; + av_log(NULL, AV_LOG_INFO, "\n"); av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB subtitle:%1.0f data:%1.0f global headers:%1.0fkB muxing overhead %f%%\n", video_size / 1024.0, @@ -1348,8 +1353,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti subtitle_size / 1024.0, data_size / 1024.0, extra_size / 1024.0, - 100.0 * (total_size - raw) / raw - ); + percent); if(video_size + data_size + audio_size + subtitle_size + extra_size == 0){ av_log(NULL, AV_LOG_WARNING, "Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)\n"); } |