mirror of https://github.com/mpv-player/mpv
sd_lavc: compensate for a stupid libavcodec API issue
The libavcodec PGS decoder sets end_display_time to UINT32_MAX, in an attempt to signal unknown end time (the API does not allow to signal this properly, and this was a backwards compatible hack). While we have no issues with the large value, our code wants to distinguish between known and unknown end time explicitly.
This commit is contained in:
parent
49d01d81e0
commit
1e3400e353
|
@ -210,8 +210,11 @@ static void decode(struct sd *sd, struct demux_packet *packet)
|
|||
return;
|
||||
|
||||
if (pts != MP_NOPTS_VALUE) {
|
||||
if (sub.end_display_time > sub.start_display_time)
|
||||
if (sub.end_display_time > sub.start_display_time &&
|
||||
sub.end_display_time != UINT32_MAX)
|
||||
{
|
||||
duration = (sub.end_display_time - sub.start_display_time) / 1000.0;
|
||||
}
|
||||
pts += sub.start_display_time / 1000.0;
|
||||
}
|
||||
double endpts = MP_NOPTS_VALUE;
|
||||
|
|
Loading…
Reference in New Issue