Assign PTS to the right frame

The PTS was read from the socket and set as the current one even before
the frame was consumed, so it could be assigned to the previous frame
"in advance".

Store the PTS for the current frame and the last PTS read from the
packet header of the next frame in separate fields.

As a side-effect, this fixes the warning on quit:

> Application provided invalid, non monotonically increasing dts to
> muxer in stream 0: 17164020 >= 17164020
This commit is contained in:
Romain Vimont
2018-11-09 21:22:41 +01:00
parent 61db575861
commit 27e8a9a79d
2 changed files with 6 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ struct decoder {
SDL_Thread *thread;
SDL_mutex *mutex;
struct recorder *recorder;
uint64_t next_pts;
uint64_t pts;
uint32_t buffer_info_flags;
int remaining;