aboutsummaryrefslogtreecommitdiffstats
path: root/avconv.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-04-08 15:00:01 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-04-09 13:47:11 -0400
commitb073819bc974965056f435d69dc51e9ec5877395 (patch)
tree83556593a20e96e4e65edd5032bd7da1879ff731 /avconv.c
parent679a973e9701576b1c3c6d71838c45c10ac20564 (diff)
downloadffmpeg-b073819bc974965056f435d69dc51e9ec5877395.tar.gz
avconv: allow '-async -1' to disable timestamp sync for audio encoding
This will allow a workaround for cases where input timestamps are invalid or when decoder delay of 1 packet or more confuses avconv into using the wrong timestamps as a sync reference.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/avconv.c b/avconv.c
index 2dce66f7f7..7344028bce 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1101,7 +1101,7 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
ost->reformat_pair = MAKE_SFMT_PAIR(enc->sample_fmt,dec->sample_fmt);
}
- if (audio_sync_method) {
+ if (audio_sync_method > 0) {
double delta = get_sync_ipts(ost, ist->last_dts) * enc->sample_rate - ost->sync_opts -
av_fifo_size(ost->fifo) / (enc->channels * osize);
int idelta = delta * dec->sample_rate / enc->sample_rate;
@@ -1148,7 +1148,7 @@ static void do_audio_out(AVFormatContext *s, OutputStream *ost,
av_resample_compensate(*(struct AVResampleContext**)ost->resample, comp, enc->sample_rate);
}
}
- } else
+ } else if (audio_sync_method == 0)
ost->sync_opts = lrintf(get_sync_ipts(ost, ist->last_dts) * enc->sample_rate) -
av_fifo_size(ost->fifo) / (enc->channels * osize); // FIXME wrong