[FFmpeg-cvslog] ffmpeg: fix bytes written statistics.

Michael Niedermayer git at videolan.org
Mon Sep 10 21:14:39 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep 10 20:51:27 2012 +0200| [f0d50500908a67d2ea81d71bae5cb4b0d15ded2c] | committer: Michael Niedermayer

ffmpeg: fix bytes written statistics.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0d50500908a67d2ea81d71bae5cb4b0d15ded2c
---

 ffmpeg.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 2763db6..9935a1e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -639,9 +639,9 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
                    av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->st->time_base));
         }
 
+        audio_size += pkt.size;
         write_frame(s, &pkt, ost);
 
-        audio_size += pkt.size;
         av_free_packet(&pkt);
     }
 }
@@ -752,8 +752,8 @@ static void do_subtitle_out(AVFormatContext *s,
             else
                 pkt.pts += 90 * sub->end_display_time;
         }
-        write_frame(s, &pkt, ost);
         subtitle_size += pkt.size;
+        write_frame(s, &pkt, ost);
     }
 }
 
@@ -847,8 +847,8 @@ static void do_video_out(AVFormatContext *s,
         pkt.pts    = av_rescale_q(in_picture->pts, enc->time_base, ost->st->time_base);
         pkt.flags |= AV_PKT_FLAG_KEY;
 
-        write_frame(s, &pkt, ost);
         video_size += pkt.size;
+        write_frame(s, &pkt, ost);
     } else {
         int got_packet;
         AVFrame big_picture;
@@ -898,9 +898,9 @@ static void do_video_out(AVFormatContext *s,
                     av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->st->time_base));
             }
 
-            write_frame(s, &pkt, ost);
             frame_size = pkt.size;
             video_size += pkt.size;
+            write_frame(s, &pkt, ost);
             av_free_packet(&pkt);
 
             /* if two pass, output log */



More information about the ffmpeg-cvslog mailing list