[PATCH] make mencoder stream size printing use 64 bits
...just like the subject says. Currently, the printing uses a signed int, so any stream size over 2 GB gets misrepresented. Bug reported by by mslama <<at>> email <<dot>> cz. Thanks to Reimar for pointing out the PRIu64 stuff. Did I do it right? I'll apply this tomorrow unless someone objects. -Corey Index: mencoder.c =================================================================== RCS file: /cvsroot/mplayer/main/mencoder.c,v retrieving revision 1.351 diff -u -r1.351 mencoder.c --- mencoder.c 25 Apr 2006 02:01:21 -0000 1.351 +++ mencoder.c 25 Apr 2006 17:16:04 -0000 @@ -1572,10 +1572,10 @@ } mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_VideoStreamResult, - (float)(mux_v->size/mux_v->timer*8.0f/1000.0f), (int)(mux_v->size/mux_v->timer), (int)mux_v->size, (float)mux_v->timer, decoded_frameno); + (float)(mux_v->size/mux_v->timer*8.0f/1000.0f), (int)(mux_v->size/mux_v->timer), (uint64_t)mux_v->size, (float)mux_v->timer, decoded_frameno); if(sh_audio) mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_AudioStreamResult, - (float)(mux_a->size/mux_a->timer*8.0f/1000.0f), (int)(mux_a->size/mux_a->timer), (int)mux_a->size, (float)mux_a->timer); + (float)(mux_a->size/mux_a->timer*8.0f/1000.0f), (int)(mux_a->size/mux_a->timer), (uint64_t)mux_a->size, (float)mux_a->timer); if(sh_audio){ uninit_audio(sh_audio);sh_audio=NULL; } if(sh_video){ uninit_video(sh_video);sh_video=NULL; } Index: help/help_mp-en.h =================================================================== RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v retrieving revision 1.246 diff -u -r1.246 help_mp-en.h --- help/help_mp-en.h 24 Apr 2006 19:14:16 -0000 1.246 +++ help/help_mp-en.h 25 Apr 2006 17:16:05 -0000 @@ -266,8 +266,8 @@ "Your encode might be broken!\n" #define MSGTR_ErrorWritingFile "%s: Error writing file.\n" #define MSGTR_RecommendedVideoBitrate "Recommended video bitrate for %s CD: %d\n" -#define MSGTR_VideoStreamResult "\nVideo stream: %8.3f kbit/s (%d B/s) size: %d bytes %5.3f secs %d frames\n" -#define MSGTR_AudioStreamResult "\nAudio stream: %8.3f kbit/s (%d B/s) size: %d bytes %5.3f secs\n" +#define MSGTR_VideoStreamResult "\nVideo stream: %8.3f kbit/s (%d B/s) size: %"PRIu64" bytes %5.3f secs %d frames\n" +#define MSGTR_AudioStreamResult "\nAudio stream: %8.3f kbit/s (%d B/s) size: %"PRIu64" bytes %5.3f secs\n" #define MSGTR_OpenedStream "success: format: %d data: 0x%X - 0x%x\n" #define MSGTR_VCodecFramecopy "videocodec: framecopy (%dx%d %dbpp fourcc=%x)\n" #define MSGTR_ACodecFramecopy "audiocodec: framecopy (format=%x chans=%d rate=%d bits=%d B/s=%d sample-%d)\n"
Corey Hickey wrote:
...just like the subject says. Currently, the printing uses a signed int, so any stream size over 2 GB gets misrepresented.
Bug reported by by mslama <<at>> email <<dot>> cz.
Thanks to Reimar for pointing out the PRIu64 stuff.
Did I do it right? I'll apply this tomorrow unless someone objects.
Applied. -Corey
participants (1)
-
Corey Hickey