1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-16 03:51:48 +00:00
mpv/video
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
..
decode video: add insane hack to work around FFmpeg/Libav insanity 2013-11-28 15:20:33 +01:00
filter video/filter: fix PIC compile on x86 2013-11-26 23:43:56 +01:00
out cocoa: unlock on uninit 2013-11-26 20:50:35 +01:00
csputils.c video: support setting libswscale chroma position 2013-07-25 23:03:20 +02:00
csputils.h video: support setting libswscale chroma position 2013-07-25 23:03:20 +02:00
fmt-conversion.c video: make IMGFMT_RGB0 etc. exist even if libavutil doesn't support it 2013-11-05 22:05:23 +01:00
fmt-conversion.h
hwdec.h video: move struct mp_hwdec_info into its own header file 2013-11-23 21:26:31 +01:00
image_writer.c configure: uniform the defines to #define HAVE_xxx (0|1) 2013-11-03 21:59:54 +01:00
image_writer.h
img_format.c video: make IMGFMT_RGB0 etc. exist even if libavutil doesn't support it 2013-11-05 22:05:23 +01:00
img_format.h video: make IMGFMT_RGB0 etc. exist even if libavutil doesn't support it 2013-11-05 22:05:23 +01:00
img_fourcc.h
memcpy_pic.h memcpy_pic: reformat 2013-11-06 20:27:13 +01:00
mp_image_pool.c talloc: change talloc destructor signature 2013-10-13 01:16:30 +02:00
mp_image_pool.h mp_image_pool: make reference counting thread-safe 2013-07-28 19:25:07 +02:00
mp_image.c mp_image: add helper for copying image attributes 2013-11-03 23:55:16 +01:00
mp_image.h mp_image: add helper for copying image attributes 2013-11-03 23:55:16 +01:00
sws_utils.c Fix some more -Wshadow warnings 2013-11-01 17:35:38 +01:00
sws_utils.h Fix some more -Wshadow warnings 2013-11-01 17:35:38 +01:00
vaapi.c video/out: always support redrawing VO window at any point 2013-10-02 00:36:26 +02:00
vaapi.h vaapi: check image format in va_surface_upload() 2013-09-27 18:00:03 +02:00
vdpau_functions.inc video: check profiles with hardware decoding 2013-11-01 17:33:33 +01:00
vdpau.c vdpau: move device and video surface management from vo_vdpau.c to vdpau.c 2013-11-05 22:13:05 +01:00
vdpau.h vdpau: move device and video surface management from vo_vdpau.c to vdpau.c 2013-11-05 22:13:05 +01:00
vfcap.h