avdemux: fix negative pts if start_time is bigger than the ts
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>
Thu, 21 Feb 2019 07:48:31 +0000 (08:48 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>
Thu, 21 Feb 2019 07:56:34 +0000 (08:56 +0100)
commit1d293764e55fb9c3901c9dfa903fa5ae0021ab10
tree3662149be0532119ea87ccb69887f10a09d5e15c
parent1e01f2764bb99a58471dfacce54f8abaf76553f9
avdemux: fix negative pts if start_time is bigger than the ts

The start time is supposed to be the ts of the first frame.
FFmpeg uses fractions to represent timestamps and the start time may use a
different base than the frame pts. So we may end up having the start
time bigger than the pts because of rounding when converting to gst ts.

See https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/51
for details.
ext/libav/gstavdemux.c