diff options
author | wm4 <wm4@nowhere> | 2013-02-03 16:04:24 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-02-03 16:53:49 +0100 |
commit | 0d3258fc1e0447de99263e62f59dfe11f1106765 (patch) | |
tree | d49ff422436ec106c45baf781a0aa96ee2805e43 | |
parent | 799bbae4f863af1e328fe4fed0da558526f3112c (diff) | |
download | mpv-0d3258fc1e0447de99263e62f59dfe11f1106765.tar.bz2 mpv-0d3258fc1e0447de99263e62f59dfe11f1106765.tar.xz |
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.
-rw-r--r-- | demux/demux_lavf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 16b9414560..342d6231db 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -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; |