winlin

fix ingest flv tool, support non monotonically timestamp.

@@ -38,6 +38,7 @@ int proxy(srs_flv_t flv, srs_rtmp_t ortmp); @@ -38,6 +38,7 @@ int proxy(srs_flv_t flv, srs_rtmp_t ortmp);
38 int connect_oc(srs_rtmp_t ortmp); 38 int connect_oc(srs_rtmp_t ortmp);
39 39
40 #define RE_PULSE_MS 300 40 #define RE_PULSE_MS 300
  41 +#define RE_PULSE_JITTER_MS 3000
41 int64_t re_create(); 42 int64_t re_create();
42 void re_update(int64_t re, int32_t starttime, u_int32_t time); 43 void re_update(int64_t re, int32_t starttime, u_int32_t time);
43 void re_cleanup(int64_t re, int32_t starttime, u_int32_t time); 44 void re_cleanup(int64_t re, int32_t starttime, u_int32_t time);
@@ -256,7 +257,7 @@ void re_update(int64_t re, int32_t starttime, u_int32_t time) @@ -256,7 +257,7 @@ void re_update(int64_t re, int32_t starttime, u_int32_t time)
256 // send by pulse algorithm. 257 // send by pulse algorithm.
257 int64_t now = srs_utils_time_ms(); 258 int64_t now = srs_utils_time_ms();
258 int64_t diff = time - starttime - (now -re); 259 int64_t diff = time - starttime - (now -re);
259 - if (diff > RE_PULSE_MS) { 260 + if (diff > RE_PULSE_MS && diff < RE_PULSE_JITTER_MS) {
260 usleep((useconds_t)(diff * 1000)); 261 usleep((useconds_t)(diff * 1000));
261 } 262 }
262 } 263 }