[vlc-commits] mux:avi: only write the fps/bitrate once

Steve Lhomme git at videolan.org
Tue Sep 18 13:53:28 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jun 12 13:22:09 2018 +0200| [1a9a54b071b43698748d7e214e6de3c847ea1f3c] | committer: Steve Lhomme

mux:avi: only write the fps/bitrate once

Either the correct one or the default values.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a9a54b071b43698748d7e214e6de3c847ea1f3c
---

 modules/mux/avi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/mux/avi.c b/modules/mux/avi.c
index 9f6000e3ac..3b1994295d 100644
--- a/modules/mux/avi.c
+++ b/modules/mux/avi.c
@@ -226,21 +226,21 @@ static void Close( vlc_object_t * p_this )
 
         p_stream = &p_sys->stream[i_stream];
 
-        p_stream->f_fps = 25;
         if( p_stream->i_duration > 0 )
         {
             p_stream->f_fps = (float)p_stream->i_frames /
                               ( (float)p_stream->i_duration /
                                 (float)CLOCK_FREQ );
-        }
-        p_stream->i_bitrate = 128 * 1024;
-        if( p_stream->i_duration > 0 )
-        {
             p_stream->i_bitrate =
                 8 * (uint64_t)1000000 *
                     (uint64_t)p_stream->i_totalsize /
                     (uint64_t)p_stream->i_duration;
         }
+        else
+        {
+            p_stream->f_fps = 25;
+            p_stream->i_bitrate = 128 * 1024;
+        }
         msg_Info( p_mux, "stream[%d] duration:%"PRId64" totalsize:%"PRId64
                   " frames:%d fps:%f KiB/s:%d",
                   i_stream,



More information about the vlc-commits mailing list