decoder/ffmpeg: detect and fix negative time stamps
Works around assertion failure due to something that appears to be a (minor) FFmpeg bug.
This commit is contained in:
parent
d8351772d3
commit
fa4beeee75
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.18.21 (not yet released)
|
ver 0.18.21 (not yet released)
|
||||||
|
* decoder
|
||||||
|
- ffmpeg: fix time stamp underflow
|
||||||
|
|
||||||
ver 0.18.20 (2014/12/08)
|
ver 0.18.20 (2014/12/08)
|
||||||
* decoder
|
* decoder
|
||||||
|
|
|
@ -284,10 +284,13 @@ ffmpeg_send_packet(Decoder &decoder, InputStream &is,
|
||||||
AVFrame *frame,
|
AVFrame *frame,
|
||||||
uint8_t **buffer, int *buffer_size)
|
uint8_t **buffer, int *buffer_size)
|
||||||
{
|
{
|
||||||
if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE)
|
if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE) {
|
||||||
decoder_timestamp(decoder,
|
auto start = start_time_fallback(*stream);
|
||||||
time_from_ffmpeg(packet->pts - start_time_fallback(*stream),
|
if (packet->pts >= start)
|
||||||
stream->time_base));
|
decoder_timestamp(decoder,
|
||||||
|
time_from_ffmpeg(packet->pts - start,
|
||||||
|
stream->time_base));
|
||||||
|
}
|
||||||
|
|
||||||
AVPacket packet2 = *packet;
|
AVPacket packet2 = *packet;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue