changeset 5622:a427102c12cd libavformat

Guess the duration before converting video and write guessed duration into flv header. Patch by Justin Johnson, justin D johnson3 A gmail
author cehoyos
date Tue, 02 Feb 2010 22:23:09 +0000
parents dea6e2d5442d
children d8bfadee68a0
files flvenc.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flvenc.c	Tue Feb 02 16:47:51 2010 +0000
+++ b/flvenc.c	Tue Feb 02 22:23:09 2010 +0000
@@ -221,7 +221,7 @@
 
     put_amf_string(pb, "duration");
     flv->duration_offset= url_ftell(pb);
-    put_amf_double(pb, 0); // delayed write
+    put_amf_double(pb, s->duration / AV_TIME_BASE); // fill in the guessed duration, it'll be corrected later if incorrect
 
     if(video_enc){
         put_amf_string(pb, "width");