diff options
author | rogerdpack <rogerpack2005@gmail.com> | 2015-01-23 16:13:33 +0300 |
---|---|---|
committer | rogerdpack <rogerpack2005@gmail.com> | 2015-01-23 16:13:33 +0300 |
commit | b76a0e24f9effa64e48ff0567af0dc497dd99e84 (patch) | |
tree | 8aca17de7606ba2d43d5752e9624c21a22eff7b0 /libavdevice/dshow_pin.c | |
parent | 8eb5b5ec6f582cac25195682680907c9ac52374a (diff) |
dshow: drop initial audio packets with weird timestamps
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Diffstat (limited to 'libavdevice/dshow_pin.c')
-rw-r--r-- | libavdevice/dshow_pin.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavdevice/dshow_pin.c b/libavdevice/dshow_pin.c index 1c0dca2409..5904c28b86 100644 --- a/libavdevice/dshow_pin.c +++ b/libavdevice/dshow_pin.c @@ -320,6 +320,14 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample) } else { int64_t dummy; IMediaSample_GetTime(sample, &curtime, &dummy); + if(curtime > 400000000000000000LL) { + /* initial frames sometimes start < 0 (shown as a very large number here, + like 437650244077016960 which FFmpeg doesn't like. + TODO figure out math. For now just drop them. */ + av_log(NULL, AV_LOG_DEBUG, + "dshow dropping initial (or ending) audio frame with odd PTS too high %"PRId64"\n", curtime); + return S_OK; + } curtime += pin->filter->start_time; } |