From 4205bbf243227bf151f2439ecb7772c41ecbfd12 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Nov 2013 23:08:29 +0100 Subject: video: pass PTS as part of demux_packet/AVPacket and mp_image/AVFrame Instead of passing the PTS as separate field, pass it as part of the usual data structures. Basically, this removes strange artifacts from the API. (It's not finished, though: the final decoded PTS goes through strange paths, and filter_video() finally overwrites the decoded mp_image's pts field with it.) We also stop using libavcodec's reordered_opaque fields, and use AVPacket.pts and AVFrame.pkt_pts. This is slightly unorthodox, because these pts fields are not "really" opaque anymore, yet we treat them as such. But the end result should be the same, and reordered_opaque is marked as partially deprecated (it's not clear whether it's really deprecated). --- video/decode/dec_video.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'video/decode/dec_video.h') diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index 9f01d32947..7d8928eb58 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -42,8 +42,6 @@ struct dec_video { void *priv; - float next_frame_time; - double last_pts; double buffered_pts[32]; int num_buffered_pts; double codec_reordered_pts; @@ -59,6 +57,10 @@ struct dec_video { int i_bps; // == bitrate (compressed bytes/sec) float fps; // FPS from demuxer or from user override float initial_decoder_aspect; + + // State used only by player/video.c + float next_frame_time; + double last_pts; }; struct mp_decoder_list *video_decoder_list(void); @@ -68,7 +70,7 @@ void video_uninit(struct dec_video *d_video); struct demux_packet; void *video_decode(struct dec_video *d_video, struct demux_packet *packet, - int drop_frame, double pts); + int drop_frame); int video_get_colors(struct dec_video *d_video, const char *item, int *value); int video_set_colors(struct dec_video *d_video, const char *item, int value); -- cgit v1.2.3