mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
dec_video: don't spam missing PTS warnings
Only print at most 2. Just because with some decoders, we will always hit this code path, such as playing avi of vfw-muxed mkv on RPI.
This commit is contained in:
parent
67467103e8
commit
fc1017c335
@ -64,6 +64,7 @@ void video_reset(struct dec_video *d_video)
|
||||
d_video->decoded_pts = MP_NOPTS_VALUE;
|
||||
d_video->codec_pts = MP_NOPTS_VALUE;
|
||||
d_video->codec_dts = MP_NOPTS_VALUE;
|
||||
d_video->has_broken_decoded_pts = 0;
|
||||
d_video->last_format = d_video->fixed_format = (struct mp_image_params){0};
|
||||
d_video->dropped_frames = 0;
|
||||
d_video->current_state = DATA_AGAIN;
|
||||
@ -317,8 +318,14 @@ static struct mp_image *decode_packet(struct dec_video *d_video,
|
||||
pts = dts;
|
||||
|
||||
if (!opts->correct_pts || pts == MP_NOPTS_VALUE) {
|
||||
if (opts->correct_pts && !d_video->header->missing_timestamps)
|
||||
MP_WARN(d_video, "No video PTS! Making something up.\n");
|
||||
if (opts->correct_pts && !d_video->header->missing_timestamps) {
|
||||
if (d_video->has_broken_decoded_pts <= 1) {
|
||||
MP_WARN(d_video, "No video PTS! Making something up.\n");
|
||||
if (d_video->has_broken_decoded_pts == 1)
|
||||
MP_WARN(d_video, "Ignoring further missing PTS warnings.\n");
|
||||
d_video->has_broken_decoded_pts++;
|
||||
}
|
||||
}
|
||||
|
||||
double frame_time = 1.0f / (d_video->fps > 0 ? d_video->fps : 25);
|
||||
double base = d_video->first_packet_pdts;
|
||||
|
@ -62,6 +62,8 @@ struct dec_video {
|
||||
// There was at least one packet with non-sense timestamps.
|
||||
int has_broken_packet_pts; // <0: uninitialized, 0: no problems, 1: broken
|
||||
|
||||
int has_broken_decoded_pts;
|
||||
|
||||
// Final PTS of previously decoded image
|
||||
double decoded_pts;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user