diff options
author | wm4 <wm4@nowhere> | 2012-08-12 18:40:21 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-16 17:17:49 +0200 |
commit | 41fbcee1f557c3ddbfefc79b2b1b4719c6442265 (patch) | |
tree | 6c15b7631ad817a68207d2d04e4969ec0e128a8a | |
parent | aebfbbf2bdda8e18beef90c16da97bd335f7d3b0 (diff) | |
download | mpv-41fbcee1f557c3ddbfefc79b2b1b4719c6442265.tar.bz2 mpv-41fbcee1f557c3ddbfefc79b2b1b4719c6442265.tar.xz |
Remove dvdnav support (DVD menus)
When the internal mplayer MPEG demuxer was removed (commit 1fde09db),
the default demuxer when using dvdnav was set to libavformat. Now it
turns out that this doesn't work with libavformat. It will terminate
playback right after the audio runs out (instead of looping it like the
video, or whatever it's supposed to do). I'm not sure what exactly the
problem is, but since 1. even mplayer-svn can't handle DVD menus
directly (missing highlights), 2. DVD menus are essentially worthless,
and 3. I don't directly watch DVDs, don't bother with it and remove it.
For basic playback, there's still libdvdread support.
Also, use pkg-config for libdvdread, and drop support for in-tree
libdvdread. Remove support for in-tree libdvdcss as well.
-rw-r--r-- | DOCS/man/en/mplayer.rst | 35 | ||||
-rw-r--r-- | Makefile | 33 | ||||
-rw-r--r-- | command.c | 79 | ||||
-rwxr-xr-x | configure | 133 | ||||
-rw-r--r-- | etc/input.conf | 14 | ||||
-rw-r--r-- | input/input.c | 4 | ||||
-rw-r--r-- | input/input.h | 11 | ||||
-rw-r--r-- | libmpdemux/demuxer.c | 2 | ||||
-rw-r--r-- | mp_core.h | 6 | ||||
-rw-r--r-- | mplayer.c | 241 | ||||
-rw-r--r-- | parser-mpcmd.c | 8 | ||||
-rw-r--r-- | stream/stream.c | 8 | ||||
-rw-r--r-- | stream/stream.h | 1 | ||||
-rw-r--r-- | stream/stream_dvdnav.c | 1027 | ||||
-rw-r--r-- | stream/stream_dvdnav.h | 49 | ||||
-rw-r--r-- | sub/sub.c | 62 | ||||
-rw-r--r-- | sub/sub.h | 6 |
17 files changed, 15 insertions, 1704 deletions
diff --git a/DOCS/man/en/mplayer.rst b/DOCS/man/en/mplayer.rst index 3c1ffe43f1..89c125a1e0 100644 --- a/DOCS/man/en/mplayer.rst +++ b/DOCS/man/en/mplayer.rst @@ -9,7 +9,7 @@ Synopsis | **mplayer** [options] files | **mplayer** [options] {group of files and options} | **mplayer** [br]://[title][/device] [options] -| **mplayer** [dvd|dvdnav]://[title|[start\_title]-end\_title][/device] [options] +| **mplayer** dvd://[title|[start\_title]-end\_title][/device] [options] | **mplayer** \vcd://track[/device] | **mplayer** \tv://[channel][/input_id] [options] | **mplayer** radio://[channel|frequency][/capture] [options] @@ -239,30 +239,6 @@ n u Change channel list. -(The following keys are only valid if you compiled with dvdnav support: They -are used to navigate the menus.) - -keypad 8 - Select button up. - -keypad 2 - Select button down. - -keypad 4 - Select button left. - -keypad 6 - Select button right. - -keypad 5 - Return to main menu. - -keypad 7 - Return to nearest menu (the order of preference is: chapter->title->root). - -keypad ENTER - Confirm choice. - mouse control ------------- @@ -410,12 +386,6 @@ option. To end the profile, start another one or use the profile name | vf=pp=hb/vb/dr/al/fd | alang=en | -| [protocol.dvdnav] -| profile-desc="profile for dvdnav:// streams" -| profile=protocol.dvd -| mouse-movements=yes -| nocache=yes -| | [extension.flv] | profile-desc="profile for .flv files" | flip=yes @@ -680,9 +650,6 @@ Play DVD video from a directory with VOB files: Copy a DVD title to hard disk, saving to file title1.vob : ``mplayer dvd://1 --dumpstream --dumpfile=title1.vob`` -Play a DVD with dvdnav from path /dev/sr1: - ``mplayer dvdnav:////dev/sr1`` - Stream from HTTP: ``mplayer http://mplayer.hq/example.avi`` @@ -31,29 +31,8 @@ SRCS_COMMON-$(CDDA) += stream/stream_cdda.c \ SRCS_COMMON-$(CDDB) += stream/stream_cddb.c SRCS_COMMON-$(DVBIN) += stream/dvb_tune.c \ stream/stream_dvb.c -SRCS_COMMON-$(DVDNAV) += stream/stream_dvdnav.c -SRCS_COMMON-$(DVDNAV_INTERNAL) += libdvdnav/dvdnav.c \ - libdvdnav/highlight.c \ - libdvdnav/navigation.c \ - libdvdnav/read_cache.c \ - libdvdnav/remap.c \ - libdvdnav/searching.c \ - libdvdnav/settings.c \ - libdvdnav/vm/decoder.c \ - libdvdnav/vm/vm.c \ - libdvdnav/vm/vmcmd.c \ - SRCS_COMMON-$(DVDREAD) += stream/stream_dvd.c \ stream/stream_dvd_common.c -SRCS_COMMON-$(DVDREAD_INTERNAL) += libdvdread4/bitreader.c \ - libdvdread4/dvd_input.c \ - libdvdread4/dvd_reader.c \ - libdvdread4/dvd_udf.c \ - libdvdread4/ifo_print.c \ - libdvdread4/ifo_read.c \ - libdvdread4/md5.c \ - libdvdread4/nav_print.c \ - libdvdread4/nav_read.c \ SRCS_COMMON-$(FAAD) += libmpcodecs/ad_faad.c @@ -78,11 +57,6 @@ SRCS_COMMON-$(LIBDCA) += libmpcodecs/ad_libdca.c SRCS_COMMON-$(LIBDV) += libmpcodecs/ad_libdv.c \ libmpcodecs/vd_libdv.c \ libmpdemux/demux_rawdv.c -SRCS_COMMON-$(LIBDVDCSS_INTERNAL) += libdvdcss/css.c \ - libdvdcss/device.c \ - libdvdcss/error.c \ - libdvdcss/ioctl.c \ - libdvdcss/libdvdcss.c \ SRCS_COMMON-$(LIBMAD) += libmpcodecs/ad_libmad.c @@ -518,13 +492,6 @@ libmpcodecs/vf_fspp.o libmpcodecs/vf_mcdeint.o libmpcodecs/vf_spp.o: CFLAGS := - osdep/mplayer-rc.o: osdep/mplayer.exe.manifest -libdvdcss/%: CFLAGS := -Ilibdvdcss -D_GNU_SOURCE -DVERSION=\"1.2.10\" $(CFLAGS_LIBDVDCSS) $(CFLAGS) -libdvdnav/%: CFLAGS := -Ilibdvdnav -D_GNU_SOURCE -DHAVE_CONFIG_H -DVERSION=\"MPlayer-custom\" $(CFLAGS) -libdvdread4/%: CFLAGS := -Ilibdvdread4 -D_GNU_SOURCE $(CFLAGS_LIBDVDCSS_DVDREAD) $(CFLAGS) - -stream/stream_dvdnav%: CFLAGS := $(CFLAGS_LIBDVDNAV) $(CFLAGS) - - ###### installation / clean / generic rules ####### @@ -65,7 +65,6 @@ #ifdef CONFIG_DVDREAD #include "stream/stream_dvd.h" #endif -#include "stream/stream_dvdnav.h" #include "m_struct.h" #include "screenshot.h" @@ -1690,10 +1689,9 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg, } } #ifdef CONFIG_DVDREAD - if (vo_spudec - && (mpctx->stream->type == STREAMTYPE_DVD - || mpctx->stream->type == STREAMTYPE_DVDNAV) - && opts->sub_id < 0 && reset_spu) { + if (vo_spudec && (mpctx->stream->type == STREAMTYPE_DVD) + && opts->sub_id < 0 && reset_spu) + { d_sub->id = -2; d_sub->sh = NULL; } @@ -2513,36 +2511,6 @@ static bool set_property_command(MPContext *mpctx, mp_cmd_t *cmd) return 1; } -#ifdef CONFIG_DVDNAV -static const struct { - const char *name; - const enum mp_command_type cmd; -} mp_dvdnav_bindings[] = { - { "up", MP_CMD_DVDNAV_UP }, - { "down", MP_CMD_DVDNAV_DOWN }, - { "left", MP_CMD_DVDNAV_LEFT }, - { "right", MP_CMD_DVDNAV_RIGHT }, - { "menu", MP_CMD_DVDNAV_MENU }, - { "select", MP_CMD_DVDNAV_SELECT }, - { "prev", MP_CMD_DVDNAV_PREVMENU }, - { "mouse", MP_CMD_DVDNAV_MOUSECLICK }, - - /* - * keep old dvdnav sub-command options for a while in order not to - * break slave-mode API too suddenly. - */ - { "1", MP_CMD_DVDNAV_UP }, - { "2", MP_CMD_DVDNAV_DOWN }, - { "3", MP_CMD_DVDNAV_LEFT }, - { "4", MP_CMD_DVDNAV_RIGHT }, - { "5", MP_CMD_DVDNAV_MENU }, - { "6", MP_CMD_DVDNAV_SELECT }, - { "7", MP_CMD_DVDNAV_PREVMENU }, - { "8", MP_CMD_DVDNAV_MOUSECLICK }, - { NULL, 0 } -}; -#endif - static const char *property_error_string(int error_value) { switch (error_value) { @@ -3392,50 +3360,9 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) pointer_x = cmd->args[0].v.i; pointer_y = cmd->args[1].v.i; rescale_input_coordinates(mpctx, pointer_x, pointer_y, &dx, &dy); -#ifdef CONFIG_DVDNAV - if (mpctx->stream->type == STREAMTYPE_DVDNAV - && dx > 0.0 && dy > 0.0) { - int button = -1; - pointer_x = (int) (dx * (double) sh_video->disp_w); - pointer_y = (int) (dy * (double) sh_video->disp_h); - mp_dvdnav_update_mouse_pos(mpctx->stream, - pointer_x, pointer_y, &button); - if (opts->osd_level > 1 && button > 0) - set_osd_msg(mpctx, OSD_MSG_TEXT, 1, osd_duration, - "Selected button number %d", button); - } -#endif break; } -#ifdef CONFIG_DVDNAV - case MP_CMD_DVDNAV: { - int button = -1; - int i; - enum mp_command_type command = 0; - if (mpctx->stream->type != STREAMTYPE_DVDNAV) - break; - - for (i = 0; mp_dvdnav_bindings[i].name; i++) - if (cmd->args[0].v.s && - !strcasecmp(cmd->args[0].v.s, - mp_dvdnav_bindings[i].name)) - command = mp_dvdnav_bindings[i].cmd; - - mp_dvdnav_handle_input(mpctx->stream, command, &button); - if (opts->osd_level > 1 && button > 0) - set_osd_msg(mpctx, OSD_MSG_TEXT, 1, osd_duration, - "Selected button number %d", button); - break; - } - - case MP_CMD_SWITCH_TITLE: - if (mpctx->stream->type == STREAMTYPE_DVDNAV) - mp_dvdnav_switch_title(mpctx->stream, cmd->args[0].v.i); - break; - -#endif - case MP_CMD_VO_CMDLINE: if (mpctx->video_out) { char *s = cmd->args[0].v.s; @@ -325,10 +325,7 @@ Optional features: --enable-lcms2 enable LCMS2 support [autodetect] --disable-vcd disable VCD support [autodetect] --disable-bluray disable Blu-ray support [autodetect] - --disable-dvdnav disable libdvdnav [autodetect] --disable-dvdread disable libdvdread [autodetect] - --disable-dvdread-internal disable internal libdvdread [autodetect] - --disable-libdvdcss-internal disable internal libdvdcss [autodetect] --disable-cddb disable cddb [autodetect] --disable-sortsub disable subtitle sorting [enabled] --disable-enca disable ENCA charset oracle library [autodetect] @@ -425,7 +422,6 @@ Use these options if autodetection fails: --extra-libs=FLAGS extra linker flags --extra-libs-mplayer=FLAGS extra linker flags for MPlayer - --with-dvdnav-config=PATH path to dvdnav-config --with-dvdread-config=PATH path to dvdread-config This configure script is NOT autoconf-based, even though its output is similar. @@ -482,12 +478,8 @@ _ladspa=auto _libbs2b=auto _vcd=auto _bluray=auto -_dvdnav=auto -_dvdnavconfig=dvdnav-config _dvdreadconfig=dvdread-config _dvdread=auto -_dvdread_internal=auto -_libdvdcss_internal=auto _live=no _nemesi=auto _lcms2=auto @@ -579,10 +571,6 @@ for ac_option do --with-install=*) _install=$(echo $ac_option | cut -d '=' -f 2 ) ;; - - --with-dvdnav-config=*) - _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2) - ;; --with-dvdread-config=*) _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2) ;; @@ -718,12 +706,6 @@ for ac_option do --disable-bluray) _bluray=no ;; --enable-dvdread) _dvdread=yes ;; --disable-dvdread) _dvdread=no ;; - --enable-dvdread-internal) _dvdread_internal=yes ;; - --disable-dvdread-internal) _dvdread_internal=no ;; - --enable-libdvdcss-internal) _libdvdcss_internal=yes ;; - --disable-libdvdcss-internal) _libdvdcss_internal=no ;; - --enable-dvdnav) _dvdnav=yes ;; - --disable-dvdnav) _dvdnav=no ;; --enable-live) _live=yes ;; --disable-live) _live=no ;; --enable-nemesi) _nemesi=yes ;; @@ -2852,44 +2834,15 @@ else fi echores "$_bluray" + echocheck "dvdread" -if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then - _dvdread_internal=no -fi -if test "$_dvdread_internal" = auto ; then - _dvdread_internal=no - _dvdread=no - if (linux || freebsd || netbsd || openbsd || dragonfly) && - (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || - test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) || - darwin || win32; then - _dvdread_internal=yes - _dvdread=yes - extra_cflags="-Ilibdvdread4 $extra_cflags" - fi -elif test "$_dvdread" = auto ; then +if test "$_dvdread" = auto ; then _dvdread=no - if test "$_dl" = yes; then - _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null) - _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null) - if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then - _dvdread=yes - extra_cflags="$extra_cflags $_dvdreadcflags" - extra_ldflags="$extra_ldflags $_dvdreadlibs" - res_comment="external" - fi - fi + pkg_config_add 'dvdread >= 4.2.0' && _dvdread=yes fi - -if test "$_dvdread_internal" = yes; then +if test "$_dvdread" = yes ; then def_dvdread='#define CONFIG_DVDREAD 1' - inputmodules="dvdread(internal) $inputmodules" - res_comment="internal" -elif test "$_dvdread" = yes; then - def_dvdread='#define CONFIG_DVDREAD 1' - extra_ldflags="$extra_ldflags -ldvdread" - inputmodules="dvdread(external) $inputmodules" - res_comment="external" + inputmodules="dvdread $inputmodules" else def_dvdread='#undef CONFIG_DVDREAD' noinputmodules="dvdread $noinputmodules" @@ -2897,32 +2850,6 @@ fi echores "$_dvdread" -echocheck "internal libdvdcss" -if test "$_libdvdcss_internal" = auto ; then - _libdvdcss_internal=no - test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes -fi -if test "$_libdvdcss_internal" = yes ; then - if linux || netbsd || openbsd ; then - def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1' - openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1' - elif freebsd || dragonfly ; then - def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1' - elif darwin ; then - def_dvd_darwin='#define DARWIN_DVD_IOCTL' - extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon" - elif cygwin ; then - cflags_libdvdcss="-DSYS_CYGWIN -DWIN32" - fi - cflags_libdvdcss_dvdread="-Ilibdvdcss" - def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1" - inputmodules="libdvdcss(internal) $inputmodules" -else - noinputmodules="libdvdcss(internal) $noinputmodules" -fi -echores "$_libdvdcss_internal" - - echocheck "libcdio" if test "$_libcdio" = auto ; then _libcdio=no @@ -3575,49 +3502,7 @@ CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -# This must be the last test to be performed. Any other tests following it -# could fail due to linker errors. libdvdnavmini is intentionally not linked -# against libdvdread (to permit MPlayer to use its own copy of the library). -# So any compilation using the flags added here but not linking against -# libdvdread can fail. -echocheck "DVD support (libdvdnav)" -if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then - _dvdnav=no -fi -dvdnav_internal=no -if test "$_dvdnav" = auto ; then - if test "$_dvdread_internal" = yes ; then - _dvdnav=yes - dvdnav_internal=yes - res_comment="internal" - else - $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no - fi -fi -if test "$_dvdnav" = auto ; then - _dvdnav=no - _dvdnavdir=$($_dvdnavconfig --cflags) - _dvdnavlibs=$($_dvdnavconfig --libs) - statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes -fi -if test "$_dvdnav" = yes ; then - def_dvdnav='#define CONFIG_DVDNAV 1' - if test "$dvdnav_internal" = yes ; then - cflags_libdvdnav="-Ilibdvdnav" - inputmodules="dvdnav(internal) $inputmodules" - else - extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)" - extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)" - inputmodules="dvdnav $inputmodules" - fi -else - def_dvdnav='#undef CONFIG_DVDNAV' - noinputmodules="dvdnav $noinputmodules" -fi -echores "$_dvdnav" - # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check). -# Read dvdnav comment above. mak_enable () { list=$(echo $1 | tr '[a-z]' '[A-Z]') @@ -3667,7 +3552,6 @@ DEPFLAGS = $DEPFLAGS CFLAGS_LIBDVDCSS = $cflags_libdvdcss CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread -CFLAGS_LIBDVDNAV = $cflags_libdvdnav EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs EXTRALIBS_MPLAYER = $libs_mplayer @@ -3705,10 +3589,7 @@ DIRECT3D = $_direct3d DIRECTFB = $_directfb DIRECTX = $_directx DVBIN = $_dvbin -DVDNAV = $_dvdnav -DVDNAV_INTERNAL = $dvdnav_internal DVDREAD = $_dvdread -DVDREAD_INTERNAL = $_dvdread_internal DXR3 = $_dxr3 FAAD = $_faad FTP = $_ftp @@ -3731,7 +3612,6 @@ LIBBLURAY = $_bluray LIBBS2B = $_libbs2b LIBDCA = $_libdca LIBDV = $_libdv -LIBDVDCSS_INTERNAL = $_libdvdcss_internal LIBMAD = $_mad LIBNEMESI = $_nemesi LCMS2 = $_lcms2 @@ -3835,8 +3715,6 @@ $def_translation /* libdvdread */ #define STDC_HEADERS 1 #define HAVE_MEMCPY 1 -/* libdvdnav */ -#define READ_CACHE_TRACE 0 /* libdvdread */ #define HAVE_DLFCN_H 1 $def_dvdcss @@ -3916,7 +3794,6 @@ $def_dvd_darwin $def_dvd_linux $def_dvd_openbsd $def_dvdio -$def_dvdnav $def_dvdread $def_vcd diff --git a/etc/input.conf b/etc/input.conf index 91eb098134..a7732acf01 100644 --- a/etc/input.conf +++ b/etc/input.conf @@ -135,20 +135,6 @@ n tv_step_norm u tv_step_chanlist # -# DVDNAV -# Requires dvdnav:// -# - -KP8 {dvdnav} dvdnav up -KP2 {dvdnav} dvdnav down -KP4 {dvdnav} dvdnav left -KP6 {dvdnav} dvdnav right -KP5 {dvdnav} dvdnav menu -KP_ENTER {dvdnav} dvdnav select -MOUSE_BTN0 {dvdnav} dvdnav mouse -KP7 {dvdnav} dvdnav prev - -# # Apple Remote section # diff --git a/input/input.c b/input/input.c index 690321f7fe..98b135c349 100644 --- a/input/input.c +++ b/input/input.c @@ -197,10 +197,6 @@ static const mp_cmd_t mp_cmds[] = { { MP_CMD_RUN, "run", { ARG_STRING } }, { MP_CMD_VF_CHANGE_RECTANGLE, "change_rectangle", { ARG_INT, ARG_INT } }, -#ifdef CONFIG_DVDNAV - { MP_CMD_DVDNAV, "dvdnav", { ARG_STRING } }, -#endif - { MP_CMD_GET_VO_FULLSCREEN, "get_vo_fullscreen", }, { MP_CMD_GET_SUB_VISIBILITY, "get_sub_visibility", }, { MP_CMD_KEYDOWN_EVENTS, "key_down_event", { ARG_INT } }, diff --git a/input/input.h b/input/input.h index 0fccbb5233..04cefab46e 100644 --- a/input/input.h +++ b/input/input.h @@ -44,7 +44,6 @@ enum mp_command_type { MP_CMD_TV_STEP_CHANNEL_LIST, MP_CMD_VO_FULLSCREEN, MP_CMD_SUB_POS, - MP_CMD_DVDNAV, MP_CMD_SCREENSHOT, MP_CMD_PANSCAN, MP_CMD_MUTE, @@ -130,16 +129,6 @@ enum mp_command_type { MP_CMD_SWITCH_TITLE, MP_CMD_STOP, - /// DVDNAV commands - MP_CMD_DVDNAV_UP = 1000, - MP_CMD_DVDNAV_DOWN, - MP_CMD_DVDNAV_LEFT, - MP_CMD_DVDNAV_RIGHT, - MP_CMD_DVDNAV_MENU, - MP_CMD_DVDNAV_SELECT, - MP_CMD_DVDNAV_PREVMENU, - MP_CMD_DVDNAV_MOUSECLICK, - /// DVB commands MP_CMD_DVB_SET_CHANNEL = 5101, diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 078699fad7..51d7a45cb4 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -1145,7 +1145,7 @@ int demux_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, * (nothing actually implements DEMUXER_CTRL_RESYNC now). */ struct stream *stream = demuxer->stream; - if (stream->type == STREAMTYPE_DVD || stream->type == STREAMTYPE_DVDNAV) { + if (stream->type == STREAMTYPE_DVD) { double pts; if (flags & SEEK_ABSOLUTE) @@ -214,12 +214,6 @@ typedef struct MPContext { struct screenshot_ctx *screenshot_ctx; -#ifdef CONFIG_DVDNAV - struct mp_image *nav_smpi; ///< last decoded dvdnav video image - unsigned char *nav_buffer; ///< last read dvdnav video frame - unsigned char *nav_start; ///< pointer to last read video buffer - int nav_in_size; ///< last read size -#endif } MPContext; @@ -146,7 +146,6 @@ static int max_framesize = 0; #ifdef CONFIG_DVDREAD #include "stream/stream_dvd.h" #endif -#include "stream/stream_dvdnav.h" #include "libmpcodecs/dec_audio.h" #include "libmpcodecs/dec_video.h" @@ -526,19 +525,6 @@ static void print_file_properties(struct MPContext *mpctx, const char *filename) /// step size of mixer changes int volstep = 3; -#ifdef CONFIG_DVDNAV -static void mp_dvdnav_context_free(MPContext *ctx) -{ - if (ctx->nav_smpi) - free_mp_image(ctx->nav_smpi); - ctx->nav_smpi = NULL; - free(ctx->nav_buffer); - ctx->nav_buffer = NULL; - ctx->nav_start = NULL; - ctx->nav_in_size = 0; -} -#endif - static void uninit_subs(struct demuxer *demuxer) { for (int i = 0; i < MAX_S_STREAMS; i++) { @@ -615,9 +601,6 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask) mpctx->initialized_flags &= ~INITIALIZED_VO; vo_destroy(mpctx->video_out); mpctx->video_out = NULL; -#ifdef CONFIG_DVDNAV - mp_dvdnav_context_free(mpctx); -#endif } // Must be after libvo uninit, as few vo drivers (svgalib) have tty code. @@ -953,13 +936,6 @@ void init_vo_spudec(struct MPContext *mpctx) } #endif -#ifdef CONFIG_DVDNAV - if (vo_spudec == NULL && mpctx->stream->type == STREAMTYPE_DVDNAV) { - unsigned int *palette = mp_dvdnav_get_spu_clut(mpctx->stream); - vo_spudec = spudec_new_scaled(palette, width, height, NULL, 0); - } -#endif - if (vo_spudec == NULL) { sh_sub_t *sh = mpctx->d_sub->sh; vo_spudec = spudec_new_scaled(NULL, width, height, sh->extradata, @@ -1854,149 +1830,6 @@ static int select_subtitle(MPContext *mpctx) return found; } -#ifdef CONFIG_DVDNAV -#ifndef FF_B_TYPE -#define FF_B_TYPE 3 -#endif -/// store decoded video image -static mp_image_t *mp_dvdnav_copy_mpi(mp_image_t *to_mpi, - mp_image_t *from_mpi) -{ - mp_image_t *mpi; - - /// Do not store B-frames - if (from_mpi->pict_type == FF_B_TYPE) - return to_mpi; - - if (to_mpi && - to_mpi->w == from_mpi->w && - to_mpi->h == from_mpi->h && - to_mpi->imgfmt == from_mpi->imgfmt) - mpi = to_mpi; - else { - if (to_mpi) - free_mp_image(to_mpi); - if (from_mpi->w == 0 || from_mpi->h == 0) - return NULL; - mpi = alloc_mpi(from_mpi->w, from_mpi->h, from_mpi->imgfmt); - } - - copy_mpi(mpi, from_mpi); - return mpi; -} - -static void mp_dvdnav_reset_stream(MPContext *ctx) -{ - struct MPOpts *opts = &ctx->opts; - if (ctx->sh_video) { - /// clear video pts - ctx->d_video->pts = 0.0f; - ctx->sh_video->pts = 0.0f; - ctx->sh_video->i_pts = 0.0f; - ctx->sh_video->last_pts = 0.0f; - ctx->sh_video->num_buffered_pts = 0; - ctx->sh_video->num_frames = 0; - ctx->sh_video->num_frames_decoded = 0; - ctx->sh_video->timer = 0.0f; - ctx->sh_video->stream_delay = 0.0f; - ctx->sh_video->timer = 0; - ctx->demuxer->stream_pts = MP_NOPTS_VALUE; - } - - if (ctx->sh_audio) { - /// free audio packets and reset - ds_free_packs(ctx->d_audio); - audio_delay -= ctx->sh_audio->stream_delay; - ctx->delay = -audio_delay; - ao_reset(ctx->ao); - resync_audio_stream(ctx->sh_audio); - } - - audio_delay = 0.0f; - ctx->sub_counts[SUB_SOURCE_DEMUX] = mp_dvdnav_number_of_subs(ctx->stream); - if (opts->sub_lang && opts->sub_id == dvdsub_lang_id) { - dvdsub_lang_id = mp_dvdnav_sid_from_lang(ctx->stream, opts->sub_lang); - if (dvdsub_lang_id != opts->sub_id) { - opts->sub_id = dvdsub_lang_id; - select_subtitle(ctx); - } - } - - /// clear all EOF related flags - ctx->d_video->eof = ctx->d_audio->eof = ctx->stream->eof = 0; -} - -/// Restore last decoded DVDNAV (still frame) -static mp_image_t *mp_dvdnav_restore_smpi(struct MPContext *mpctx, - int *in_size, - unsigned char **start, - mp_image_t *decoded_frame) -{ - if (mpctx->stream->type != STREAMTYPE_DVDNAV) - return decoded_frame; - - /// a change occurred in dvdnav stream - if (mp_dvdnav_cell_has_changed(mpctx->stream, 0)) { - mp_dvdnav_read_wait(mpctx->stream, 1, 1); - mp_dvdnav_context_free(mpctx); - mp_dvdnav_reset_stream(mpctx); - mp_dvdnav_read_wait(mpctx->stream, 0, 1); - mp_dvdnav_cell_has_changed(mpctx->stream, 1); - } - - if (*in_size < 0) { - float len; - - /// Display still frame, if any - if (mpctx->nav_smpi && !mpctx->nav_buffer) - decoded_frame = mpctx->nav_smpi; - - /// increment video frame : continue playing after still frame - len = get_time_length(mpctx); - if (mpctx->sh_video->pts >= len && - mpctx->sh_video->pts > 0.0 && len > 0.0) { - mp_dvdnav_skip_still(mpctx->stream); - mp_dvdnav_skip_wait(mpctx->stream); - } - mpctx->sh_video->pts += 1 / mpctx->sh_video->fps; - - if (mpctx->nav_buffer) { - *start = mpctx->nav_start; - *in_size = mpctx->nav_in_size; - if (mpctx->nav_start) - memcpy(*start, mpctx->nav_buffer, mpctx->nav_in_size); - } - } - - return decoded_frame; -} - -/// Save last decoded DVDNAV (still frame) -static void mp_dvdnav_save_smpi(struct MPContext *mpctx, int in_size, - unsigned char *start, - mp_image_t *decoded_frame) -{ - if (mpctx->stream->type != STREAMTYPE_DVDNAV) - return; - - free(mpctx->nav_buffer); - mpctx->nav_buffer = NULL; - mpctx->nav_start = NULL; - mpctx->nav_in_size = -1; - - if (in_size > 0) - mpctx->nav_buffer = malloc(in_size); - if (mpctx->nav_buffer) { - mpctx->nav_start = start; - mpctx->nav_in_size = in_size; - memcpy(mpctx->nav_buffer, start, in_size); - } - - if (decoded_frame && mpctx->nav_smpi != decoded_frame) - mpctx->nav_smpi = mp_dvdnav_copy_mpi(mpctx->nav_smpi, decoded_frame); -} -#endif /* CONFIG_DVDNAV */ - /* Modify video timing to match the audio timeline. There are two main * reasons this is needed. First, video and audio can start from different * positions at beginning of file or after a seek (MPlayer starts both @@ -2365,20 +2198,8 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx) while (!in_size) in_size = video_read_frame(sh_video, &sh_video->next_frame_time, &packet, force_fps); - if (in_size < 0) { -#ifdef CONFIG_DVDNAV - if (mpctx->stream->type == STREAMTYPE_DVDNAV) { - if (mp_dvdnav_is_eof(mpctx->stream)) - return -1; - if (mpctx->d_video) - mpctx->d_video->eof = 0; - if (mpctx->d_audio) - mpctx->d_audio->eof = 0; - mpctx->stream->eof = 0; - } else -#endif + if (in_size < 0) return -1; - } if (in_size > max_framesize) max_framesize = in_size; sh_video->timer += frame_time; @@ -2389,16 +2210,8 @@ static double update_video_nocorrect_pts(struct MPContext *mpctx) int framedrop_type = check_framedrop(mpctx, frame_time); void *decoded_frame; -#ifdef CONFIG_DVDNAV - decoded_frame = mp_dvdnav_restore_smpi(mpctx, &in_size, &packet, NULL); - if (in_size >= 0 && !decoded_frame) -#endif decoded_frame = decode_video(sh_video, sh_video->ds->current, packet, in_size, framedrop_type, sh_video->pts); -#ifdef CONFIG_DVDNAV - // Save last still frame for future display - mp_dvdnav_save_smpi(mpctx, in_size, packet, decoded_frame); -#endif if (decoded_frame) { filter_video(sh_video, decoded_frame, sh_video->pts); } @@ -3195,30 +3008,6 @@ static void run_playloop(struct MPContext *mpctx) break; } // video -#ifdef CONFIG_DVDNAV - if (mpctx->stream->type == STREAMTYPE_DVDNAV) { - nav_highlight_t hl; - mp_dvdnav_get_highlight(mpctx->stream, &hl); - if (!vo_spudec || !spudec_apply_palette_crop(vo_spudec, hl.palette, hl.sx, hl.sy, hl.ex, hl.ey)) { - osd_set_nav_box(hl.sx, hl.sy, hl.ex, hl.ey); - vo_osd_changed(OSDTYPE_DVDNAV); - } else { - osd_set_nav_box(0, 0, 0, 0); - vo_osd_changed(OSDTYPE_DVDNAV); - vo_osd_changed(OSDTYPE_SPU); - } - - if (mp_dvdnav_stream_has_changed(mpctx->stream)) { - double ar = -1.0; - if (mpctx->sh_video && - stream_control(mpctx->demuxer->stream, - STREAM_CTRL_GET_ASPECT_RATIO, &ar) - != STREAM_UNSUPPORTED) - mpctx->sh_video->stream_aspect = ar; - } - } -#endif - if (mpctx->sh_audio && (mpctx->restart_playback ? !video_left : mpctx->ao->untimed && (mpctx->delay <= 0 || |