Skip to content

Commit

Permalink
dshow: drop initial audio packets with weird timestamps
Browse files Browse the repository at this point in the history
Signed-off-by: rogerdpack <[email protected]>
  • Loading branch information
rdp committed Jan 23, 2015
1 parent 8eb5b5e commit b76a0e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libavdevice/dshow_pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b76a0e2

Please sign in to comment.