]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg: Force a first_pts of 0 for the first configuration of -async use
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 25 Feb 2013 02:00:58 +0000 (03:00 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 25 Feb 2013 03:39:26 +0000 (04:39 +0100)
This is very close to what the default does currently

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.h
ffmpeg_filter.c

index d8a963ece5c32f9e532d49930db0236213722949..b89a5ac626f281f38d0604469772e191c37376a4 100644 (file)
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -198,6 +198,7 @@ typedef struct FilterGraph {
     const char    *graph_desc;
 
     AVFilterGraph *graph;
+    int reconfiguration;
 
     InputFilter   **inputs;
     int          nb_inputs;
index 7a9efeaf05cd6823f6aad19c76f9b5c75ef92668..1919f78e24c0161d3968faf03d5291af6d946b01 100644 (file)
@@ -675,6 +675,8 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
         av_strlcatf(args, sizeof(args), "async=%d", audio_sync_method);
         if (audio_drift_threshold != 0.1)
             av_strlcatf(args, sizeof(args), ":min_hard_comp=%f", audio_drift_threshold);
+        if (!fg->reconfiguration)
+            av_strlcatf(args, sizeof(args), ":first_pts=0");
         AUTO_INSERT_FILTER_INPUT("-async", "aresample", args);
     }
 
@@ -796,6 +798,7 @@ int configure_filtergraph(FilterGraph *fg)
         }
     }
 
+    fg->reconfiguration = 1;
     return 0;
 }