mpv/video/decode
wm4 dc0b2046cd video: add insane hack to work around FFmpeg/Libav insanity
So, FFmpeg/Libav requires us to figure out video timestamps ourselves
(see last 10 commits or so), but the methods it provides for this aren't
even sufficient. In particular, everything that uses AVI-style DTS (avi,
vfw-muxed mkv, possibly mpeg4-in-ogm) with a codec that has an internal
frame delay is broken. In this case, libavcodec will shift the packet-
to-image correspondence by the codec delay, meaning that with a delay=1,
the first AVFrame.pkt_dts is not 0, but that of the second packet. All
timestamps will appear shifted. The start time (e.g. the time displayed
when doing "mpv file.avi --pause") will not be exactly 0.

(According to Libav developers, this is how it's supposed to work; just
that the first DTS values are normally negative with formats that use
DTS "properly". Who cares if it doesn't work at all with very common
video formats? There's no indication that they'll fix this soon,
either. An elegant workaround is missing too.)

Add a hack to re-enable the old PTS code for AVI and vfw-muxed MKV.
Since these timestamps are not reorderd, we wouldn't need to sort them,
but it's less code this way (and possibly more robust, should a demuxer
unexpectedly output PTS).

The original intention of all the timestamp changes recently was
actually to get rid of demuxer-specific hacks and the old timestamp
sorting code, but it looks like this didn't work out. Yet another case
where trying to replace native MPlayer functionality with FFmpeg/Libav
led to disadvantages and bugs. (Note that the old PTS sorting code
doesn't and can't handle frame dropping correctly, though.)

Bug reports:

 https://trac.ffmpeg.org/ticket/3178

 https://bugzilla.libav.org/show_bug.cgi?id=600
2013-11-28 15:20:33 +01:00
..
dec_video.c video: add insane hack to work around FFmpeg/Libav insanity 2013-11-28 15:20:33 +01:00
dec_video.h video: add heuristic to prevent framedrop during hrseek if pts broken 2013-11-28 15:20:33 +01:00
lavc.h video: move handling of container vs. stream AR out of vd_lavc.c 2013-11-23 21:40:51 +01:00
lavc_dr1.c Attempt to fix build on older libavcodec versions 2013-11-23 22:08:18 +01:00
vaapi.c video: move struct mp_hwdec_info into its own header file 2013-11-23 21:26:31 +01:00
vd.h cosmetics: rename video/audio reset functions 2013-11-27 21:14:39 +01:00
vd_lavc.c video: refactor PTS code, add fall back heuristic to DTS 2013-11-27 21:14:39 +01:00
vda.c video: add vda decode support (with hwaccel) and direct rendering 2013-08-22 12:13:30 +02:00
vdpau.c video: move struct mp_hwdec_info into its own header file 2013-11-23 21:26:31 +01:00
vdpau_old.c Attempt to fix build on older libavcodec versions 2013-11-23 22:08:18 +01:00