Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Baptiste Coudurier authored on 2011/06/03 07:28:52... | ... |
@@ -1379,7 +1379,8 @@ static void print_report(AVFormatContext **output_files, |
1379 | 1379 |
int64_t total_size; |
1380 | 1380 |
AVCodecContext *enc; |
1381 | 1381 |
int frame_number, vid, i; |
1382 |
- double bitrate, ti1, pts; |
|
1382 |
+ double bitrate; |
|
1383 |
+ int64_t pts = INT64_MAX; |
|
1383 | 1384 |
static int64_t last_time = -1; |
1384 | 1385 |
static int qp_histogram[52]; |
1385 | 1386 |
|
... | ... |
@@ -1404,7 +1405,6 @@ static void print_report(AVFormatContext **output_files, |
1404 | 1404 |
total_size= avio_tell(oc->pb); |
1405 | 1405 |
|
1406 | 1406 |
buf[0] = '\0'; |
1407 |
- ti1 = 1e10; |
|
1408 | 1407 |
vid = 0; |
1409 | 1408 |
for(i=0;i<nb_ostreams;i++) { |
1410 | 1409 |
float q = -1; |
... | ... |
@@ -1455,19 +1455,16 @@ static void print_report(AVFormatContext **output_files, |
1455 | 1455 |
vid = 1; |
1456 | 1456 |
} |
1457 | 1457 |
/* compute min output value */ |
1458 |
- pts = (double)ost->st->pts.val * av_q2d(ost->st->time_base); |
|
1459 |
- if ((pts < ti1) && (pts > 0)) |
|
1460 |
- ti1 = pts; |
|
1458 |
+ pts = FFMIN(pts, av_rescale_q(ost->st->pts.val, |
|
1459 |
+ ost->st->time_base, AV_TIME_BASE_Q)); |
|
1461 | 1460 |
} |
1462 |
- if (ti1 < 0.01) |
|
1463 |
- ti1 = 0.01; |
|
1464 | 1461 |
|
1465 | 1462 |
if (verbose > 0 || is_last_report) { |
1466 |
- bitrate = (double)(total_size * 8) / ti1 / 1000.0; |
|
1463 |
+ bitrate = pts ? total_size * 8 / (pts / 1000.0) : 0; |
|
1467 | 1464 |
|
1468 | 1465 |
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), |
1469 | 1466 |
"size=%8.0fkB time=%0.2f bitrate=%6.1fkbits/s", |
1470 |
- (double)total_size / 1024, ti1, bitrate); |
|
1467 |
+ (double)total_size / 1024, pts/(double)AV_TIME_BASE, bitrate); |
|
1471 | 1468 |
|
1472 | 1469 |
if (nb_frames_dup || nb_frames_drop) |
1473 | 1470 |
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d", |