File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,7 @@ int stream_dump(struct MPContext *mpctx, const char *source_filename)
278278 goto done ;
279279
280280 int64_t size = stream_get_size (stream );
281+ int64_t start_pos = stream -> pos ;
281282
282283 FILE * dest = fopen (filename , "wb" );
283284 if (!dest ) {
@@ -289,9 +290,15 @@ int stream_dump(struct MPContext *mpctx, const char *source_filename)
289290
290291 while (mpctx -> stop_play == KEEP_PLAYING && ok ) {
291292 if (!opts -> quiet && ((stream -> pos / (1024 * 1024 )) % 2 ) == 1 ) {
292- uint64_t pos = stream -> pos ;
293- MP_MSG (mpctx , MSGL_STATUS , "Dumping %lld/%lld..." ,
294- (long long int )pos , (long long int )size );
293+ int64_t pos = stream -> pos ;
294+ if (size > 0 && pos >= start_pos ) {
295+ double percent = 100.0 * (pos - start_pos ) / (size - start_pos );
296+ MP_MSG (mpctx , MSGL_STATUS , "Dumping %" PRId64 "/%" PRId64 " (%.2f%%)..." ,
297+ pos , size , percent );
298+ } else {
299+ MP_MSG (mpctx , MSGL_STATUS , "Dumping %" PRId64 "/%" PRId64 "..." ,
300+ pos , size );
301+ }
295302 }
296303 uint8_t buf [4096 ];
297304 int len = stream_read (stream , buf , sizeof (buf ));
You can’t perform that action at this time.
0 commit comments