Revision d4d226a8

View differences:

ffmpeg.c
178 178
static int subtitle_stream_copy = 0;
179 179
static int video_sync_method= 1;
180 180
static int audio_sync_method= 0;
181
static float audio_drift_threshold= 0.1;
181 182
static int copy_ts= 0;
182 183
static int opt_shortest = 0; //
183 184
static int video_global_header = 0;
......
453 454

  
454 455
        //FIXME resample delay
455 456
        if(fabs(delta) > 50){
456
            if(ist->is_start){
457
            if(ist->is_start || fabs(delta) > audio_drift_threshold*enc->sample_rate){
457 458
                if(byte_delta < 0){
458 459
                    byte_delta= FFMAX(byte_delta, -size);
459 460
                    size += byte_delta;
......
3607 3608
    { "threads", HAS_ARG | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
3608 3609
    { "vsync", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&video_sync_method}, "video sync method", "" },
3609 3610
    { "async", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&audio_sync_method}, "audio sync method", "" },
3611
    { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, {(void*)&audio_drift_threshold}, "audio drift threshold", "" },
3610 3612
    { "vglobal", HAS_ARG | OPT_INT | OPT_EXPERT, {(void*)&video_global_header}, "video global header storage type", "" },
3611 3613
    { "copyts", OPT_BOOL | OPT_EXPERT, {(void*)&copy_ts}, "copy timestamps" },
3612 3614
    { "shortest", OPT_BOOL | OPT_EXPERT, {(void*)&opt_shortest}, "finish encoding within shortest input" }, //

Also available in: Unified diff