mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Store queue of PTS for pending frames
Several frames may be read by read_packet() before they are consumed (returned by av_read_frame()), so we need to store the PTS of frames in order, so that the right PTS is assigned to the right frame.
This commit is contained in:
parent
345f8858d3
commit
60afb46c8d
2 changed files with 60 additions and 8 deletions
|
|
@ -9,6 +9,11 @@
|
|||
|
||||
struct frames;
|
||||
|
||||
struct frame_meta {
|
||||
uint64_t pts;
|
||||
struct frame_meta *next;
|
||||
};
|
||||
|
||||
struct decoder {
|
||||
struct frames *frames;
|
||||
socket_t video_socket;
|
||||
|
|
@ -16,8 +21,8 @@ struct decoder {
|
|||
SDL_mutex *mutex;
|
||||
struct recorder *recorder;
|
||||
struct receiver_state {
|
||||
uint64_t next_pts;
|
||||
uint64_t pts;
|
||||
// meta (in order) for frames not consumed yet
|
||||
struct frame_meta *frame_meta_queue;
|
||||
size_t remaining; // remaining bytes to receive for the current frame
|
||||
} receiver_state;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue