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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user