mirror of
https://github.com/mpv-player/mpv
synced 2025-01-21 07:10:52 +00:00
demux_lavf: fix percentage display with some file formats
AVFormatContext.start_time is sometimes AV_NOPTS_VALUE, such as when playing FLAC files. (For most other file formats it's set to 0, even if the format doesn't support arbitrary start times.)
This commit is contained in:
parent
56149ff5ac
commit
c82a83d8af
@ -768,7 +768,8 @@ static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
|
||||
return DEMUXER_CTRL_OK;
|
||||
|
||||
case DEMUXER_CTRL_GET_START_TIME:
|
||||
*((double *)arg) = (double)priv->avfc->start_time / AV_TIME_BASE;
|
||||
*((double *)arg) = priv->avfc->start_time == AV_NOPTS_VALUE ?
|
||||
0 : (double)priv->avfc->start_time / AV_TIME_BASE;
|
||||
return DEMUXER_CTRL_OK;
|
||||
|
||||
case DEMUXER_CTRL_SWITCH_AUDIO:
|
||||
|
Loading…
Reference in New Issue
Block a user