mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 00:06:25 +01:00
demux_lavf: default PTS to 0 for attached pictures
The ffmpeg/libav attached picture hack usually set the PTS of video packets to AV_NOPTS_VALUE. Set it to 0 to avoid printing a warning by the filter code.
This commit is contained in:
parent
799bbae4f8
commit
0d3258fc1e
@ -804,7 +804,11 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds)
|
||||
dp = new_demux_packet_fromdata(pkt->data, pkt->size);
|
||||
dp->avpacket = pkt;
|
||||
|
||||
AVStream *st = priv->avfc->streams[id];
|
||||
|
||||
int64_t ts = priv->use_dts ? pkt->dts : pkt->pts;
|
||||
if (ts == AV_NOPTS_VALUE && (st->disposition & AV_DISPOSITION_ATTACHED_PIC))
|
||||
ts = 0;
|
||||
if (ts != AV_NOPTS_VALUE) {
|
||||
dp->pts = ts * av_q2d(priv->avfc->streams[id]->time_base);
|
||||
priv->last_pts = dp->pts * AV_TIME_BASE;
|
||||
|
Loading…
Reference in New Issue
Block a user