diff options
author | wm4 <wm4@nowhere> | 2019-10-03 00:22:18 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-10-03 00:22:18 +0200 |
commit | 1c63869d0ae01fd8e720353719e4c8b8da12e0b5 (patch) | |
tree | 942771789b91389636d2d65baa1238ab9b992a86 /demux/demux_lavf.c | |
parent | 8c58375dbd968fff22c9ef5a473c456657c5fc78 (diff) | |
download | mpv-1c63869d0ae01fd8e720353719e4c8b8da12e0b5.tar.bz2 mpv-1c63869d0ae01fd8e720353719e4c8b8da12e0b5.tar.xz |
demux: restore some of the DVD/BD/CDDA interaction layers
This partially reverts commit a9d83eac40c94f44d19fab7b6955331f10efe301
("Remove optical disc fancification layers").
Mostly due to the timestamp crap, this was never really going to work.
The playback layer is sensitive to timestamps, and derives the playback
time directly from the low level packet timestamps. DVD/BD works
differently, and libdvdnav/libbluray do not make it easy at all to
compensate for this. Which is why it never worked well, but not doing it
at all is even more awful.
demux_disc.c tried this and rewrote packet timestamps from low level TS
to playback time. So restore demux_disc.c, which should bring behavior
back to the old often non-working but slightly better state.
I did not revert anything that affects components above the demuxer
layer. For example, the properties for switching DVD angles or listing
disc titles are still gone. (Disc titles could be reimplemented as
editions. But not by me.)
This commit modifies the reverted code a bit; this can't be avoided,
because the internal API changed quite a bit. The old seek resync in
demux_lavf.c (which was a hack) is replaced with a hack. SEEK_FORCE and
demux_params.external_stream are new additions.
Some of this could/should be further cleaned up. If you don't want
"proper" DVD/BD support to disappear, you should probably volunteer.
Now why am I wasting my time for this? Just because some idiot users are
too lazy to rip their ever-wearing out shitty physical discs? Then why
should I not be lazy and drop support completely? They won't even be
thankful for me maintaining this horrible garbage for no compensation.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r-- | demux/demux_lavf.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 4696927ef9..281259a15e 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -222,7 +222,6 @@ typedef struct lavf_priv { int num_streams; char *mime_type; double seek_delay; - bool optical_crap_hack; struct demux_lavf_opts *opts; double mf_fps; @@ -1080,13 +1079,6 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check) "broken as well.\n"); } - double len = -1; - if (stream_control(priv->stream, STREAM_CTRL_OPTICAL_CRAP_HACK1, &len) > 0) { - priv->optical_crap_hack = true; - demuxer->duration = len; - demuxer->seekable = true; - } - if (demuxer->fully_read) { demux_close_stream(demuxer); if (priv->own_stream) @@ -1197,13 +1189,6 @@ static void demux_seek_lavf(demuxer_t *demuxer, double seek_pts, int flags) int64_t seek_pts_av = 0; int seek_stream = -1; - if (priv->optical_crap_hack) { - if (flags & SEEK_FACTOR) - seek_pts = seek_pts * demuxer->duration; - stream_control(priv->stream, STREAM_CTRL_OPTICAL_CRAP_HACK2, &seek_pts); - return; - } - if (priv->any_ts_fixed) { // helpful message to piss of users MP_WARN(demuxer, "Some timestamps returned by the demuxer were linearized. " |