[vlc-devel] [PATCH 1/6] rename mtime_t to vlc_tick_t

Steve Lhomme robux4 at ycbcr.xyz
Wed Jun 20 08:54:31 CEST 2018


Keep a copy of vlc_tick_tfor backward compatibility.
---
 extras/analyser/vlc.vim                       |   2 +-
 include/vlc_aout.h                            |  10 +-
 include/vlc_block.h                           |  14 +--
 include/vlc_codec.h                           |   4 +-
 include/vlc_common.h                          |   3 +-
 include/vlc_demux.h                           |   2 +-
 include/vlc_es_out.h                          |  14 +--
 include/vlc_events.h                          |   2 +-
 include/vlc_filter.h                          |   4 +-
 include/vlc_input.h                           |  10 +-
 include/vlc_input_item.h                      |   8 +-
 include/vlc_interrupt.h                       |   4 +-
 include/vlc_media_library.h                   |   2 +-
 include/vlc_mtime.h                           |  10 +-
 include/vlc_picture.h                         |   2 +-
 include/vlc_picture_fifo.h                    |   4 +-
 include/vlc_playlist.h                        |   2 +-
 include/vlc_sout.h                            |   4 +-
 include/vlc_spu.h                             |   2 +-
 include/vlc_subpicture.h                      |  10 +-
 include/vlc_threads.h                         |  18 +--
 include/vlc_vout.h                            |   2 +-
 include/vlc_vout_display.h                    |   2 +-
 include/vlc_vout_osd.h                        |   2 +-
 include/vlc_vout_wrapper.h                    |   2 +-
 lib/libvlc_internal.h                         |   4 +-
 modules/access/alsa.c                         |   6 +-
 modules/access/avcapture.m                    |  18 +--
 modules/access/bluray.c                       |   6 +-
 modules/access/cdda.c                         |  10 +-
 modules/access/dcp/dcp.cpp                    |   4 +-
 modules/access/dshow/access.h                 |   2 +-
 modules/access/dshow/filter.cpp               |   2 +-
 modules/access/dshow/filter.h                 |   2 +-
 modules/access/dtv/bdagraph.cpp               |   2 +-
 modules/access/dtv/en50221.c                  |   6 +-
 modules/access/dvb/access.c                   |   6 +-
 modules/access/dvb/scan.c                     |   4 +-
 modules/access/dvdnav.c                       |   4 +-
 modules/access/dvdread.c                      |  20 +--
 modules/access/idummy.c                       |  18 +--
 modules/access/imem.c                         |   6 +-
 modules/access/linsys/linsys_hdsdi.c          |   4 +-
 modules/access/linsys/linsys_sdi.c            |   6 +-
 modules/access/live555.cpp                    |   6 +-
 modules/access/oss.c                          |   6 +-
 modules/access/pulse.c                        |   4 +-
 modules/access/qtsound.m                      |  10 +-
 modules/access/rdp.c                          |   4 +-
 modules/access/rtp/input.c                    |   6 +-
 modules/access/rtp/rtp.h                      |   4 +-
 modules/access/rtp/session.c                  |  12 +-
 modules/access/satip.c                        |   4 +-
 modules/access/screen/screen.h                |   4 +-
 modules/access/screen/wayland.c               |   2 +-
 modules/access/screen/xcb.c                   |   2 +-
 modules/access/shm.c                          |   2 +-
 modules/access/timecode.c                     |   6 +-
 modules/access/v4l2/demux.c                   |   2 +-
 modules/access/v4l2/radio.c                   |   2 +-
 modules/access/v4l2/v4l2.h                    |   2 +-
 modules/access/v4l2/video.c                   |   4 +-
 modules/access/vnc.c                          |   4 +-
 modules/access/wasapi.c                       |   8 +-
 modules/access_output/livehttp.c              |  10 +-
 modules/access_output/udp.c                   |  12 +-
 modules/audio_filter/audiobargraph_a.c        |   4 +-
 .../channel_mixer/spatialaudio.cpp            |   6 +-
 modules/audio_filter/resampler/soxr.c         |   4 +-
 modules/audio_output/adummy.c                 |   4 +-
 modules/audio_output/alsa.c                   |  16 +--
 modules/audio_output/amem.c                   |   4 +-
 modules/audio_output/audiotrack.c             |  42 +++----
 modules/audio_output/audiounit_ios.m          |   4 +-
 modules/audio_output/auhal.c                  |   8 +-
 modules/audio_output/coreaudio_common.c       |  16 +--
 modules/audio_output/coreaudio_common.h       |  12 +-
 modules/audio_output/directsound.c            |  10 +-
 modules/audio_output/file.c                   |   8 +-
 modules/audio_output/jack.c                   |  16 +--
 modules/audio_output/kai.c                    |  12 +-
 modules/audio_output/mmdevice.c               |   6 +-
 modules/audio_output/mmdevice.h               |   6 +-
 modules/audio_output/opensles_android.c       |   8 +-
 modules/audio_output/oss.c                    |  12 +-
 modules/audio_output/pulse.c                  |  18 +--
 modules/audio_output/sndio.c                  |  10 +-
 modules/audio_output/tizen_audio.c            |   4 +-
 modules/audio_output/vlcpulse.c               |   2 +-
 modules/audio_output/vlcpulse.h               |   2 +-
 modules/audio_output/wasapi.c                 |   2 +-
 modules/audio_output/waveout.c                |  16 +--
 modules/audio_output/winstore.c               |   6 +-
 modules/codec/aom.c                           |   4 +-
 modules/codec/arib/substext.h                 |   4 +-
 modules/codec/avcodec/encoder.c               |  12 +-
 modules/codec/avcodec/subtitle.c              |   4 +-
 modules/codec/avcodec/video.c                 |  10 +-
 modules/codec/cc.c                            |  10 +-
 modules/codec/cea708.c                        |  12 +-
 modules/codec/cea708.h                        |   6 +-
 modules/codec/cvdsub.c                        |   2 +-
 modules/codec/daala.c                         |   2 +-
 modules/codec/dmo/dmo.c                       |   2 +-
 modules/codec/dvbsub.c                        |   8 +-
 modules/codec/faad.c                          |   2 +-
 modules/codec/fdkaac.c                        |  22 ++--
 modules/codec/flac.c                          |   8 +-
 modules/codec/kate.c                          |  10 +-
 modules/codec/libass.c                        |  14 +--
 modules/codec/libmpeg2.c                      |  16 +--
 modules/codec/lpcm.c                          |   4 +-
 modules/codec/mpg123.c                        |   2 +-
 modules/codec/oggspots.c                      |   2 +-
 modules/codec/omxil/mediacodec.c              |   6 +-
 modules/codec/omxil/mediacodec.h              |   8 +-
 modules/codec/omxil/mediacodec_jni.c          |   6 +-
 modules/codec/omxil/mediacodec_ndk.c          |   6 +-
 modules/codec/omxil/omxil_utils.h             |   2 +-
 modules/codec/omxil/utils.c                   |   4 +-
 modules/codec/opus.c                          |  16 +--
 modules/codec/qsv.c                           |   8 +-
 modules/codec/schroedinger.c                  |  14 +--
 modules/codec/scte27.c                        |   4 +-
 modules/codec/shine.c                         |   4 +-
 modules/codec/speex.c                         |  10 +-
 modules/codec/spudec/parse.c                  |  10 +-
 modules/codec/spudec/spudec.h                 |   2 +-
 modules/codec/substext.h                      |   6 +-
 modules/codec/svcdsub.c                       |   2 +-
 modules/codec/synchro.c                       |  24 ++--
 modules/codec/synchro.h                       |   4 +-
 modules/codec/telx.c                          |   2 +-
 modules/codec/theora.c                        |   2 +-
 modules/codec/ttml/imageupdater.h             |   4 +-
 modules/codec/ttml/ttml.h                     |   8 +-
 modules/codec/twolame.c                       |  10 +-
 modules/codec/videotoolbox.m                  |   2 +-
 modules/codec/vorbis.c                        |   8 +-
 modules/codec/vpx.c                           |   4 +-
 modules/codec/webvtt/subsvtt.c                |  50 ++++----
 modules/codec/webvtt/webvtt.c                 |   6 +-
 modules/codec/webvtt/webvtt.h                 |   6 +-
 modules/codec/x264.c                          |   2 +-
 modules/codec/x265.c                          |   8 +-
 modules/codec/zvbi.c                          |   4 +-
 modules/control/dbus/dbus.c                   |  16 +--
 modules/control/dbus/dbus_common.h            |   4 +-
 modules/control/dbus/dbus_player.c            |   2 +-
 modules/control/hotkeys.c                     |  10 +-
 modules/control/netsync.c                     |  24 ++--
 modules/demux/adaptive/PlaylistManager.cpp    |  52 ++++----
 modules/demux/adaptive/PlaylistManager.h      |  26 ++--
 modules/demux/adaptive/SegmentTracker.cpp     |  14 +--
 modules/demux/adaptive/SegmentTracker.hpp     |  20 +--
 modules/demux/adaptive/Streams.cpp            |  36 +++---
 modules/demux/adaptive/Streams.hpp            |  22 ++--
 modules/demux/adaptive/Time.hpp               |   8 +-
 modules/demux/adaptive/http/Chunk.cpp         |   4 +-
 modules/demux/adaptive/http/Chunk.h           |   2 +-
 .../adaptive/http/HTTPConnectionManager.cpp   |   2 +-
 .../adaptive/http/HTTPConnectionManager.h     |   2 +-
 .../logic/AbstractAdaptationLogic.cpp         |   2 +-
 .../adaptive/logic/AbstractAdaptationLogic.h  |   2 +-
 .../adaptive/logic/IDownloadRateObserver.h    |   2 +-
 .../logic/NearOptimalAdaptationLogic.cpp      |   4 +-
 .../logic/NearOptimalAdaptationLogic.hpp      |  12 +-
 .../logic/PredictiveAdaptationLogic.cpp       |   2 +-
 .../logic/PredictiveAdaptationLogic.hpp       |   8 +-
 .../logic/RateBasedAdaptationLogic.cpp        |   2 +-
 .../adaptive/logic/RateBasedAdaptationLogic.h |   4 +-
 .../adaptive/playlist/AbstractPlaylist.cpp    |  12 +-
 .../adaptive/playlist/AbstractPlaylist.hpp    |  22 ++--
 .../demux/adaptive/playlist/BasePeriod.cpp    |   2 +-
 modules/demux/adaptive/playlist/BasePeriod.h  |   6 +-
 .../adaptive/playlist/BaseRepresentation.cpp  |   8 +-
 .../adaptive/playlist/BaseRepresentation.h    |   6 +-
 .../adaptive/playlist/SegmentInformation.cpp  |  16 +--
 .../adaptive/playlist/SegmentInformation.hpp  |  14 +--
 .../demux/adaptive/playlist/SegmentList.cpp   |   4 +-
 modules/demux/adaptive/playlist/SegmentList.h |   4 +-
 .../adaptive/playlist/SegmentTemplate.cpp     |   4 +-
 .../demux/adaptive/playlist/SegmentTemplate.h |   4 +-
 .../adaptive/playlist/SegmentTimeline.cpp     |   8 +-
 .../demux/adaptive/playlist/SegmentTimeline.h |   8 +-
 .../demux/adaptive/plumbing/CommandsQueue.cpp |  32 ++---
 .../demux/adaptive/plumbing/CommandsQueue.hpp |  26 ++--
 modules/demux/adaptive/plumbing/Demuxer.cpp   |   8 +-
 modules/demux/adaptive/plumbing/Demuxer.hpp   |  10 +-
 modules/demux/adaptive/plumbing/FakeESOut.cpp |  14 +--
 modules/demux/adaptive/plumbing/FakeESOut.hpp |  12 +-
 modules/demux/adaptive/tools/Conversions.cpp  |   2 +-
 modules/demux/adaptive/tools/Conversions.hpp  |   4 +-
 modules/demux/aiff.c                          |   2 +-
 modules/demux/asf/asf.c                       |  30 ++---
 modules/demux/asf/asfpacket.c                 |  16 +--
 modules/demux/asf/asfpacket.h                 |   6 +-
 modules/demux/au.c                            |   8 +-
 modules/demux/avformat/demux.c                |  10 +-
 modules/demux/avformat/mux.c                  |   2 +-
 modules/demux/avi/avi.c                       |  66 +++++-----
 modules/demux/caf.c                           |   2 +-
 modules/demux/cdg.c                           |   4 +-
 modules/demux/dash/DASHManager.cpp            |  10 +-
 modules/demux/dash/mpd/IsoffMainParser.cpp    |   2 +-
 modules/demux/dash/mpd/Representation.cpp     |   4 +-
 modules/demux/dash/mpd/Representation.h       |   2 +-
 modules/demux/flac.c                          |  12 +-
 modules/demux/hls/HLSManager.cpp              |   2 +-
 modules/demux/hls/HLSManager.hpp              |   2 +-
 modules/demux/hls/HLSStreams.cpp              |   4 +-
 modules/demux/hls/HLSStreams.hpp              |   2 +-
 modules/demux/hls/playlist/HLSSegment.cpp     |   2 +-
 modules/demux/hls/playlist/HLSSegment.hpp     |   4 +-
 modules/demux/hls/playlist/Parser.cpp         |   8 +-
 modules/demux/hls/playlist/Representation.cpp |   8 +-
 modules/demux/hls/playlist/Representation.hpp |   2 +-
 modules/demux/image.c                         |  14 +--
 modules/demux/mjpeg.c                         |   6 +-
 modules/demux/mkv/demux.cpp                   |   2 +-
 modules/demux/mkv/demux.hpp                   |  10 +-
 modules/demux/mkv/matroska_segment.cpp        |   8 +-
 modules/demux/mkv/matroska_segment.hpp        |   6 +-
 modules/demux/mkv/matroska_segment_parse.cpp  |   4 +-
 modules/demux/mkv/matroska_segment_seeker.cpp |  22 ++--
 modules/demux/mkv/matroska_segment_seeker.hpp |  24 ++--
 modules/demux/mkv/mkv.cpp                     |  16 +--
 modules/demux/mkv/mkv.hpp                     |   8 +-
 modules/demux/mkv/util.cpp                    |   4 +-
 modules/demux/mkv/util.hpp                    |   4 +-
 modules/demux/mkv/virtual_segment.cpp         |   6 +-
 modules/demux/mkv/virtual_segment.hpp         |  10 +-
 modules/demux/mp4/heif.c                      |   6 +-
 modules/demux/mp4/mp4.c                       |  70 +++++------
 modules/demux/mp4/mp4.h                       |   4 +-
 modules/demux/mpeg/es.c                       |  12 +-
 modules/demux/mpeg/h26x.c                     |   4 +-
 modules/demux/mpeg/mpeg4_iod.c                |   2 +-
 modules/demux/mpeg/mpeg4_iod.h                |   4 +-
 modules/demux/mpeg/ps.c                       |   4 +-
 modules/demux/mpeg/ps.h                       |   8 +-
 modules/demux/mpeg/ts.c                       |   4 +-
 modules/demux/mpeg/ts_scte.c                  |   4 +-
 modules/demux/ogg.c                           |  30 ++---
 modules/demux/ogg.h                           |  10 +-
 modules/demux/ogg_granule.c                   |   4 +-
 modules/demux/ogg_granule.h                   |   4 +-
 modules/demux/oggseek.c                       |  12 +-
 modules/demux/oggseek.h                       |   8 +-
 modules/demux/playlist/asx.c                  |   8 +-
 modules/demux/playlist/itml.c                 |   2 +-
 modules/demux/playlist/itml.h                 |   2 +-
 modules/demux/playlist/m3u.c                  |   2 +-
 modules/demux/playlist/podcast.c              |   8 +-
 modules/demux/playlist/ram.c                  |   2 +-
 modules/demux/playlist/sgimb.c                |   4 +-
 modules/demux/pva.c                           |  24 ++--
 modules/demux/rawdv.c                         |   2 +-
 modules/demux/rawvid.c                        |   2 +-
 modules/demux/real.c                          |  28 ++---
 modules/demux/smf.c                           |   6 +-
 modules/demux/smooth/SmoothManager.cpp        |   8 +-
 modules/demux/stl.c                           |  12 +-
 modules/demux/subtitle.c                      |   8 +-
 modules/demux/ttml.c                          |   8 +-
 modules/demux/ty.c                            |  24 ++--
 modules/demux/vc1.c                           |   2 +-
 modules/demux/vobsub.c                        |  10 +-
 modules/demux/webvtt.c                        |  16 +--
 .../gui/macosx/VLCBookmarksWindowController.m |   2 +-
 modules/gui/macosx/VLCControlsBarCommon.m     |   2 +-
 modules/gui/macosx/VLCCoreInteraction.h       |   2 +-
 modules/gui/macosx/VLCCoreInteraction.m       |   8 +-
 modules/gui/macosx/VLCFSPanelController.m     |   4 +-
 modules/gui/macosx/VLCInputManager.m          |   6 +-
 modules/gui/macosx/VLCMainWindow.m            |   2 +-
 modules/gui/macosx/VLCPLModel.m               |   2 +-
 modules/gui/macosx/VLCStatusBarIcon.m         |   2 +-
 modules/gui/macosx/VLCStringUtility.m         |   4 +-
 modules/gui/qt/adapters/chromaprint.cpp       |   2 +-
 .../gui/qt/components/playlist/selector.cpp   |   2 +-
 modules/gui/qt/dialogs/bookmarks.cpp          |   2 +-
 modules/gui/qt/input_manager.cpp              |   4 +-
 modules/gui/qt/input_manager.hpp              |   2 +-
 modules/gui/qt/styles/seekstyle.cpp           |   2 +-
 modules/gui/skins2/os2/os2_timer.hpp          |   2 +-
 modules/gui/skins2/vars/time.cpp              |   6 +-
 modules/gui/skins2/x11/x11_loop.cpp           |   2 +-
 modules/gui/skins2/x11/x11_loop.hpp           |   2 +-
 modules/gui/skins2/x11/x11_timer.cpp          |  10 +-
 modules/gui/skins2/x11/x11_timer.hpp          |   6 +-
 modules/hw/mmal/vout.c                        |   2 +-
 modules/hw/vaapi/filters.c                    |   4 +-
 modules/hw/vdpau/chroma.c                     |   2 +-
 modules/hw/vdpau/deinterlace.c                |   4 +-
 modules/hw/vdpau/display.c                    |   6 +-
 modules/lua/libs/input.c                      |   2 +-
 modules/lua/libs/osd.c                        |   2 +-
 modules/lua/vlc.c                             |   4 +-
 modules/misc/audioscrobbler.c                 |  10 +-
 modules/misc/inhibit/xdg.c                    |   2 +-
 modules/misc/playlist/html.c                  |   2 +-
 modules/misc/playlist/m3u.c                   |   2 +-
 modules/misc/playlist/xspf.c                  |   2 +-
 modules/misc/rtsp.c                           |   2 +-
 modules/misc/stats.c                          |  14 +--
 modules/mux/asf.c                             |  10 +-
 modules/mux/avi.c                             |   2 +-
 modules/mux/mp4/libmp4mux.c                   |  18 +--
 modules/mux/mp4/libmp4mux.h                   |  18 +--
 modules/mux/mp4/mp4.c                         |  40 +++---
 modules/mux/mpeg/pes.c                        |  10 +-
 modules/mux/mpeg/pes.h                        |   2 +-
 modules/mux/mpeg/ps.c                         |  24 ++--
 modules/mux/mpeg/ts.c                         |  44 +++----
 modules/mux/ogg.c                             |  28 ++---
 modules/packetizer/a52.c                      |   2 +-
 modules/packetizer/dts.c                      |   2 +-
 modules/packetizer/flac.h                     |   2 +-
 modules/packetizer/h264.c                     |  10 +-
 modules/packetizer/hevc.c                     |   6 +-
 modules/packetizer/hxxx_common.c              |   4 +-
 modules/packetizer/mjpeg.c                    |   2 +-
 modules/packetizer/mlp.c                      |   2 +-
 modules/packetizer/mpeg4audio.c               |   4 +-
 modules/packetizer/mpeg4video.c               |  10 +-
 modules/packetizer/mpegaudio.c                |   2 +-
 modules/packetizer/mpegvideo.c                |  12 +-
 modules/packetizer/vc1.c                      |  10 +-
 modules/services_discovery/microdns.c         |   4 +-
 modules/services_discovery/sap.c              |  12 +-
 modules/services_discovery/upnp.cpp           |   2 +-
 modules/spu/audiobargraph_v.c                 |   4 +-
 modules/spu/dynamicoverlay/dynamicoverlay.c   |   4 +-
 modules/spu/logo.c                            |  10 +-
 modules/spu/marq.c                            |   8 +-
 modules/spu/mosaic.c                          |   6 +-
 modules/spu/remoteosd.c                       |   6 +-
 modules/spu/rss.c                             |  12 +-
 modules/spu/subsdelay.c                       |  24 ++--
 modules/stream_filter/cache_block.c           |   8 +-
 modules/stream_filter/cache_read.c            |  10 +-
 modules/stream_filter/hds/hds.c               |   2 +-
 modules/stream_out/autodel.c                  |   4 +-
 modules/stream_out/bridge.c                   |  16 +--
 modules/stream_out/chromecast/cast.cpp        |   4 +-
 modules/stream_out/chromecast/chromecast.h    |  24 ++--
 .../stream_out/chromecast/chromecast_common.h |   4 +-
 .../stream_out/chromecast/chromecast_ctrl.cpp |  24 ++--
 .../chromecast/chromecast_demux.cpp           |  28 ++---
 modules/stream_out/cycle.c                    |  18 +--
 modules/stream_out/delay.c                    |   2 +-
 modules/stream_out/description.c              |   2 +-
 modules/stream_out/display.c                  |   2 +-
 modules/stream_out/record.c                   |  10 +-
 modules/stream_out/rtp.c                      |  26 ++--
 modules/stream_out/rtp.h                      |  12 +-
 modules/stream_out/rtpfmt.c                   |  16 +--
 modules/stream_out/rtsp.c                     |   8 +-
 modules/stream_out/smem.c                     |  16 +--
 modules/stream_out/stats.c                    |   4 +-
 modules/stream_out/transcode/audio.c          |   4 +-
 modules/stream_out/transcode/transcode.h      |   2 +-
 modules/stream_out/vod.c                      |   2 +-
 .../text_renderer/freetype/fonts/fontconfig.c |   2 +-
 modules/video_filter/blendbench.c             |   2 +-
 modules/video_filter/deinterlace/algo_ivtc.c  |   4 +-
 modules/video_filter/deinterlace/common.c     |   8 +-
 modules/video_filter/deinterlace/common.h     |   4 +-
 modules/video_filter/fps.c                    |   2 +-
 modules/video_filter/grain.c                  |   4 +-
 modules/video_filter/magnify.c                |   2 +-
 modules/video_filter/oldmovie.c               |  26 ++--
 modules/video_filter/ripple.c                 |   4 +-
 modules/video_filter/vhs.c                    |  16 +--
 modules/video_filter/wave.c                   |   4 +-
 modules/video_output/android/display.c        |   6 +-
 modules/video_output/android/display.h        |   4 +-
 modules/video_output/caca.c                   |   6 +-
 modules/video_output/caopengllayer.m          |   4 +-
 modules/video_output/decklink.cpp             |  10 +-
 modules/video_output/ios.m                    |   4 +-
 modules/video_output/macosx.m                 |   4 +-
 modules/video_output/opengl/display.c         |   4 +-
 modules/video_output/vdummy.c                 |   6 +-
 modules/video_output/vmem.c                   |   4 +-
 modules/video_output/wayland/input.c          |  16 +--
 modules/video_output/wayland/shm.c            |   2 +-
 modules/video_output/win32/direct3d11.c       |   4 +-
 modules/video_output/win32/direct3d9.c        |   4 +-
 modules/video_output/win32/events.c           |   2 +-
 modules/video_output/win32/glwin32.c          |   4 +-
 modules/video_output/xcb/window.c             |   6 +-
 modules/visualization/cyclic_buffer.h         |   4 +-
 modules/visualization/projectm.cpp            |   2 +-
 src/android/thread.c                          |   2 +-
 src/audio_output/aout_internal.h              |   6 +-
 src/audio_output/dec.c                        |   8 +-
 src/clock/clock_internal.c                    |   8 +-
 src/clock/clock_internal.h                    |  12 +-
 src/clock/input_clock.c                       |  76 ++++++------
 src/clock/input_clock.h                       |  20 +--
 src/darwin/thread.c                           |  12 +-
 src/input/control.c                           |   6 +-
 src/input/decoder.c                           |  46 +++----
 src/input/decoder.h                           |   6 +-
 src/input/demux_chained.c                     |   2 +-
 src/input/es_out.c                            | 116 +++++++++---------
 src/input/es_out.h                            |  20 +--
 src/input/es_out_timeshift.c                  |  58 ++++-----
 src/input/event.c                             |   8 +-
 src/input/event.h                             |   8 +-
 src/input/input.c                             |  42 +++----
 src/input/input_internal.h                    |  10 +-
 src/input/item.c                              |   8 +-
 src/input/stats.c                             |   2 +-
 src/linux/thread.c                            |   2 +-
 src/misc/background_worker.c                  |   4 +-
 src/misc/background_worker.h                  |   2 +-
 src/misc/fifo.c                               |   2 +-
 src/misc/filter_chain.c                       |   2 +-
 src/misc/interrupt.c                          |   2 +-
 src/misc/mtime.c                              |   8 +-
 src/misc/picture_fifo.c                       |   4 +-
 src/misc/subpicture.c                         |   2 +-
 src/misc/threads.c                            |  10 +-
 src/missing.c                                 |   2 +-
 src/network/httpd.c                           |  10 +-
 src/network/tcp.c                             |   6 +-
 src/network/tls.c                             |   4 +-
 src/os2/thread.c                              |  16 +--
 src/playlist/item.c                           |   4 +-
 src/playlist/sort.c                           |   4 +-
 src/posix/thread.c                            |  10 +-
 src/posix/timer.c                             |   8 +-
 src/stream_output/sap.c                       |   2 +-
 src/stream_output/stream_output.c             |   8 +-
 src/test/timer.c                              |   2 +-
 src/text/strings.c                            |   2 +-
 src/video_output/chrono.h                     |  18 +--
 src/video_output/control.c                    |   4 +-
 src/video_output/control.h                    |  10 +-
 src/video_output/display.c                    |   6 +-
 src/video_output/snapshot.c                   |   4 +-
 src/video_output/snapshot.h                   |   2 +-
 src/video_output/video_epg.c                  |   6 +-
 src/video_output/video_output.c               |  42 +++----
 src/video_output/video_text.c                 |   6 +-
 src/video_output/video_widgets.c              |   4 +-
 src/video_output/vout_internal.h              |  22 ++--
 src/video_output/vout_subpictures.c           |  36 +++---
 src/video_output/window.c                     |   4 +-
 src/win32/thread.c                            |  24 ++--
 src/win32/timer.c                             |   2 +-
 test/src/input/demux-run.c                    |   4 +-
 test/src/interface/dialog.c                   |   2 +-
 456 files changed, 1992 insertions(+), 1991 deletions(-)

diff --git a/extras/analyser/vlc.vim b/extras/analyser/vlc.vim
index 44ca37e5e9..8618f82580 100644
--- a/extras/analyser/vlc.vim
+++ b/extras/analyser/vlc.vim
@@ -23,7 +23,7 @@ function VlcSyntax()
   syn keyword cConstant VLC_ESTATUS VLC_EEXIT VLC_EMODULE VLC_EOBJECT
   syn keyword cConstant VLC_ENOOBJ VLC_ENOMOD VLC_VAR_ADDRESS
   " custom types
-  syn keyword cType vlc_fixed_t mtime_t byte_t dctelem_t ssize_t off_t
+  syn keyword cType vlc_fixed_t vlc_tick_t byte_t dctelem_t ssize_t off_t
   syn keyword cType vlc_bool_t vlc_fourcc_t vlc_value_t
   " Core custom structures
   syn keyword cType vlc_t libvlc_t vlc_object_t vlc_error_t vlc_status_t 
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index f03b26d4fb..bf05490ae1 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -166,7 +166,7 @@ struct audio_output
       * \note This callback needs not be reentrant.
       */
 
-    int (*time_get)(audio_output_t *, mtime_t *delay);
+    int (*time_get)(audio_output_t *, vlc_tick_t *delay);
     /**< Estimates playback buffer latency (mandatory, cannot be NULL).
       *
       * This callback computes an estimation of the delay until the current
@@ -185,7 +185,7 @@ struct audio_output
       * \note This callback cannot be called in stopped state.
       */
 
-    void (*play)(audio_output_t *, block_t *block, mtime_t date);
+    void (*play)(audio_output_t *, block_t *block, vlc_tick_t date);
     /**< Queues a block of samples for playback (mandatory, cannot be NULL).
       *
       * \param block block of audio samples
@@ -194,7 +194,7 @@ struct audio_output
       * \note This callback cannot be called in stopped state.
       */
 
-    void (*pause)( audio_output_t *, bool pause, mtime_t date);
+    void (*pause)( audio_output_t *, bool pause, vlc_tick_t date);
     /**< Pauses or resumes playback (mandatory, cannot be NULL).
       *
       * This callback pauses or resumes audio playback as quickly as possible.
@@ -438,7 +438,7 @@ static inline void aout_RestartRequest(audio_output_t *aout, unsigned mode)
  * Default implementation for audio_output_t.time_get
  */
 static inline int aout_TimeGetDefault(audio_output_t *aout,
-                                      mtime_t *restrict delay)
+                                      vlc_tick_t *restrict delay)
 {
     (void) aout; (void) delay;
     return -1;
@@ -452,7 +452,7 @@ static inline int aout_TimeGetDefault(audio_output_t *aout,
  * Do not use this unless there are really no possible better alternatives.
  */
 static inline void aout_PauseDefault(audio_output_t *aout, bool paused,
-                                     mtime_t date)
+                                     vlc_tick_t date)
 {
     if (paused && aout->flush != NULL)
         aout->flush(aout, false);
diff --git a/include/vlc_block.h b/include/vlc_block.h
index 1c94783016..55a043485c 100644
--- a/include/vlc_block.h
+++ b/include/vlc_block.h
@@ -121,9 +121,9 @@ struct block_t
     uint32_t    i_flags;
     unsigned    i_nb_samples; /* Used for audio */
 
-    mtime_t     i_pts;
-    mtime_t     i_dts;
-    mtime_t     i_length;
+    vlc_tick_t  i_pts;
+    vlc_tick_t  i_dts;
+    vlc_tick_t  i_length;
 
     /* Rudimentary support for overloading block (de)allocation. */
     block_free_t pf_release;
@@ -364,10 +364,10 @@ static size_t block_ChainExtract( block_t *p_list, void *p_data, size_t i_max )
     return i_total;
 }
 
-static inline void block_ChainProperties( block_t *p_list, int *pi_count, size_t *pi_size, mtime_t *pi_length )
+static inline void block_ChainProperties( block_t *p_list, int *pi_count, size_t *pi_size, vlc_tick_t *pi_length )
 {
     size_t i_size = 0;
-    mtime_t i_length = 0;
+    vlc_tick_t i_length = 0;
     int i_count = 0;
 
     while( p_list )
@@ -390,7 +390,7 @@ static inline void block_ChainProperties( block_t *p_list, int *pi_count, size_t
 static inline block_t *block_ChainGather( block_t *p_list )
 {
     size_t  i_total = 0;
-    mtime_t i_length = 0;
+    vlc_tick_t i_length = 0;
     block_t *g;
 
     if( p_list->p_next == NULL )
@@ -534,7 +534,7 @@ VLC_API void vlc_fifo_WaitCond(vlc_fifo_t *, vlc_cond_t *);
  * Atomically unlocks the FIFO and waits until one thread signals the FIFO up
  * to a certain date, then locks the FIFO again. See vlc_fifo_Wait().
  */
-int vlc_fifo_TimedWaitCond(vlc_fifo_t *, vlc_cond_t *, mtime_t);
+int vlc_fifo_TimedWaitCond(vlc_fifo_t *, vlc_cond_t *, vlc_tick_t);
 
 /**
  * Queues a linked-list of blocks into a locked FIFO.
diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 3af54e6479..dde89978e7 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -61,7 +61,7 @@ struct decoder_owner_callbacks
 
             /* Display date
              * cf. decoder_GetDisplayDate */
-            mtime_t     (*get_display_date)( decoder_t *, mtime_t );
+            vlc_tick_t  (*get_display_date)( decoder_t *, vlc_tick_t );
             /* Display rate
              * cf. decoder_GetDisplayRate */
             float       (*get_display_rate)( decoder_t * );
@@ -430,7 +430,7 @@ static inline int decoder_GetInputAttachments( decoder_t *dec,
  * You MUST use it *only* for gathering statistics about speed.
  */
 VLC_USED
-static inline mtime_t decoder_GetDisplayDate( decoder_t *dec, mtime_t i_ts )
+static inline vlc_tick_t decoder_GetDisplayDate( decoder_t *dec, vlc_tick_t i_ts )
 {
     assert( dec->fmt_in.i_cat == VIDEO_ES && dec->cbs != NULL );
     if( !dec->cbs->video.get_display_date )
diff --git a/include/vlc_common.h b/include/vlc_common.h
index cc94b2f374..80c14742cc 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -286,7 +286,8 @@
  * epoch). Note that date and time intervals can be manipulated using regular
  * arithmetic operators, and that no special functions are required.
  */
-typedef int64_t mtime_t;
+typedef int64_t vlc_tick_t;
+typedef vlc_tick_t mtime_t; /* deprecated, use vlc_tick_t */
 
 /**
  * The vlc_fourcc_t type.
diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index bfbd383f64..3c4a4551b1 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -205,7 +205,7 @@ enum demux_query_e
      * XXX: not mandatory (except for subtitle demux) but will help a lot
      * for multi-input
      */
-    DEMUX_SET_NEXT_DEMUX_TIME,  /* arg1= mtime_t        can fail */
+    DEMUX_SET_NEXT_DEMUX_TIME,  /* arg1= vlc_tick_t     can fail */
     /* FPS for correct subtitles handling */
     DEMUX_GET_FPS,              /* arg1= double *       res=can fail    */
 
diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h
index 23e2a95880..c2a4212130 100644
--- a/include/vlc_es_out.h
+++ b/include/vlc_es_out.h
@@ -60,8 +60,8 @@ enum es_out_query_e
      * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send
      * as you would normally do.
      */
-    ES_OUT_SET_PCR,             /* arg1=mtime_t i_pcr(microsecond!) (using default group 0)*/
-    ES_OUT_SET_GROUP_PCR,       /* arg1= int i_group, arg2=mtime_t i_pcr(microsecond!)*/
+    ES_OUT_SET_PCR,             /* arg1=vlc_tick_t i_pcr(microsecond!) (using default group 0)*/
+    ES_OUT_SET_GROUP_PCR,       /* arg1= int i_group, arg2=vlc_tick_t i_pcr(microsecond!)*/
     ES_OUT_RESET_PCR,           /* no arg */
 
     /* Try not to use this one as it is a bit hacky */
@@ -93,8 +93,8 @@ enum es_out_query_e
     ES_OUT_SET_META, /* arg1=const vlc_meta_t * */
 
     /* PCR system clock manipulation for external clock synchronization */
-    ES_OUT_GET_PCR_SYSTEM, /* arg1=mtime_t *, arg2=mtime_t * res=can fail */
-    ES_OUT_MODIFY_PCR_SYSTEM, /* arg1=int is_absolute, arg2=mtime_t, res=can fail */
+    ES_OUT_GET_PCR_SYSTEM, /* arg1=vlc_tick_t *, arg2=vlc_tick_t * res=can fail */
+    ES_OUT_MODIFY_PCR_SYSTEM, /* arg1=int is_absolute, arg2=vlc_tick_t, res=can fail */
 
     ES_OUT_POST_SUBNODE, /* arg1=input_item_node_t *, res=can fail */
 
@@ -160,7 +160,7 @@ static inline void es_out_Delete( es_out_t *p_out )
     p_out->cbs->destroy( p_out );
 }
 
-static inline int es_out_SetPCR( es_out_t *out, mtime_t pcr )
+static inline int es_out_SetPCR( es_out_t *out, vlc_tick_t pcr )
 {
     return es_out_Control( out, ES_OUT_SET_PCR, pcr );
 }
@@ -170,11 +170,11 @@ static inline int es_out_ControlSetMeta( es_out_t *out, const vlc_meta_t *p_meta
     return es_out_Control( out, ES_OUT_SET_META, p_meta );
 }
 
-static inline int es_out_ControlGetPcrSystem( es_out_t *out, mtime_t *pi_system, mtime_t *pi_delay )
+static inline int es_out_ControlGetPcrSystem( es_out_t *out, vlc_tick_t *pi_system, vlc_tick_t *pi_delay )
 {
     return es_out_Control( out, ES_OUT_GET_PCR_SYSTEM, pi_system, pi_delay );
 }
-static inline int es_out_ControlModifyPcrSystem( es_out_t *out, bool b_absolute, mtime_t i_system )
+static inline int es_out_ControlModifyPcrSystem( es_out_t *out, bool b_absolute, vlc_tick_t i_system )
 {
     return es_out_Control( out, ES_OUT_MODIFY_PCR_SYSTEM, b_absolute, i_system );
 }
diff --git a/include/vlc_events.h b/include/vlc_events.h
index 22efabef07..38c9108fbd 100644
--- a/include/vlc_events.h
+++ b/include/vlc_events.h
@@ -142,7 +142,7 @@ typedef struct vlc_event_t
         } input_item_subitem_tree_added;
         struct vlc_input_item_duration_changed
         {
-            mtime_t new_duration;
+            vlc_tick_t new_duration;
         } input_item_duration_changed;
         struct vlc_input_item_preparsed_changed
         {
diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index 383df77691..847dc76604 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -98,7 +98,7 @@ struct filter_t
                                  int, int, int );
 
         /** Generate a subpicture (sub source) */
-        subpicture_t *(*pf_sub_source)( filter_t *, mtime_t );
+        subpicture_t *(*pf_sub_source)( filter_t *, vlc_tick_t );
 
         /** Filter a subpicture (sub filter) */
         subpicture_t *(*pf_sub_filter)( filter_t *, subpicture_t * );
@@ -434,7 +434,7 @@ VLC_API void filter_chain_VideoFlush( filter_chain_t * );
  * \param display_date of subpictures
  */
 void filter_chain_SubSource(filter_chain_t *chain, spu_t *,
-                            mtime_t display_date);
+                            vlc_tick_t display_date);
 
 /**
  * Apply filter chain to subpictures.
diff --git a/include/vlc_input.h b/include/vlc_input.h
index 16c566a15b..f892a10d5a 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -93,7 +93,7 @@ typedef struct input_title_t
 {
     char        *psz_name;
 
-    mtime_t     i_length;   /* Length(microsecond) if known, else 0 */
+    vlc_tick_t  i_length;   /* Length(microsecond) if known, else 0 */
 
     unsigned    i_flags;    /* Is it a menu or a normal entry */
 
@@ -486,8 +486,8 @@ enum input_query_e
     INPUT_SET_RENDERER,     /* arg1=vlc_renderer_item_t* */
 
     /* External clock managments */
-    INPUT_GET_PCR_SYSTEM,   /* arg1=mtime_t *, arg2=mtime_t *       res=can fail */
-    INPUT_MODIFY_PCR_SYSTEM,/* arg1=int absolute, arg2=mtime_t      res=can fail */
+    INPUT_GET_PCR_SYSTEM,   /* arg1=vlc_tick_t *, arg2=vlc_tick_t *       res=can fail */
+    INPUT_MODIFY_PCR_SYSTEM,/* arg1=int absolute, arg2=vlc_tick_t   res=can fail */
 };
 
 /** @}*/
@@ -632,14 +632,14 @@ static inline int input_GetEsObjects( input_thread_t *p_input, int i_id,
 /**
  * \see input_clock_GetSystemOrigin
  */
-static inline int input_GetPcrSystem( input_thread_t *p_input, mtime_t *pi_system, mtime_t *pi_delay )
+static inline int input_GetPcrSystem( input_thread_t *p_input, vlc_tick_t *pi_system, vlc_tick_t *pi_delay )
 {
     return input_Control( p_input, INPUT_GET_PCR_SYSTEM, pi_system, pi_delay );
 }
 /**
  * \see input_clock_ChangeSystemOrigin
  */
-static inline int input_ModifyPcrSystem( input_thread_t *p_input, bool b_absolute, mtime_t i_system )
+static inline int input_ModifyPcrSystem( input_thread_t *p_input, bool b_absolute, vlc_tick_t i_system )
 {
     return input_Control( p_input, INPUT_MODIFY_PCR_SYSTEM, b_absolute, i_system );
 }
diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 4bb7bbf857..083284bcfe 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -69,7 +69,7 @@ struct input_item_t
     unsigned   optflagc;
     input_item_opaque_t *opaques;    /**< List of opaque pointer values */
 
-    mtime_t    i_duration;           /**< Duration in microseconds */
+    vlc_tick_t  i_duration;           /**< Duration in microseconds */
 
 
     int        i_categories;         /**< Number of info categories */
@@ -268,8 +268,8 @@ VLC_API char * input_item_GetTitleFbName( input_item_t * p_i ) VLC_USED;
 VLC_API char * input_item_GetURI( input_item_t * p_i ) VLC_USED;
 VLC_API char * input_item_GetNowPlayingFb( input_item_t *p_item ) VLC_USED;
 VLC_API void input_item_SetURI( input_item_t * p_i, const char *psz_uri );
-VLC_API mtime_t input_item_GetDuration( input_item_t * p_i );
-VLC_API void input_item_SetDuration( input_item_t * p_i, mtime_t i_duration );
+VLC_API vlc_tick_t input_item_GetDuration( input_item_t * p_i );
+VLC_API void input_item_SetDuration( input_item_t * p_i, vlc_tick_t i_duration );
 VLC_API bool input_item_IsPreparsed( input_item_t *p_i );
 VLC_API bool input_item_IsArtFetched( input_item_t *p_i );
 
@@ -330,7 +330,7 @@ VLC_API void input_item_MergeInfos( input_item_t *, info_category_t * );
  */
 VLC_API input_item_t * input_item_NewExt( const char *psz_uri,
                                           const char *psz_name,
-                                          mtime_t i_duration, int i_type,
+                                          vlc_tick_t i_duration, int i_type,
                                           enum input_item_net_type i_net ) VLC_USED;
 
 #define input_item_New( psz_uri, psz_name ) \
diff --git a/include/vlc_interrupt.h b/include/vlc_interrupt.h
index a6fb303200..863a15eb38 100644
--- a/include/vlc_interrupt.h
+++ b/include/vlc_interrupt.h
@@ -69,7 +69,7 @@ VLC_API int vlc_sem_wait_i11e(vlc_sem_t *);
  * @return EINTR if an interruption occurred, otherwise 0 once the timestamp is
  * reached.
  */
-VLC_API int vlc_mwait_i11e(mtime_t);
+VLC_API int vlc_mwait_i11e(vlc_tick_t);
 
 /**
  * Interruptible variant of msleep().
@@ -82,7 +82,7 @@ VLC_API int vlc_mwait_i11e(mtime_t);
  * @return EINTR if an interruption occurred, otherwise 0 once the timeout
  * expired.
  */
-static inline int vlc_msleep_i11e(mtime_t delay)
+static inline int vlc_msleep_i11e(vlc_tick_t delay)
 {
     return vlc_mwait_i11e(mdate() + delay);
 }
diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h
index a35d9729ca..640c719158 100644
--- a/include/vlc_media_library.h
+++ b/include/vlc_media_library.h
@@ -116,7 +116,7 @@ typedef enum
 typedef enum {
     ML_TYPE_INT,        /**< Object is an int */
     ML_TYPE_PSZ,        /**< A string char* */
-    ML_TYPE_TIME,       /**< A timestamp mtime_t */
+    ML_TYPE_TIME,       /**< A timestamp vlc_tick_t */
     ML_TYPE_MEDIA,      /**< A pointer to a media ml_media_t* */
 } ml_result_type_e;
 
diff --git a/include/vlc_mtime.h b/include/vlc_mtime.h
index 3c6dd4a2e0..39f594680d 100644
--- a/include/vlc_mtime.h
+++ b/include/vlc_mtime.h
@@ -58,7 +58,7 @@ VLC_API char * secstotimestr( char *psz_buffer, int32_t secs );
  */
 struct date_t
 {
-    mtime_t  date;
+    vlc_tick_t  date;
     uint32_t i_divider_num;
     uint32_t i_divider_den;
     uint32_t i_remainder;
@@ -88,7 +88,7 @@ VLC_API void date_Change(date_t *restrict date, uint32_t num, uint32_t den);
  * \param date date to set the timestamp into
  * \param value date value
  */
-static inline void date_Set(date_t *restrict date, mtime_t value)
+static inline void date_Set(date_t *restrict date, vlc_tick_t value)
 {
     date->date = value;
     date->i_remainder = 0;
@@ -100,7 +100,7 @@ static inline void date_Set(date_t *restrict date, mtime_t value)
  * \param date date to fetch the timestamp from
  * \return date value
  */
-VLC_USED static inline mtime_t date_Get(const date_t *restrict date)
+VLC_USED static inline vlc_tick_t date_Get(const date_t *restrict date)
 {
     return date->date;
 }
@@ -114,7 +114,7 @@ VLC_USED static inline mtime_t date_Get(const date_t *restrict date)
  * \param count number of samples
  * \return timestamp value after incrementing
  */
-VLC_API mtime_t date_Increment(date_t *restrict date, uint32_t count);
+VLC_API vlc_tick_t date_Increment(date_t *restrict date, uint32_t count);
 
 /**
  * Decrements a date.
@@ -125,7 +125,7 @@ VLC_API mtime_t date_Increment(date_t *restrict date, uint32_t count);
  * \param count number of samples
  * \return date value
  */
-VLC_API mtime_t date_Decrement(date_t *restrict date, uint32_t count);
+VLC_API vlc_tick_t date_Decrement(date_t *restrict date, uint32_t count);
 
 /** @} */
 
diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index e82c5da6f4..dc6dc68573 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -81,7 +81,7 @@ struct picture_t
      * These properties can be modified using the video output thread API,
      * but should never be written directly */
     /**@{*/
-    mtime_t         date;                                  /**< display date */
+    vlc_tick_t      date;                                  /**< display date */
     bool            b_force;
     /**@}*/
 
diff --git a/include/vlc_picture_fifo.h b/include/vlc_picture_fifo.h
index 73d1b20c27..2f3a38cb23 100644
--- a/include/vlc_picture_fifo.h
+++ b/include/vlc_picture_fifo.h
@@ -77,12 +77,12 @@ VLC_API void picture_fifo_Push( picture_fifo_t *, picture_t * );
  *
  * All pictures inside the fifo will be released by picture_Release.
  */
-VLC_API void picture_fifo_Flush( picture_fifo_t *, mtime_t date, bool flush_before );
+VLC_API void picture_fifo_Flush( picture_fifo_t *, vlc_tick_t date, bool flush_before );
 
 /**
  * It applies a delta on all the picture timestamp.
  */
-VLC_API void picture_fifo_OffsetDate( picture_fifo_t *, mtime_t delta );
+VLC_API void picture_fifo_OffsetDate( picture_fifo_t *, vlc_tick_t delta );
 
 
 #endif /* VLC_PICTURE_FIFO_H */
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index d18751f627..5a94eaaae4 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -317,7 +317,7 @@ VLC_API input_thread_t *playlist_CurrentInputLocked( playlist_t *p_playlist ) VL
 
 /** Get the duration of all items in a node.
  */
-VLC_API mtime_t playlist_GetNodeDuration( playlist_item_t * );
+VLC_API vlc_tick_t playlist_GetNodeDuration( playlist_item_t * );
 
 /** Clear the playlist
  * \param b_locked TRUE if playlist is locked when entering this function
diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index 7e4a8d4a45..214b29ac17 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -143,7 +143,7 @@ struct  sout_mux_t
     bool  b_add_stream_any_time;
     bool  b_waiting_stream;
     /* we wait 1.5 second after first stream added */
-    mtime_t     i_add_stream_start;
+    vlc_tick_t  i_add_stream_start;
 };
 
 enum sout_mux_query_e
@@ -169,7 +169,7 @@ VLC_API sout_input_t *sout_MuxAddStream( sout_mux_t *, const es_format_t * ) VLC
 VLC_API void sout_MuxDeleteStream( sout_mux_t *, sout_input_t * );
 VLC_API void sout_MuxDelete( sout_mux_t * );
 VLC_API int sout_MuxSendBuffer( sout_mux_t *, sout_input_t  *, block_t * );
-VLC_API int sout_MuxGetStream(sout_mux_t *, unsigned, mtime_t *);
+VLC_API int sout_MuxGetStream(sout_mux_t *, unsigned, vlc_tick_t *);
 VLC_API void sout_MuxFlush( sout_mux_t *, sout_input_t * );
 
 static inline int sout_MuxControl( sout_mux_t *p_mux, int i_query, ... )
diff --git a/include/vlc_spu.h b/include/vlc_spu.h
index dc8ea90fa6..127d586ac0 100644
--- a/include/vlc_spu.h
+++ b/include/vlc_spu.h
@@ -73,7 +73,7 @@ VLC_API void spu_PutSubpicture( spu_t *, subpicture_t * );
  *
  * The returned value if non NULL must be released by subpicture_Delete().
  */
-VLC_API subpicture_t * spu_Render( spu_t *, const vlc_fourcc_t *p_chroma_list, const video_format_t *p_fmt_dst, const video_format_t *p_fmt_src, mtime_t render_subtitle_date, mtime_t render_osd_date, bool ignore_osd );
+VLC_API subpicture_t * spu_Render( spu_t *, const vlc_fourcc_t *p_chroma_list, const video_format_t *p_fmt_dst, const video_format_t *p_fmt_src, vlc_tick_t render_subtitle_date, vlc_tick_t render_osd_date, bool ignore_osd );
 
 /**
  * It registers a new SPU channel.
diff --git a/include/vlc_subpicture.h b/include/vlc_subpicture.h
index 6a734420ae..ee6752f443 100644
--- a/include/vlc_subpicture.h
+++ b/include/vlc_subpicture.h
@@ -126,14 +126,14 @@ typedef struct
     int  (*pf_validate)( subpicture_t *,
                          bool has_src_changed, const video_format_t *p_fmt_src,
                          bool has_dst_changed, const video_format_t *p_fmt_dst,
-                         mtime_t);
+                         vlc_tick_t);
     /** Mandatory callback called after pf_validate and doing
       * the main job of creating the subpicture regions for the
       * current video_format */
     void (*pf_update)  ( subpicture_t *,
                          const video_format_t *p_fmt_src,
                          const video_format_t *p_fmt_dst,
-                         mtime_t );
+                         vlc_tick_t );
     /** Optional callback for subpicture private data cleanup */
     void (*pf_destroy) ( subpicture_t * );
     void *p_sys;
@@ -167,8 +167,8 @@ struct subpicture_t
 
     /** \name Date properties */
     /**@{*/
-    mtime_t         i_start;                  /**< beginning of display date */
-    mtime_t         i_stop;                         /**< end of display date */
+    vlc_tick_t      i_start;                  /**< beginning of display date */
+    vlc_tick_t      i_stop;                         /**< end of display date */
     bool            b_ephemer;    /**< If this flag is set to true the subtitle
                                 will be displayed until the next one appear */
     bool            b_fade;                               /**< enable fading */
@@ -217,7 +217,7 @@ VLC_API subpicture_t * subpicture_NewFromPicture( vlc_object_t *, picture_t *, v
  * This function will update the content of a subpicture created with
  * a non NULL subpicture_updater_t.
  */
-VLC_API void subpicture_Update( subpicture_t *, const video_format_t *src, const video_format_t *, mtime_t );
+VLC_API void subpicture_Update( subpicture_t *, const video_format_t *src, const video_format_t *, vlc_tick_t );
 
 /**
  * This function will blend a given subpicture onto a picture.
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index b0891ac88c..2a4b36e9c3 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -539,7 +539,7 @@ VLC_API void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex);
  * \return 0 if the condition was signaled, an error code in case of timeout.
  */
 VLC_API int vlc_cond_timedwait(vlc_cond_t *cond, vlc_mutex_t *mutex,
-                               mtime_t deadline);
+                               vlc_tick_t deadline);
 
 int vlc_cond_timedwait_daytime(vlc_cond_t *, vlc_mutex_t *, time_t);
 
@@ -690,7 +690,7 @@ void vlc_addr_wait(void *addr, unsigned val);
  * \return true if the function was woken up before the time-out,
  * false if the time-out elapsed.
  */
-bool vlc_addr_timedwait(void *addr, unsigned val, mtime_t delay);
+bool vlc_addr_timedwait(void *addr, unsigned val, vlc_tick_t delay);
 
 /**
  * Wakes up one thread on an address.
@@ -842,7 +842,7 @@ VLC_API unsigned long vlc_thread_id(void) VLC_USED;
  *
  * \return a timestamp in microseconds.
  */
-VLC_API mtime_t mdate(void);
+VLC_API vlc_tick_t mdate(void);
 
 /**
  * Waits until a deadline.
@@ -852,7 +852,7 @@ VLC_API mtime_t mdate(void);
  * \note The deadline may be exceeded due to OS scheduling.
  * \note This function is a cancellation point.
  */
-VLC_API void mwait(mtime_t deadline);
+VLC_API void mwait(vlc_tick_t deadline);
 
 /**
  * Waits for an interval of time.
@@ -862,7 +862,7 @@ VLC_API void mwait(mtime_t deadline);
  * \note The delay may be exceeded due to OS scheduling.
  * \note This function is a cancellation point.
  */
-VLC_API void msleep(mtime_t delay);
+VLC_API void msleep(vlc_tick_t delay);
 
 #define VLC_HARD_MIN_SLEEP  (CLOCK_FREQ/100) /* 10 milliseconds = 1 tick at 100Hz */
 #define VLC_SOFT_MIN_SLEEP  (9*CLOCK_FREQ)   /* 9 seconds */
@@ -877,7 +877,7 @@ static
 __attribute__((unused))
 __attribute__((noinline))
 __attribute__((error("sorry, cannot sleep for such short a time")))
-mtime_t impossible_delay( mtime_t delay )
+vlc_tick_t impossible_delay( vlc_tick_t delay )
 {
     (void) delay;
     return VLC_HARD_MIN_SLEEP;
@@ -887,7 +887,7 @@ static
 __attribute__((unused))
 __attribute__((noinline))
 __attribute__((warning("use proper event handling instead of short delay")))
-mtime_t harmful_delay( mtime_t delay )
+vlc_tick_t harmful_delay( vlc_tick_t delay )
 {
     return delay;
 }
@@ -905,7 +905,7 @@ static
 __attribute__((unused))
 __attribute__((noinline))
 __attribute__((error("deadlines can not be constant")))
-mtime_t impossible_deadline( mtime_t deadline )
+vlc_tick_t impossible_deadline( vlc_tick_t deadline )
 {
     return deadline;
 }
@@ -967,7 +967,7 @@ VLC_API void vlc_timer_destroy(vlc_timer_t timer);
  *                 repetition interval.
  */
 VLC_API void vlc_timer_schedule(vlc_timer_t timer, bool absolute,
-                                mtime_t value, mtime_t interval);
+                                vlc_tick_t value, vlc_tick_t interval);
 
 /**
  * Fetches and resets the overrun counter for a timer.
diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 89d9821438..6bb712c17c 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -94,7 +94,7 @@ struct vout_thread_t {
 VLC_API int vout_GetSnapshot( vout_thread_t *p_vout,
                               block_t **pp_image, picture_t **pp_picture,
                               video_format_t *p_fmt,
-                              const char *psz_format, mtime_t i_timeout );
+                              const char *psz_format, vlc_tick_t i_timeout );
 
 VLC_API void vout_ChangeAspectRatio( vout_thread_t *p_vout,
                                      unsigned int i_num, unsigned int i_den );
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 4dd63446a4..86eb1bced0 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -268,7 +268,7 @@ struct vout_display_t {
      * subpicture_t.
      */
     void       (*prepare)(vout_display_t *, picture_t *, subpicture_t *,
-                          mtime_t date);
+                          vlc_tick_t date);
 
     /* Display a picture and an optional subpicture (mandatory).
      *
diff --git a/include/vlc_vout_osd.h b/include/vlc_vout_osd.h
index a07cd90731..a97b068f85 100644
--- a/include/vlc_vout_osd.h
+++ b/include/vlc_vout_osd.h
@@ -63,7 +63,7 @@ VLC_API int vout_OSDEpg( vout_thread_t *, input_item_t * );
  * \param duration Duration of the text being displayed
  * \param text Text to be displayed
  */
-VLC_API void vout_OSDText( vout_thread_t *vout, int channel, int position, mtime_t duration, const char *text );
+VLC_API void vout_OSDText( vout_thread_t *vout, int channel, int position, vlc_tick_t duration, const char *text );
 
 /**
  * \brief Write an informative message at the default location,
diff --git a/include/vlc_vout_wrapper.h b/include/vlc_vout_wrapper.h
index 5e45390fb0..a394bd4d70 100644
--- a/include/vlc_vout_wrapper.h
+++ b/include/vlc_vout_wrapper.h
@@ -42,7 +42,7 @@ static inline picture_pool_t *vout_display_Pool(vout_display_t *vd, unsigned cou
 static inline void vout_display_Prepare(vout_display_t *vd,
                                         picture_t *picture,
                                         subpicture_t *subpicture,
-                                        mtime_t date)
+                                        vlc_tick_t date)
 {
     if (vd->prepare)
         vd->prepare(vd, picture, subpicture, date);
diff --git a/lib/libvlc_internal.h b/lib/libvlc_internal.h
index d1cc28486c..a6ba458d54 100644
--- a/lib/libvlc_internal.h
+++ b/lib/libvlc_internal.h
@@ -99,12 +99,12 @@ void libvlc_event_send(
         libvlc_event_manager_t * p_em,
         libvlc_event_t * p_event );
 
-static inline libvlc_time_t from_mtime(mtime_t time)
+static inline libvlc_time_t from_mtime(vlc_tick_t time)
 {
     return (time + 500ULL)/ 1000ULL;
 }
 
-static inline mtime_t to_mtime(libvlc_time_t time)
+static inline vlc_tick_t to_mtime(libvlc_time_t time)
 {
     return time * 1000ULL;
 }
diff --git a/modules/access/alsa.c b/modules/access/alsa.c
index 99cb1dcbd8..88bb4d5398 100644
--- a/modules/access/alsa.c
+++ b/modules/access/alsa.c
@@ -128,8 +128,8 @@ typedef struct
     es_out_id_t *es;
     vlc_thread_t thread;
 
-    mtime_t start;
-    mtime_t caching;
+    vlc_tick_t start;
+    vlc_tick_t caching;
     snd_pcm_uframes_t period_size;
     unsigned rate;
 } demux_sys_t;
@@ -179,7 +179,7 @@ static void *Thread (void *data)
 
         /* Read data */
         snd_pcm_sframes_t frames, delay;
-        mtime_t pts;
+        vlc_tick_t pts;
 
         frames = snd_pcm_readi (pcm, block->p_buffer, sys->period_size);
         pts = mdate ();
diff --git a/modules/access/avcapture.m b/modules/access/avcapture.m
index 060deab58c..9f36d2c256 100644
--- a/modules/access/avcapture.m
+++ b/modules/access/avcapture.m
@@ -73,8 +73,8 @@ vlc_module_end ()
 
     CVImageBufferRef    currentImageBuffer;
 
-    mtime_t             currentPts;
-    mtime_t             previousPts;
+    vlc_tick_t          currentPts;
+    vlc_tick_t          previousPts;
     size_t              bytesPerRow;
 
     long                timeScale;
@@ -87,9 +87,9 @@ vlc_module_end ()
 - (int)width;
 - (int)height;
 - (void)getVideoDimensions:(CMSampleBufferRef)sampleBuffer;
-- (mtime_t)currentPts;
+- (vlc_tick_t)currentPts;
 - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection;
-- (mtime_t)copyCurrentFrameToBuffer:(void *)buffer;
+- (vlc_tick_t)copyCurrentFrameToBuffer:(void *)buffer;
 @end
 
 @implementation VLCAVDecompressedVideoOutput : AVCaptureVideoDataOutput
@@ -152,9 +152,9 @@ vlc_module_end ()
     }
 }
 
--(mtime_t)currentPts
+-(vlc_tick_t)currentPts
 {
-    mtime_t pts;
+    vlc_tick_t pts;
 
     if ( !currentImageBuffer || currentPts == previousPts )
         return 0;
@@ -181,7 +181,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
         @synchronized (self) {
             imageBufferToRelease = currentImageBuffer;
             currentImageBuffer = videoFrame;
-            currentPts = (mtime_t)presentationtimestamp.value;
+            currentPts = (vlc_tick_t)presentationtimestamp.value;
             timeScale = (long)presentationtimestamp.timescale;
         }
         
@@ -189,10 +189,10 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
     }
 }
 
-- (mtime_t)copyCurrentFrameToBuffer:(void *)buffer
+- (vlc_tick_t)copyCurrentFrameToBuffer:(void *)buffer
 {
     CVImageBufferRef imageBuffer;
-    mtime_t pts;
+    vlc_tick_t pts;
 
     void *pixels;
 
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 4fca6b79a7..bd6515072a 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -177,7 +177,7 @@ typedef struct
     bool                b_menu;
     bool                b_menu_open;
     bool                b_popup_available;
-    mtime_t             i_still_end_time;
+    vlc_tick_t          i_still_end_time;
 
     vlc_mutex_t         bdj_overlay_lock; /* used to lock BD-J overlay open/close while overlays are being sent to vout */
 
@@ -1159,7 +1159,7 @@ static void updater_unlock_overlay(bluray_spu_updater_sys_t *p_upd_sys)
 static int subpictureUpdaterValidate(subpicture_t *p_subpic,
                                       bool b_fmt_src, const video_format_t *p_fmt_src,
                                       bool b_fmt_dst, const video_format_t *p_fmt_dst,
-                                      mtime_t i_ts)
+                                      vlc_tick_t i_ts)
 {
     VLC_UNUSED(b_fmt_src);
     VLC_UNUSED(b_fmt_dst);
@@ -1184,7 +1184,7 @@ static int subpictureUpdaterValidate(subpicture_t *p_subpic,
 static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
                                     const video_format_t *p_fmt_src,
                                     const video_format_t *p_fmt_dst,
-                                    mtime_t i_ts)
+                                    vlc_tick_t i_ts)
 {
     VLC_UNUSED(p_fmt_src);
     VLC_UNUSED(p_fmt_dst);
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index 7ce0924fad..f906ca7b2e 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -197,13 +197,13 @@ static int DemuxControl(demux_t *demux, int query, va_list args)
             break;
 
         case DEMUX_GET_LENGTH:
-            *va_arg(args, mtime_t *) = (INT64_C(40000) * sys->length) / 3;
+            *va_arg(args, vlc_tick_t *) = (INT64_C(40000) * sys->length) / 3;
             break;
         case DEMUX_GET_TIME:
-            *va_arg(args, mtime_t *) = (INT64_C(40000) * sys->position) / 3;
+            *va_arg(args, vlc_tick_t *) = (INT64_C(40000) * sys->position) / 3;
             break;
         case DEMUX_SET_TIME:
-            sys->position = (va_arg(args, mtime_t) * 3) / INT64_C(40000);
+            sys->position = (va_arg(args, vlc_tick_t) * 3) / INT64_C(40000);
             break;
 
         default:
@@ -467,8 +467,8 @@ static int ReadDir(stream_t *access, input_item_node_t *node)
             name = NULL;
 
         /* Create playlist items */
-        const mtime_t duration =
-            (mtime_t)(sys->p_sectors[i + 1] - sys->p_sectors[i])
+        const vlc_tick_t duration =
+            (vlc_tick_t)(sys->p_sectors[i + 1] - sys->p_sectors[i])
             * CDDA_DATA_SIZE * CLOCK_FREQ / 44100 / 2 / 2;
 
         input_item_t *item = input_item_NewDisc(access->psz_url,
diff --git a/modules/access/dcp/dcp.cpp b/modules/access/dcp/dcp.cpp
index a0dc67ad21..e0977e0622 100644
--- a/modules/access/dcp/dcp.cpp
+++ b/modules/access/dcp/dcp.cpp
@@ -162,7 +162,7 @@ class demux_sys_t
     uint8_t pi_chan_table[AOUT_CHAN_MAX];
     uint8_t i_channels;
 
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 
     demux_sys_t():
         PictureEssType ( ESS_UNKNOWN ),
@@ -826,7 +826,7 @@ static int Control( demux_t *p_demux, int query, va_list args )
             p_sys->frame_no = i64 * p_sys->frame_rate_num / ( CLOCK_FREQ * p_sys->frame_rate_denom );
             p_sys->i_pts= i64;
             es_out_SetPCR(p_demux->out, p_sys->i_pts);
-            es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, ( mtime_t ) i64 );
+            es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, ( vlc_tick_t ) i64 );
             break;
         case DEMUX_GET_PTS_DELAY:
             pi64 = va_arg( args, int64_t * );
diff --git a/modules/access/dshow/access.h b/modules/access/dshow/access.h
index 271657e0af..6ae768a68f 100644
--- a/modules/access/dshow/access.h
+++ b/modules/access/dshow/access.h
@@ -79,6 +79,6 @@ struct access_sys_t
     int            i_width;
     int            i_height;
     int            i_chroma;
-    mtime_t        i_start;
+    vlc_tick_t     i_start;
 };
 
diff --git a/modules/access/dshow/filter.cpp b/modules/access/dshow/filter.cpp
index 40620b9c64..1f15db3240 100644
--- a/modules/access/dshow/filter.cpp
+++ b/modules/access/dshow/filter.cpp
@@ -638,7 +638,7 @@ STDMETHODIMP CapturePin::Receive( IMediaSample *pSample )
     msg_Dbg( p_input, "CapturePin::Receive" );
 #endif
 
-    mtime_t i_timestamp = mdate() * 10;
+    vlc_tick_t i_timestamp = mdate() * 10;
     VLCMediaSample vlc_sample = {pSample, i_timestamp};
 
     vlc_mutex_lock( &p_sys->lock );
diff --git a/modules/access/dshow/filter.h b/modules/access/dshow/filter.h
index 733f45b7bd..44c9c42521 100644
--- a/modules/access/dshow/filter.h
+++ b/modules/access/dshow/filter.h
@@ -31,7 +31,7 @@
 struct VLCMediaSample
 {
     ComPtr<IMediaSample> p_sample;
-    mtime_t i_timestamp;
+    vlc_tick_t i_timestamp;
 };
 
 /* */
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index ea36bc9ff9..f5a00276a8 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -340,7 +340,7 @@ ssize_t BDAOutput::Pop(void *buf, size_t len, int ms)
 
     vlc_mutex_locker l( &lock );
 
-    mtime_t i_deadline = mdate() + ms * 1000;
+    vlc_tick_t i_deadline = mdate() + ms * 1000;
     while( !p_first )
     {
         if( vlc_cond_timedwait( &wait, &lock, i_deadline ) )
diff --git a/modules/access/dtv/en50221.c b/modules/access/dtv/en50221.c
index 3852d431c0..fca72dd053 100644
--- a/modules/access/dtv/en50221.c
+++ b/modules/access/dtv/en50221.c
@@ -120,7 +120,7 @@ struct cam
     vlc_object_t *obj;
     int fd;
     int i_ca_type;
-    mtime_t i_timeout, i_next_event;
+    vlc_tick_t i_timeout, i_next_event;
 
     unsigned i_nb_slots;
     bool pb_active_slot[MAX_CI_SLOTS];
@@ -1404,7 +1404,7 @@ static void ConditionalAccessOpen( cam_t * p_cam, unsigned i_session_id )
 typedef struct
 {
     int i_interval;
-    mtime_t i_last;
+    vlc_tick_t i_last;
 } date_time_t;
 
 /*****************************************************************************
@@ -1488,7 +1488,7 @@ static void DateTimeManage( cam_t * p_cam, int i_session_id )
         (date_time_t *)p_cam->p_sessions[i_session_id - 1].p_sys;
 
     if ( p_date->i_interval
-          && mdate() > p_date->i_last + (mtime_t)p_date->i_interval * CLOCK_FREQ )
+          && mdate() > p_date->i_last + (vlc_tick_t)p_date->i_interval * CLOCK_FREQ )
     {
         DateTimeSend( p_cam, i_session_id );
     }
diff --git a/modules/access/dvb/access.c b/modules/access/dvb/access.c
index 9a1acc91af..c5564eb234 100644
--- a/modules/access/dvb/access.c
+++ b/modules/access/dvb/access.c
@@ -292,19 +292,19 @@ static int ScanReadCallback( scan_t *p_scan, void *p_privdata,
     FrontendGetStatus( &p_sys->dvb, &status );
     bool b_has_lock = status.b_has_lock;
 
-    mtime_t i_scan_start = mdate();
+    vlc_tick_t i_scan_start = mdate();
 
     for( ; *pi_count == 0; )
     {
         /* Find if some data is available */
         int i_ret;
 
-        mtime_t i_timeout = b_has_lock ? i_probe_timeout:
+        vlc_tick_t i_timeout = b_has_lock ? i_probe_timeout:
                                          DVB_SCAN_MAX_LOCK_TIME;
 
         do
         {
-            mtime_t i_poll_timeout = i_scan_start - mdate() + i_timeout;
+            vlc_tick_t i_poll_timeout = i_scan_start - mdate() + i_timeout;
 
             i_ret = 0;
 
diff --git a/modules/access/dvb/scan.c b/modules/access/dvb/scan.c
index 8b0b2e0eba..01961794d8 100644
--- a/modules/access/dvb/scan.c
+++ b/modules/access/dvb/scan.c
@@ -812,7 +812,7 @@ static int scan_Next( scan_t *p_scan, scan_tuner_config_t *p_cfg )
     //while( !scan_tuner_config_ParametersValidate( &p_scan->parameter, p_cfg ) );
 
     const size_t i_total_services = scan_CountServices( p_scan );
-    const mtime_t i_eta = f_position > 0.005 ? (mdate() - p_scan->i_time_start) * ( 1.0 / f_position - 1.0 ) : -1;
+    const vlc_tick_t i_eta = f_position > 0.005 ? (mdate() - p_scan->i_time_start) * ( 1.0 / f_position - 1.0 ) : -1;
     char psz_eta[MSTRTIME_MAX_SIZE];
     const char *psz_fmt = _("%.1f MHz (%d services)\n~%s remaining");
 
@@ -876,7 +876,7 @@ int scan_Run( scan_t *p_scan )
     for( ;; )
     {
         unsigned i_timeout = scan_session_GetTablesTimeout( session );
-        mtime_t i_remaining = mdate() - i_scan_start;
+        vlc_tick_t i_remaining = mdate() - i_scan_start;
         if( i_remaining > i_timeout )
             break;
 
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index abd65ffc36..33af82903d 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -162,7 +162,7 @@ typedef struct
     unsigned      updates;
 
     /* length of program group chain */
-    mtime_t     i_pgc_length;
+    vlc_tick_t  i_pgc_length;
     int         i_vobu_index;
     int         i_vobu_flush;
 } demux_sys_t;
@@ -871,7 +871,7 @@ static int Demux( demux_t *p_demux )
 
             if( event->length != 0xff && p_sys->still.b_created )
             {
-                mtime_t delay = event->length * CLOCK_FREQ;
+                vlc_tick_t delay = event->length * CLOCK_FREQ;
                 vlc_timer_schedule( p_sys->still.timer, false, delay, 0 );
             }
 
diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 89ecfc8906..9cc6884140 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -124,14 +124,14 @@ typedef struct
     int i_title_end_block;
     int i_title_blocks;
     int i_title_offset;
-    mtime_t i_title_cur_time;
+    vlc_tick_t i_title_cur_time;
 
     int i_title_start_cell;
     int i_title_end_cell;
     int i_cur_cell;
     int i_next_cell;
-    mtime_t i_cell_cur_time;
-    mtime_t i_cell_duration;
+    vlc_tick_t i_cell_cur_time;
+    vlc_tick_t i_cell_duration;
 
     /* Track */
     ps_track_t    tk[PS_TK_COUNT];
@@ -229,9 +229,9 @@ static int Open( vlc_object_t *p_this )
     ps_track_init( p_sys->tk );
     p_sys->i_sar_num = 0;
     p_sys->i_sar_den = 0;
-    p_sys->i_title_cur_time = (mtime_t) 0;
-    p_sys->i_cell_cur_time = (mtime_t) 0;
-    p_sys->i_cell_duration = (mtime_t) 0;
+    p_sys->i_title_cur_time = (vlc_tick_t) 0;
+    p_sys->i_cell_cur_time = (vlc_tick_t) 0;
+    p_sys->i_cell_duration = (vlc_tick_t) 0;
 
     p_sys->p_dvdread = p_dvdread;
     p_sys->p_vmg_file = p_vmg_file;
@@ -1186,8 +1186,8 @@ static void DvdReadHandleDSI( demux_t *p_demux, uint8_t *p_data )
     /*
      * Store the timecodes so we can get the current time
      */
-    p_sys->i_title_cur_time = (mtime_t) p_sys->dsi_pack.dsi_gi.nv_pck_scr / 90 * 1000;
-    p_sys->i_cell_cur_time = (mtime_t) dvdtime_to_time( &p_sys->dsi_pack.dsi_gi.c_eltm, 0 );
+    p_sys->i_title_cur_time = (vlc_tick_t) p_sys->dsi_pack.dsi_gi.nv_pck_scr / 90 * 1000;
+    p_sys->i_cell_cur_time = (vlc_tick_t) dvdtime_to_time( &p_sys->dsi_pack.dsi_gi.c_eltm, 0 );
 
     /*
      * If we're not at the end of this cell, we can determine the next
@@ -1256,7 +1256,7 @@ static void DvdReadHandleDSI( demux_t *p_demux, uint8_t *p_data )
         p_sys->i_next_vobu =
             p_sys->p_cur_pgc->cell_playback[p_sys->i_cur_cell].first_sector;
 
-        p_sys->i_cell_duration = (mtime_t)dvdtime_to_time( &p_sys->p_cur_pgc->cell_playback[p_sys->i_cur_cell].playback_time, 0 );
+        p_sys->i_cell_duration = (vlc_tick_t)dvdtime_to_time( &p_sys->p_cur_pgc->cell_playback[p_sys->i_cur_cell].playback_time, 0 );
     }
 
 
@@ -1270,7 +1270,7 @@ static void DvdReadHandleDSI( demux_t *p_demux, uint8_t *p_data )
              dvdtime_to_time( &p_sys->dsi_pack.dsi_gi.c_eltm, 0 ) );
 
     msg_Dbg( p_demux, "cell duration: %lld",
-             (mtime_t)dvdtime_to_time( &p_sys->p_cur_pgc->cell_playback[p_sys->i_cur_cell].playback_time, 0 ) );
+             (vlc_tick_t)dvdtime_to_time( &p_sys->p_cur_pgc->cell_playback[p_sys->i_cur_cell].playback_time, 0 ) );
 
     msg_Dbg( p_demux, "cat 0x%02x ilvu_ea %d ilvu_sa %d size %d",
              p_sys->dsi_pack.sml_pbi.category,
diff --git a/modules/access/idummy.c b/modules/access/idummy.c
index aa80868975..1672c71aa2 100644
--- a/modules/access/idummy.c
+++ b/modules/access/idummy.c
@@ -62,14 +62,14 @@ static int DemuxHold( demux_t *demux )
 
 typedef struct
 {
-    mtime_t end;
-    mtime_t length;
+    vlc_tick_t end;
+    vlc_tick_t length;
 } demux_sys_t;
 
 static int DemuxPause( demux_t *demux )
 {
     demux_sys_t *p_sys = demux->p_sys;
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
 
     if( now >= p_sys->end )
         return 0;
@@ -88,7 +88,7 @@ static int ControlPause( demux_t *demux, int query, va_list args )
         {
             double *ppos = va_arg( args, double * );
             double pos;
-            mtime_t now = mdate();
+            vlc_tick_t now = mdate();
 
             pos = 1. + ((double)(now - p_sys->end) / (double)p_sys->length);
             *ppos = (pos <= 1.) ? pos : 1.;
@@ -98,7 +98,7 @@ static int ControlPause( demux_t *demux, int query, va_list args )
         case DEMUX_SET_POSITION:
         {
             double pos = va_arg( args, double );
-            mtime_t now = mdate();
+            vlc_tick_t now = mdate();
 
             p_sys->end = now + (p_sys->length * (1. - pos));
             break;
@@ -106,21 +106,21 @@ static int ControlPause( demux_t *demux, int query, va_list args )
 
         case DEMUX_GET_LENGTH:
         {
-            mtime_t *plen = va_arg( args, mtime_t * );
+            vlc_tick_t *plen = va_arg( args, vlc_tick_t * );
             *plen = p_sys->length;
             break;
         }
 
         case DEMUX_GET_TIME:
         {
-            mtime_t *ppos = va_arg( args, mtime_t * );
+            vlc_tick_t *ppos = va_arg( args, vlc_tick_t * );
             *ppos = mdate() + p_sys->length - p_sys->end;
             break;
         }
 
         case DEMUX_SET_TIME:
         {
-            mtime_t pos = va_arg( args, mtime_t );
+            vlc_tick_t pos = va_arg( args, vlc_tick_t );
             p_sys->end = mdate() + p_sys->length - pos;
             break;
         }
@@ -178,7 +178,7 @@ nop:
     if( !strncasecmp( psz_name, "pause:", 6 ) )
     {
         double f = us_atof( psz_name + 6 );
-        mtime_t length = f * CLOCK_FREQ;
+        vlc_tick_t length = f * CLOCK_FREQ;
 
         msg_Info( p_demux, "command `pause %f'", f );
         if( length == 0 )
diff --git a/modules/access/imem.c b/modules/access/imem.c
index 552ecb6773..edbb525669 100644
--- a/modules/access/imem.c
+++ b/modules/access/imem.c
@@ -217,9 +217,9 @@ typedef struct {
 
     es_out_id_t  *es;
 
-    mtime_t      dts;
+    vlc_tick_t   dts;
 
-    mtime_t      deadline;
+    vlc_tick_t   deadline;
 } imem_sys_t;
 
 static void ParseMRL(vlc_object_t *, const char *);
@@ -549,7 +549,7 @@ static int ControlDemux(demux_t *demux, int i_query, va_list args)
         return VLC_SUCCESS;
     }
     case DEMUX_SET_NEXT_DEMUX_TIME:
-        sys->deadline = va_arg(args, mtime_t);
+        sys->deadline = va_arg(args, vlc_tick_t);
         return VLC_SUCCESS;
 
     /* */
diff --git a/modules/access/linsys/linsys_hdsdi.c b/modules/access/linsys/linsys_hdsdi.c
index 25f0aad76d..2f05f06a2a 100644
--- a/modules/access/linsys/linsys_hdsdi.c
+++ b/modules/access/linsys/linsys_hdsdi.c
@@ -147,7 +147,7 @@ typedef struct
     unsigned int i_frame_rate, i_frame_rate_base;
     unsigned int i_width, i_height, i_aspect, i_forced_aspect;
     unsigned int i_vblock_size, i_ablock_size;
-    mtime_t      i_next_vdate, i_next_adate;
+    vlc_tick_t   i_next_vdate, i_next_adate;
     int          i_incr, i_aincr;
 
     /* ES stuff */
@@ -631,7 +631,7 @@ static int HandleAudio( demux_t *p_demux, const uint8_t *p_buffer )
                         p_audio->i_channel * 2, p_sys->i_max_channel + 1 );
 
             p_block->i_dts = p_block->i_pts
-                = p_sys->i_next_adate + (mtime_t)p_audio->i_delay
+                = p_sys->i_next_adate + (vlc_tick_t)p_audio->i_delay
                    * CLOCK_FREQ / p_sys->i_sample_rate;
             p_block->i_length = p_sys->i_aincr;
             es_out_Send( p_demux->out, p_audio->p_es, p_block );
diff --git a/modules/access/linsys/linsys_sdi.c b/modules/access/linsys/linsys_sdi.c
index 5bad1682cd..0c40c29983 100644
--- a/modules/access/linsys/linsys_sdi.c
+++ b/modules/access/linsys/linsys_sdi.c
@@ -157,7 +157,7 @@ typedef struct
 
     /* SDI sync */
     int              i_state;
-    mtime_t          i_last_state_change;
+    vlc_tick_t       i_last_state_change;
     unsigned int     i_anc_size, i_active_size, i_picture_size;
     unsigned int     i_line_offset, i_nb_lines;
 
@@ -178,7 +178,7 @@ typedef struct
     char             *psz_telx, *psz_telx_lang;
     bool             b_hd, b_vbi;
     vbi_raw_decoder  rd_wss, rd_telx;
-    mtime_t          i_next_date;
+    vlc_tick_t       i_next_date;
     int              i_incr;
 
     /* ES stuff */
@@ -931,7 +931,7 @@ static int DecodeAudio( demux_t *p_demux, sdi_audio_t *p_audio )
     if( unlikely( !p_block ) )
         return VLC_ENOMEM;
     p_block->i_dts = p_block->i_pts = p_sys->i_next_date
-        + (mtime_t)p_audio->i_delay * CLOCK_FREQ / p_audio->i_rate;
+        + (vlc_tick_t)p_audio->i_delay * CLOCK_FREQ / p_audio->i_rate;
     p_output = (int16_t *)p_block->p_buffer;
 
     if ( p_audio->i_left_samples == p_audio->i_nb_samples &&
diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 6f8c896292..4e31139066 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -215,7 +215,7 @@ struct demux_sys_t
     bool             b_real;
 
     /* */
-    mtime_t          i_pcr; /* The clock */
+    vlc_tick_t       i_pcr; /* The clock */
     bool             b_rtcp_sync; /* At least one track received sync */
     double           f_npt;
     double           f_npt_length;
@@ -1267,7 +1267,7 @@ static int Play( demux_t *p_demux )
             timeout = 60; /* default value from RFC2326 */
         msg_Dbg( p_demux, "We have a timeout of %d seconds", timeout );
 
-        mtime_t interval = (timeout - 2) * CLOCK_FREQ;
+        vlc_tick_t interval = (timeout - 2) * CLOCK_FREQ;
         vlc_timer_schedule( p_sys->timer, false, interval, interval);
     }
     p_sys->i_pcr = VLC_TS_INVALID;
@@ -1419,7 +1419,7 @@ static int Demux( demux_t *p_demux )
 
     if( b_send_pcr )
     {
-        mtime_t i_minpcr = VLC_TS_INVALID;
+        vlc_tick_t i_minpcr = VLC_TS_INVALID;
         bool b_need_flush = false;
 
         /* Check for gap in pts value */
diff --git a/modules/access/oss.c b/modules/access/oss.c
index 0551a67b38..e58a2e7b90 100644
--- a/modules/access/oss.c
+++ b/modules/access/oss.c
@@ -121,7 +121,7 @@ typedef struct
     block_t *p_block;
     es_out_id_t *p_es;
 
-    mtime_t i_next_demux_date; /* Used to handle oss:// as input-slave properly */
+    vlc_tick_t i_next_demux_date; /* Used to handle oss:// as input-slave properly */
 } demux_sys_t;
 
 static int FindMainDevice( demux_t *p_demux )
@@ -228,7 +228,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_SET_NEXT_DEMUX_TIME:
-            p_sys->i_next_demux_date = va_arg( args, mtime_t );
+            p_sys->i_next_demux_date = va_arg( args, vlc_tick_t );
             return VLC_SUCCESS;
 
         /* TODO implement others */
@@ -320,7 +320,7 @@ static block_t* GrabAudio( demux_t *p_demux )
 
     /* Timestamp */
     p_block->i_pts = p_block->i_dts =
-        mdate() - CLOCK_FREQ * (mtime_t)i_correct /
+        mdate() - CLOCK_FREQ * (vlc_tick_t)i_correct /
         2 / ( p_sys->b_stereo ? 2 : 1) / p_sys->i_sample_rate;
 
     return p_block;
diff --git a/modules/access/pulse.c b/modules/access/pulse.c
index f3ec93a498..1423b346b8 100644
--- a/modules/access/pulse.c
+++ b/modules/access/pulse.c
@@ -59,7 +59,7 @@ typedef struct
     es_out_id_t *es;
     bool discontinuity; /**< The next block will not follow the last one */
     unsigned framesize; /**< Byte size of a sample */
-    mtime_t caching; /**< Caching value */
+    vlc_tick_t caching; /**< Caching value */
 } demux_sys_t;
 
 /* Stream helpers */
@@ -161,7 +161,7 @@ static void stream_read_cb(pa_stream *s, size_t length, void *userdata)
         return;
     }
 
-    mtime_t pts = mdate();
+    vlc_tick_t pts = mdate();
     pa_usec_t latency;
     int negative;
 
diff --git a/modules/access/qtsound.m b/modules/access/qtsound.m
index 8c0b09975b..0c368c21f3 100644
--- a/modules/access/qtsound.m
+++ b/modules/access/qtsound.m
@@ -76,14 +76,14 @@ vlc_module_end ()
     void *rawAudioData;
     UInt32 numberOfSamples;
     date_t date;
-    mtime_t currentPts;
-    mtime_t previousPts;
+    vlc_tick_t currentPts;
+    vlc_tick_t previousPts;
 }
 - (id)initWithDemux:(demux_t *)p_demux;
 - (void)outputAudioSampleBuffer:(QTSampleBuffer *)sampleBuffer fromConnection:(QTCaptureConnection *)connection;
 - (BOOL)checkCurrentAudioBuffer;
 - (void)freeAudioMem;
-- (mtime_t)getCurrentPts;
+- (vlc_tick_t)getCurrentPts;
 - (void *)getCurrentAudioBufferData;
 - (UInt32)getCurrentTotalDataSize;
 - (UInt32)getNumberOfSamples;
@@ -184,10 +184,10 @@ vlc_module_end ()
     FREENULL(rawAudioData);
 }
 
-- (mtime_t)getCurrentPts
+- (vlc_tick_t)getCurrentPts
 {
     /* FIXME: can this getter be minimized? */
-    mtime_t pts;
+    vlc_tick_t pts;
 
     if(!currentAudioBuffer || currentPts == previousPts)
         return 0;
diff --git a/modules/access/rdp.c b/modules/access/rdp.c
index e1a42ed08a..6188618e27 100644
--- a/modules/access/rdp.c
+++ b/modules/access/rdp.c
@@ -112,7 +112,7 @@ typedef struct
 
     float f_fps;
     int i_frame_interval;
-    mtime_t i_starttime;
+    vlc_tick_t i_starttime;
 
     es_out_id_t *es;
 
@@ -340,7 +340,7 @@ static void *DemuxThread( void *p_data )
     demux_t *p_demux = (demux_t *) p_data;
     demux_sys_t *p_sys = p_demux->p_sys;
     p_sys->i_starttime = mdate();
-    mtime_t i_next_frame_date = mdate() + p_sys->i_frame_interval;
+    vlc_tick_t i_next_frame_date = mdate() + p_sys->i_frame_interval;
     int i_ret;
 
     for(;;)
diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index cf9d9a7cad..9f8f8e72fd 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -85,12 +85,12 @@ drop:
     block_Release (block);
 }
 
-static int rtp_timeout (mtime_t deadline)
+static int rtp_timeout (vlc_tick_t deadline)
 {
     if (deadline == VLC_TS_INVALID)
         return -1; /* infinite */
 
-    mtime_t t = mdate ();
+    vlc_tick_t t = mdate ();
     if (t >= deadline)
         return 0;
 
@@ -107,7 +107,7 @@ void *rtp_dgram_thread (void *opaque)
 {
     demux_t *demux = opaque;
     demux_sys_t *sys = demux->p_sys;
-    mtime_t deadline = VLC_TS_INVALID;
+    vlc_tick_t deadline = VLC_TS_INVALID;
     int rtp_fd = sys->fd;
     struct iovec iov =
     {
diff --git a/modules/access/rtp/rtp.h b/modules/access/rtp/rtp.h
index 50f3f50e49..fca75f58df 100644
--- a/modules/access/rtp/rtp.h
+++ b/modules/access/rtp/rtp.h
@@ -54,7 +54,7 @@ void xiph_decode (demux_t *demux, void *data, block_t *block);
 rtp_session_t *rtp_session_create (demux_t *);
 void rtp_session_destroy (demux_t *, rtp_session_t *);
 void rtp_queue (demux_t *, rtp_session_t *, block_t *);
-bool rtp_dequeue (demux_t *, const rtp_session_t *, mtime_t *);
+bool rtp_dequeue (demux_t *, const rtp_session_t *, vlc_tick_t *);
 void rtp_dequeue_force (demux_t *, const rtp_session_t *);
 int rtp_add_type (demux_t *demux, rtp_session_t *ses, const rtp_pt_t *pt);
 
@@ -73,7 +73,7 @@ typedef struct
     int           rtcp_fd;
     vlc_thread_t  thread;
 
-    mtime_t       timeout;
+    vlc_tick_t    timeout;
     uint16_t      max_dropout; /**< Max packet forward misordering */
     uint16_t      max_misorder; /**< Max packet backward misordering */
     uint8_t       max_src; /**< Max simultaneous RTP sources */
diff --git a/modules/access/rtp/session.c b/modules/access/rtp/session.c
index 715c02a07f..fa668f8a62 100644
--- a/modules/access/rtp/session.c
+++ b/modules/access/rtp/session.c
@@ -139,11 +139,11 @@ struct rtp_source_t
 {
     uint32_t ssrc;
     uint32_t jitter;  /* interarrival delay jitter estimate */
-    mtime_t  last_rx; /* last received packet local timestamp */
+    vlc_tick_t  last_rx; /* last received packet local timestamp */
     uint32_t last_ts; /* last received packet RTP timestamp */
 
     uint32_t ref_rtp; /* sender RTP timestamp reference */
-    mtime_t  ref_ntp; /* sender NTP timestamp reference */
+    vlc_tick_t  ref_ntp; /* sender NTP timestamp reference */
 
     uint16_t bad_seq; /* tentatively next expected sequence for resync */
     uint16_t max_seq; /* next expected sequence */
@@ -256,7 +256,7 @@ rtp_queue (demux_t *demux, rtp_session_t *session, block_t *block)
         block->i_buffer -= padding;
     }
 
-    mtime_t        now = mdate ();
+    vlc_tick_t     now = mdate ();
     rtp_source_t  *src  = NULL;
     const uint16_t seq  = rtp_seq (block);
     const uint32_t ssrc = GetDWBE (block->p_buffer + 8);
@@ -391,9 +391,9 @@ static void rtp_decode (demux_t *, const rtp_session_t *, rtp_source_t *);
  * In the later case, *deadlinep is undefined.
  */
 bool rtp_dequeue (demux_t *demux, const rtp_session_t *session,
-                  mtime_t *restrict deadlinep)
+                  vlc_tick_t *restrict deadlinep)
 {
-    mtime_t now = mdate ();
+    vlc_tick_t now = mdate ();
     bool pending = false;
 
     *deadlinep = INT64_MAX;
@@ -430,7 +430,7 @@ bool rtp_dequeue (demux_t *demux, const rtp_session_t *session,
             /* Wait for 3 times the inter-arrival delay variance (about 99.7%
              * match for random gaussian jitter).
              */
-            mtime_t deadline;
+            vlc_tick_t deadline;
             const rtp_pt_t *pt = rtp_find_ptype (session, src, block, NULL);
             if (pt)
                 deadline = CLOCK_FREQ * 3 * src->jitter / pt->frequency;
diff --git a/modules/access/satip.c b/modules/access/satip.c
index 2e5c7ad5b4..81d45d6b37 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -425,9 +425,9 @@ static void *satip_thread(void *data) {
     stream_t *access = data;
     access_sys_t *sys = access->p_sys;
     int sock = sys->udp_sock;
-    mtime_t last_recv = mdate();
+    vlc_tick_t last_recv = mdate();
     ssize_t len;
-    mtime_t next_keepalive = mdate() + sys->keepalive_interval * 1000 * 1000;
+    vlc_tick_t next_keepalive = mdate() + sys->keepalive_interval * 1000 * 1000;
 #ifdef HAVE_RECVMMSG
     struct mmsghdr msgs[VLEN];
     struct iovec iovecs[VLEN];
diff --git a/modules/access/screen/screen.h b/modules/access/screen/screen.h
index e0713d2d04..53bafc564d 100644
--- a/modules/access/screen/screen.h
+++ b/modules/access/screen/screen.h
@@ -45,10 +45,10 @@ typedef struct
     es_out_id_t *es;
 
     float f_fps;
-    mtime_t i_next_date;
+    vlc_tick_t i_next_date;
     int i_incr;
 
-    mtime_t i_start;
+    vlc_tick_t i_start;
 
 #ifdef SCREEN_SUBSCREEN
     bool b_follow_mouse;
diff --git a/modules/access/screen/wayland.c b/modules/access/screen/wayland.c
index 7ba84443f8..d528a09656 100644
--- a/modules/access/screen/wayland.c
+++ b/modules/access/screen/wayland.c
@@ -59,7 +59,7 @@ typedef struct
     int32_t height; /*< Actual height */
 
     bool done;
-    mtime_t start;
+    vlc_tick_t start;
 
     vlc_thread_t thread;
 } demux_sys_t;
diff --git a/modules/access/screen/xcb.c b/modules/access/screen/xcb.c
index 47203d8d31..9a6e21457f 100644
--- a/modules/access/screen/xcb.c
+++ b/modules/access/screen/xcb.c
@@ -237,7 +237,7 @@ static int Open (vlc_object_t *obj)
     if (!p_sys->rate)
         goto error;
 
-    mtime_t interval = (float)CLOCK_FREQ / p_sys->rate;
+    vlc_tick_t interval = (float)CLOCK_FREQ / p_sys->rate;
     if (!interval)
         goto error;
 
diff --git a/modules/access/shm.c b/modules/access/shm.c
index 1d19266204..d165c710e5 100644
--- a/modules/access/shm.c
+++ b/modules/access/shm.c
@@ -226,7 +226,7 @@ static int Open (vlc_object_t *obj)
     if (rate <= 0.f)
         goto error;
 
-    mtime_t interval = llroundf((float)CLOCK_FREQ / rate);
+    vlc_tick_t interval = llroundf((float)CLOCK_FREQ / rate);
     if (!interval)
         goto error;
 
diff --git a/modules/access/timecode.c b/modules/access/timecode.c
index 551a2e010c..fecc8d534b 100644
--- a/modules/access/timecode.c
+++ b/modules/access/timecode.c
@@ -55,13 +55,13 @@ typedef struct
 {
     es_out_id_t *es;
     date_t date;
-    mtime_t next_time;
+    vlc_tick_t next_time;
 } demux_sys_t;
 
 static int DemuxOnce (demux_t *demux, bool master)
 {
     demux_sys_t *sys = demux->p_sys;
-    mtime_t pts = date_Get (&sys->date);
+    vlc_tick_t pts = date_Get (&sys->date);
     lldiv_t d;
     unsigned h, m, s, f;
 
@@ -134,7 +134,7 @@ static int Control (demux_t *demux, int query, va_list args)
 
         case DEMUX_SET_NEXT_DEMUX_TIME:
         {
-            const mtime_t pts = va_arg (args, mtime_t );
+            const vlc_tick_t pts = va_arg (args, vlc_tick_t );
 
             if (sys->next_time == VLC_TS_INVALID) /* first invocation? */
             {
diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c
index 99ec83f624..d73272dd21 100644
--- a/modules/access/v4l2/demux.c
+++ b/modules/access/v4l2/demux.c
@@ -57,7 +57,7 @@ typedef struct
 
     es_out_id_t *es;
     vlc_v4l2_ctrl_t *controls;
-    mtime_t start;
+    vlc_tick_t start;
 
 #ifdef ZVBI_COMPILED
     vlc_v4l2_vbi_t *vbi;
diff --git a/modules/access/v4l2/radio.c b/modules/access/v4l2/radio.c
index bc458f71b9..4469b9b8b4 100644
--- a/modules/access/v4l2/radio.c
+++ b/modules/access/v4l2/radio.c
@@ -34,7 +34,7 @@ typedef struct
 {
     int fd;
     vlc_v4l2_ctrl_t *controls;
-    mtime_t start;
+    vlc_tick_t start;
 } demux_sys_t;
 
 static int RadioControl (demux_t *demux, int query, va_list args)
diff --git a/modules/access/v4l2/v4l2.h b/modules/access/v4l2/v4l2.h
index d1458b8666..c8ebd7b15e 100644
--- a/modules/access/v4l2/v4l2.h
+++ b/modules/access/v4l2/v4l2.h
@@ -55,7 +55,7 @@ int StartUserPtr (vlc_object_t *, int);
 struct buffer_t *StartMmap (vlc_object_t *, int, uint32_t *);
 void StopMmap (int, struct buffer_t *, uint32_t);
 
-mtime_t GetBufferPTS (const struct v4l2_buffer *);
+vlc_tick_t GetBufferPTS (const struct v4l2_buffer *);
 block_t* GrabVideo (vlc_object_t *, int, const struct buffer_t *);
 
 #ifdef ZVBI_COMPILED
diff --git a/modules/access/v4l2/video.c b/modules/access/v4l2/video.c
index 26b67d3450..e3e11b5f5e 100644
--- a/modules/access/v4l2/video.c
+++ b/modules/access/v4l2/video.c
@@ -560,9 +560,9 @@ int SetupFormat (vlc_object_t *obj, int fd, uint32_t fourcc,
     return 0;
 }
 
-mtime_t GetBufferPTS (const struct v4l2_buffer *buf)
+vlc_tick_t GetBufferPTS (const struct v4l2_buffer *buf)
 {
-    mtime_t pts;
+    vlc_tick_t pts;
 
     switch (buf->flags & V4L2_BUF_FLAG_TIMESTAMP_MASK)
     {
diff --git a/modules/access/vnc.c b/modules/access/vnc.c
index 023af5fdb1..12d9b3cbc3 100644
--- a/modules/access/vnc.c
+++ b/modules/access/vnc.c
@@ -122,7 +122,7 @@ typedef struct
 
     float f_fps;
     int i_frame_interval;
-    mtime_t i_starttime;
+    vlc_tick_t i_starttime;
 
     es_out_id_t *es;
 } demux_sys_t;
@@ -337,7 +337,7 @@ static void *DemuxThread( void *p_data )
 {
     demux_t *p_demux = (demux_t *) p_data;
     demux_sys_t  *p_sys = p_demux->p_sys;
-    mtime_t i_next_frame_date = mdate() + p_sys->i_frame_interval;
+    vlc_tick_t i_next_frame_date = mdate() + p_sys->i_frame_interval;
     int i_status;
 
     for(;;)
diff --git a/modules/access/wasapi.c b/modules/access/wasapi.c
index 0aa6cb6d52..226682b56d 100644
--- a/modules/access/wasapi.c
+++ b/modules/access/wasapi.c
@@ -223,7 +223,7 @@ static int vlc_FromWave(const WAVEFORMATEX *restrict wf,
 }
 
 static es_out_id_t *CreateES(demux_t *demux, IAudioClient *client, bool loop,
-                             mtime_t caching, size_t *restrict frame_size)
+                             vlc_tick_t caching, size_t *restrict frame_size)
 {
     es_format_t fmt;
     WAVEFORMATEX *pwf;
@@ -273,8 +273,8 @@ typedef struct
     es_out_id_t *es;
 
     size_t frame_size;
-    mtime_t caching;
-    mtime_t start_time;
+    vlc_tick_t caching;
+    vlc_tick_t start_time;
 
     HANDLE events[2];
     union {
@@ -318,7 +318,7 @@ static unsigned __stdcall Thread(void *data)
         UINT32 frames;
         DWORD flags;
         UINT64 qpc;
-        mtime_t pts;
+        vlc_tick_t pts;
 
         hr = IAudioCaptureClient_GetBuffer(capture, &data, &frames, &flags,
                                            NULL, &qpc);
diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 30c33a1452..aea247e2dc 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -179,10 +179,10 @@ typedef struct
     char *psz_indexPath;
     char *psz_indexUrl;
     char *psz_keyfile;
-    mtime_t i_keyfile_modification;
-    mtime_t i_opendts;
-    mtime_t i_dts_offset;
-    mtime_t  i_seglenm;
+    vlc_tick_t i_keyfile_modification;
+    vlc_tick_t i_opendts;
+    vlc_tick_t i_dts_offset;
+    vlc_tick_t  i_seglenm;
     uint32_t i_segment;
     size_t  i_seglen;
     float   f_seglen;
@@ -947,7 +947,7 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
     msg_Dbg( p_access, "Writing all full segments" );
 
     block_t *output = p_sys->full_segments;
-    mtime_t output_last_length = 0;
+    vlc_tick_t output_last_length = 0;
     if( output )
         output_last_length = output->i_length;
     if( *p_sys->full_segments_end )
diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index 103f9cdcdc..0818b21cf3 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -107,11 +107,11 @@ static ssize_t Write   ( sout_access_out_t *, block_t * );
 static int Control( sout_access_out_t *, int, va_list );
 
 static void* ThreadWrite( void * );
-static block_t *NewUDPPacket( sout_access_out_t *, mtime_t );
+static block_t *NewUDPPacket( sout_access_out_t *, vlc_tick_t );
 
 typedef struct
 {
-    mtime_t       i_caching;
+    vlc_tick_t    i_caching;
     int           i_handle;
     bool          b_mtu_warning;
     size_t        i_mtu;
@@ -277,7 +277,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
     {
         block_t *p_next;
         int i_packets = 0;
-        mtime_t now = mdate();
+        vlc_tick_t now = mdate();
 
         if( !p_sys->b_mtu_warning && p_buffer->i_buffer > p_sys->i_mtu )
         {
@@ -352,7 +352,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 /*****************************************************************************
  * NewUDPPacket: allocate a new UDP packet of size p_sys->i_mtu
  *****************************************************************************/
-static block_t *NewUDPPacket( sout_access_out_t *p_access, mtime_t i_dts)
+static block_t *NewUDPPacket( sout_access_out_t *p_access, vlc_tick_t i_dts)
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     block_t *p_buffer;
@@ -387,7 +387,7 @@ static void* ThreadWrite( void *data )
 {
     sout_access_out_t *p_access = data;
     sout_access_out_sys_t *p_sys = p_access->p_sys;
-    mtime_t i_date_last = -1;
+    vlc_tick_t i_date_last = -1;
     const unsigned i_group = var_GetInteger( p_access,
                                              SOUT_CFG_PREFIX "group" );
     int i_to_send = i_group;
@@ -396,7 +396,7 @@ static void* ThreadWrite( void *data )
     for (;;)
     {
         block_t *p_pk = block_FifoGet( p_sys->p_fifo );
-        mtime_t       i_date, i_sent;
+        vlc_tick_t    i_date, i_sent;
 
         i_date = p_sys->i_caching + p_pk->i_dts;
         if( i_date_last > 0 )
diff --git a/modules/audio_filter/audiobargraph_a.c b/modules/audio_filter/audiobargraph_a.c
index 0cd5ddc5bf..a6a842946f 100644
--- a/modules/audio_filter/audiobargraph_a.c
+++ b/modules/audio_filter/audiobargraph_a.c
@@ -88,7 +88,7 @@ vlc_module_end ()
 
 typedef struct ValueDate_t {
     float value;
-    mtime_t date;
+    vlc_tick_t date;
     struct ValueDate_t* next;
 } ValueDate_t;
 
@@ -104,7 +104,7 @@ typedef struct
     ValueDate_t*    first;
     ValueDate_t*    last;
     int             started;
-    mtime_t         lastAlarm;
+    vlc_tick_t      lastAlarm;
 } filter_sys_t;
 
 /*****************************************************************************
diff --git a/modules/audio_filter/channel_mixer/spatialaudio.cpp b/modules/audio_filter/channel_mixer/spatialaudio.cpp
index 2e350a5f04..2ba5fe0383 100644
--- a/modules/audio_filter/channel_mixer/spatialaudio.cpp
+++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp
@@ -122,8 +122,8 @@ struct filter_spatialaudio
     CAmbisonicSpeaker *speakers;
 
     std::vector<float> inputSamples;
-    mtime_t i_inputPTS;
-    mtime_t i_last_input_pts;
+    vlc_tick_t i_inputPTS;
+    vlc_tick_t i_last_input_pts;
     unsigned i_order;
     unsigned i_nondiegetic;
     unsigned i_lr_channels; // number of physical left/right channel pairs
@@ -169,7 +169,7 @@ static block_t *Mix( filter_t *p_filter, block_t *p_buf )
     filter_spatialaudio *p_sys = reinterpret_cast<filter_spatialaudio *>(p_filter->p_sys);
 
     /* Detect discontinuity due to a pause */
-    static const mtime_t rounding_error = 10;
+    static const vlc_tick_t rounding_error = 10;
     if( p_sys->i_inputPTS != 0
      && p_buf->i_pts - p_sys->i_last_input_pts > rounding_error )
         Flush( p_filter );
diff --git a/modules/audio_filter/resampler/soxr.c b/modules/audio_filter/resampler/soxr.c
index 703b0545b4..6a13609e05 100644
--- a/modules/audio_filter/resampler/soxr.c
+++ b/modules/audio_filter/resampler/soxr.c
@@ -87,7 +87,7 @@ typedef struct
     soxr_t  last_soxr;
     double  f_fixed_ratio;
     size_t  i_last_olen;
-    mtime_t i_last_pts;
+    vlc_tick_t i_last_pts;
 } filter_sys_t;
 
 static block_t *Resample( filter_t *, block_t * );
@@ -290,7 +290,7 @@ static block_t *
 Resample( filter_t *p_filter, block_t *p_in )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
-    const mtime_t i_pts = p_in->i_pts;
+    const vlc_tick_t i_pts = p_in->i_pts;
 
     if( p_sys->vr_soxr )
     {
diff --git a/modules/audio_output/adummy.c b/modules/audio_output/adummy.c
index 07b72f15d1..fb342fc732 100644
--- a/modules/audio_output/adummy.c
+++ b/modules/audio_output/adummy.c
@@ -42,13 +42,13 @@ vlc_module_end ()
 
 #define A52_FRAME_NB 1536
 
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     block_Release( block );
     (void) aout; (void) date;
 }
 
-static void Pause(audio_output_t *aout, bool paused, mtime_t date)
+static void Pause(audio_output_t *aout, bool paused, vlc_tick_t date)
 {
     (void) aout; (void) paused; (void) date;
 }
diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index b9319debba..cac211c18e 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -290,10 +290,10 @@ out:
 # define SetupChannels(obj, pcm, mask, tab) (0)
 #endif
 
-static int TimeGet (audio_output_t *aout, mtime_t *);
-static void Play(audio_output_t *, block_t *, mtime_t);
-static void Pause (audio_output_t *, bool, mtime_t);
-static void PauseDummy (audio_output_t *, bool, mtime_t);
+static int TimeGet (audio_output_t *aout, vlc_tick_t *);
+static void Play(audio_output_t *, block_t *, vlc_tick_t);
+static void Pause (audio_output_t *, bool, vlc_tick_t);
+static void PauseDummy (audio_output_t *, bool, vlc_tick_t);
 static void Flush (audio_output_t *, bool);
 
 /** Initializes an ALSA playback stream */
@@ -629,7 +629,7 @@ error:
     return VLC_EGENERIC;
 }
 
-static int TimeGet (audio_output_t *aout, mtime_t *restrict delay)
+static int TimeGet (audio_output_t *aout, vlc_tick_t *restrict delay)
 {
     aout_sys_t *sys = aout->sys;
     snd_pcm_sframes_t frames;
@@ -647,7 +647,7 @@ static int TimeGet (audio_output_t *aout, mtime_t *restrict delay)
 /**
  * Queues one audio buffer to the hardware.
  */
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
 
@@ -693,7 +693,7 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t date)
 /**
  * Pauses/resumes the audio playback.
  */
-static void Pause (audio_output_t *aout, bool pause, mtime_t date)
+static void Pause (audio_output_t *aout, bool pause, vlc_tick_t date)
 {
     aout_sys_t *p_sys = aout->sys;
     snd_pcm_t *pcm = p_sys->pcm;
@@ -703,7 +703,7 @@ static void Pause (audio_output_t *aout, bool pause, mtime_t date)
         PauseDummy (aout, pause, date);
 }
 
-static void PauseDummy (audio_output_t *aout, bool pause, mtime_t date)
+static void PauseDummy (audio_output_t *aout, bool pause, vlc_tick_t date)
 {
     aout_sys_t *p_sys = aout->sys;
     snd_pcm_t *pcm = p_sys->pcm;
diff --git a/modules/audio_output/amem.c b/modules/audio_output/amem.c
index 82d270710e..dcba84c32d 100644
--- a/modules/audio_output/amem.c
+++ b/modules/audio_output/amem.c
@@ -81,7 +81,7 @@ typedef struct
     vlc_mutex_t lock;
 } aout_sys_t;
 
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
 
@@ -91,7 +91,7 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t date)
     block_Release (block);
 }
 
-static void Pause (audio_output_t *aout, bool paused, mtime_t date)
+static void Pause (audio_output_t *aout, bool paused, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     void (*cb) (void *, int64_t) = paused ? sys->pause : sys->resume;
diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 3b36e47308..acac7dbef2 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -109,18 +109,18 @@ typedef struct
         jobject p_obj; /* AudioTimestamp ref */
         jlong i_frame_us;
         jlong i_frame_pos;
-        mtime_t i_play_time; /* time when play was called */
-        mtime_t i_last_time;
+        vlc_tick_t i_play_time; /* time when play was called */
+        vlc_tick_t i_last_time;
     } timestamp;
 
     /* Used by AudioTrack_GetSmoothPositionUs */
     struct {
         uint32_t i_idx;
         uint32_t i_count;
-        mtime_t p_us[SMOOTHPOS_SAMPLE_COUNT];
-        mtime_t i_us;
-        mtime_t i_last_time;
-        mtime_t i_latency_us;
+        vlc_tick_t p_us[SMOOTHPOS_SAMPLE_COUNT];
+        vlc_tick_t i_us;
+        vlc_tick_t i_last_time;
+        vlc_tick_t i_latency_us;
     } smoothpos;
 
     uint32_t i_max_audiotrack_samples;
@@ -499,7 +499,7 @@ check_exception( JNIEnv *env, audio_output_t *p_aout,
 
 #define JNI_AUDIOTIMESTAMP_GET_LONG( field ) JNI_CALL( GetLongField, p_sys->timestamp.p_obj, jfields.AudioTimestamp.field )
 
-static inline mtime_t
+static inline vlc_tick_t
 frames_to_us( aout_sys_t *p_sys, uint64_t i_nb_frames )
 {
     return  i_nb_frames * CLOCK_FREQ / p_sys->fmt.i_rate;
@@ -608,12 +608,12 @@ AudioTrack_Reset( JNIEnv *env, audio_output_t *p_aout )
  * This function smooth out the AudioTrack position since it has a very bad
  * precision (+/- 20ms on old devices).
  */
-static mtime_t
+static vlc_tick_t
 AudioTrack_GetSmoothPositionUs( JNIEnv *env, audio_output_t *p_aout )
 {
     aout_sys_t *p_sys = p_aout->sys;
     uint64_t i_audiotrack_us;
-    mtime_t i_now = mdate();
+    vlc_tick_t i_now = mdate();
 
     /* Fetch an AudioTrack position every SMOOTHPOS_INTERVAL_US (30ms) */
     if( i_now - p_sys->smoothpos.i_last_time >= SMOOTHPOS_INTERVAL_US )
@@ -652,11 +652,11 @@ AudioTrack_GetSmoothPositionUs( JNIEnv *env, audio_output_t *p_aout )
         return 0;
 }
 
-static mtime_t
+static vlc_tick_t
 AudioTrack_GetTimestampPositionUs( JNIEnv *env, audio_output_t *p_aout )
 {
     aout_sys_t *p_sys = p_aout->sys;
-    mtime_t i_now;
+    vlc_tick_t i_now;
 
     if( !p_sys->timestamp.p_obj )
         return 0;
@@ -712,10 +712,10 @@ AudioTrack_GetTimestampPositionUs( JNIEnv *env, audio_output_t *p_aout )
 }
 
 static int
-TimeGet( audio_output_t *p_aout, mtime_t *restrict p_delay )
+TimeGet( audio_output_t *p_aout, vlc_tick_t *restrict p_delay )
 {
     aout_sys_t *p_sys = p_aout->sys;
-    mtime_t i_audiotrack_us;
+    vlc_tick_t i_audiotrack_us;
     JNIEnv *env;
 
     if( p_sys->b_passthrough )
@@ -734,9 +734,9 @@ TimeGet( audio_output_t *p_aout, mtime_t *restrict p_delay )
 /* Debug log for both delays */
 #if 0
 {
-    mtime_t i_written_us = FRAMES_TO_US( p_sys->i_samples_written );
-    mtime_t i_ts_us = AudioTrack_GetTimestampPositionUs( env, p_aout );
-    mtime_t i_smooth_us = 0;
+    vlc_tick_t i_written_us = FRAMES_TO_US( p_sys->i_samples_written );
+    vlc_tick_t i_ts_us = AudioTrack_GetTimestampPositionUs( env, p_aout );
+    vlc_tick_t i_smooth_us = 0;
 
     if( i_ts_us > 0 )
         i_smooth_us = AudioTrack_GetSmoothPositionUs(env, p_aout );
@@ -754,7 +754,7 @@ TimeGet( audio_output_t *p_aout, mtime_t *restrict p_delay )
     if( i_audiotrack_us > 0 )
     {
         /* AudioTrack delay */
-        mtime_t i_delay = FRAMES_TO_US( p_sys->i_samples_written )
+        vlc_tick_t i_delay = FRAMES_TO_US( p_sys->i_samples_written )
                         - i_audiotrack_us;
         if( i_delay >= 0 )
         {
@@ -1631,8 +1631,8 @@ AudioTrack_Thread( void *p_data )
     audio_output_t *p_aout = p_data;
     aout_sys_t *p_sys = p_aout->sys;
     JNIEnv *env = GET_ENV();
-    mtime_t i_play_deadline = 0;
-    mtime_t i_last_time_blocked = 0;
+    vlc_tick_t i_play_deadline = 0;
+    vlc_tick_t i_last_time_blocked = 0;
 
     if( !env )
         return NULL;
@@ -1727,7 +1727,7 @@ AudioTrack_Thread( void *p_data )
 }
 
 static void
-Play( audio_output_t *p_aout, block_t *p_buffer, mtime_t i_date )
+Play( audio_output_t *p_aout, block_t *p_buffer, vlc_tick_t i_date )
 {
     JNIEnv *env = NULL;
     size_t i_buffer_offset = 0;
@@ -1807,7 +1807,7 @@ bailout:
 }
 
 static void
-Pause( audio_output_t *p_aout, bool b_pause, mtime_t i_date )
+Pause( audio_output_t *p_aout, bool b_pause, vlc_tick_t i_date )
 {
     aout_sys_t *p_sys = p_aout->sys;
     JNIEnv *env;
diff --git a/modules/audio_output/audiounit_ios.m b/modules/audio_output/audiounit_ios.m
index a50be46c5f..8274fe9180 100644
--- a/modules/audio_output/audiounit_ios.m
+++ b/modules/audio_output/audiounit_ios.m
@@ -364,7 +364,7 @@ avas_SetActive(audio_output_t *p_aout, bool active, NSUInteger options)
 #pragma mark actual playback
 
 static void
-Pause (audio_output_t *p_aout, bool pause, mtime_t date)
+Pause (audio_output_t *p_aout, bool pause, vlc_tick_t date)
 {
     aout_sys_t * p_sys = p_aout->sys;
 
@@ -429,7 +429,7 @@ MuteSet(audio_output_t *p_aout, bool mute)
 }
 
 static void
-Play(audio_output_t * p_aout, block_t * p_block, mtime_t date)
+Play(audio_output_t * p_aout, block_t * p_block, vlc_tick_t date)
 {
     aout_sys_t * p_sys = p_aout->sys;
 
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index f160ea5e44..25441e3e0a 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -842,7 +842,7 @@ AudioStreamChangeFormat(audio_output_t *p_aout, AudioStreamID i_stream_id,
          * set. */
         if (i > 0)
         {
-            mtime_t timeout = mdate() + CLOCK_FREQ/2;
+            vlc_tick_t timeout = mdate() + CLOCK_FREQ/2;
             if (vlc_cond_timedwait(&w.cond, &w.lock, timeout))
                 msg_Dbg(p_aout, "reached timeout");
         }
@@ -1064,7 +1064,7 @@ WarnConfiguration(audio_output_t *p_aout)
  */
 static int
 StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt,
-            mtime_t i_latency_us)
+            vlc_tick_t i_latency_us)
 {
     aout_sys_t                  *p_sys = p_aout->sys;
     OSStatus                    err = noErr;
@@ -1152,7 +1152,7 @@ error:
  */
 static int
 StartSPDIF(audio_output_t * p_aout, audio_sample_format_t *fmt,
-           mtime_t i_latency_us)
+           vlc_tick_t i_latency_us)
 {
     aout_sys_t *p_sys = p_aout->sys;
     int ret;
@@ -1609,7 +1609,7 @@ Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
     UInt32 i_latency_samples;
     AO_GET1PROP(p_sys->i_selected_dev, UInt32, &i_latency_samples,
                 kAudioDevicePropertyLatency, kAudioObjectPropertyScopeOutput);
-    mtime_t i_latency_us = i_latency_samples * CLOCK_FREQ / fmt->i_rate;
+    vlc_tick_t i_latency_us = i_latency_samples * CLOCK_FREQ / fmt->i_rate;
 
     /* Check for Digital mode or Analog output mode */
     if (do_spdif)
diff --git a/modules/audio_output/coreaudio_common.c b/modules/audio_output/coreaudio_common.c
index e43fcf6602..8b217a47f8 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -42,7 +42,7 @@ BytesToFrames(struct aout_sys_common *p_sys, size_t i_bytes)
     return i_bytes * p_sys->i_frame_length / p_sys->i_bytes_per_frame;
 }
 
-static inline mtime_t
+static inline vlc_tick_t
 FramesToUs(struct aout_sys_common *p_sys, uint64_t i_nb_frames)
 {
     return i_nb_frames * CLOCK_FREQ / p_sys->i_rate;
@@ -202,7 +202,7 @@ drop:
 }
 
 int
-ca_TimeGet(audio_output_t *p_aout, mtime_t *delay)
+ca_TimeGet(audio_output_t *p_aout, vlc_tick_t *delay)
 {
     struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
 
@@ -243,7 +243,7 @@ ca_Flush(audio_output_t *p_aout, bool wait)
 
             /* Calculate the duration of the circular buffer, in order to wait
              * for the render thread to play it all */
-            const mtime_t i_frame_us =
+            const vlc_tick_t i_frame_us =
                 FramesToUs(p_sys, BytesToFrames(p_sys, p_sys->i_out_size)) + 10000;
             lock_unlock(p_sys);
             msleep(i_frame_us);
@@ -270,7 +270,7 @@ ca_Flush(audio_output_t *p_aout, bool wait)
 }
 
 void
-ca_Pause(audio_output_t * p_aout, bool pause, mtime_t date)
+ca_Pause(audio_output_t * p_aout, bool pause, vlc_tick_t date)
 {
     struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
     VLC_UNUSED(date);
@@ -281,7 +281,7 @@ ca_Pause(audio_output_t * p_aout, bool pause, mtime_t date)
 }
 
 void
-ca_Play(audio_output_t * p_aout, block_t * p_block, mtime_t date)
+ca_Play(audio_output_t * p_aout, block_t * p_block, vlc_tick_t date)
 {
     struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
 
@@ -327,7 +327,7 @@ ca_Play(audio_output_t * p_aout, block_t * p_block, mtime_t date)
                 return;
             }
 
-            const mtime_t i_frame_us =
+            const vlc_tick_t i_frame_us =
                 FramesToUs(p_sys, BytesToFrames(p_sys, p_block->i_buffer));
 
             /* Wait for the render buffer to play the remaining data */
@@ -356,7 +356,7 @@ ca_Play(audio_output_t * p_aout, block_t * p_block, mtime_t date)
 
 int
 ca_Initialize(audio_output_t *p_aout, const audio_sample_format_t *fmt,
-              mtime_t i_dev_latency_us)
+              vlc_tick_t i_dev_latency_us)
 {
     struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
 
@@ -804,7 +804,7 @@ SetupInputLayout(audio_output_t *p_aout, const audio_sample_format_t *fmt,
 
 int
 au_Initialize(audio_output_t *p_aout, AudioUnit au, audio_sample_format_t *fmt,
-              const AudioChannelLayout *outlayout, mtime_t i_dev_latency_us,
+              const AudioChannelLayout *outlayout, vlc_tick_t i_dev_latency_us,
               bool *warn_configuration)
 {
     int ret;
diff --git a/modules/audio_output/coreaudio_common.h b/modules/audio_output/coreaudio_common.h
index 95fc9eb055..ead0c34e9e 100644
--- a/modules/audio_output/coreaudio_common.h
+++ b/modules/audio_output/coreaudio_common.h
@@ -77,7 +77,7 @@ struct aout_sys_common
     uint8_t             chans_to_reorder;
     uint8_t             chan_table[AOUT_CHAN_MAX];
     /* ca_TimeGet extra latency, in micro-seconds */
-    mtime_t             i_dev_latency_us;
+    vlc_tick_t          i_dev_latency_us;
 };
 
 void ca_Open(audio_output_t *p_aout);
@@ -87,16 +87,16 @@ void ca_Close(audio_output_t *p_aout);
 void ca_Render(audio_output_t *p_aout, uint32_t i_nb_samples, uint64_t i_host_time,
                uint8_t *p_output, size_t i_requested);
 
-int  ca_TimeGet(audio_output_t *p_aout, mtime_t *delay);
+int  ca_TimeGet(audio_output_t *p_aout, vlc_tick_t *delay);
 
 void ca_Flush(audio_output_t *p_aout, bool wait);
 
-void ca_Pause(audio_output_t * p_aout, bool pause, mtime_t date);
+void ca_Pause(audio_output_t * p_aout, bool pause, vlc_tick_t date);
 
-void ca_Play(audio_output_t * p_aout, block_t * p_block, mtime_t date);
+void ca_Play(audio_output_t * p_aout, block_t * p_block, vlc_tick_t date);
 
 int  ca_Initialize(audio_output_t *p_aout, const audio_sample_format_t *fmt,
-                   mtime_t i_dev_latency_us);
+                   vlc_tick_t i_dev_latency_us);
 
 void ca_Uninitialize(audio_output_t *p_aout);
 
@@ -106,7 +106,7 @@ AudioUnit au_NewOutputInstance(audio_output_t *p_aout, OSType comp_sub_type);
 
 int  au_Initialize(audio_output_t *p_aout, AudioUnit au,
                    audio_sample_format_t *fmt,
-                   const AudioChannelLayout *outlayout, mtime_t i_dev_latency_us,
+                   const AudioChannelLayout *outlayout, vlc_tick_t i_dev_latency_us,
                    bool *warn_configuration);
 
 void au_Uninitialize(audio_output_t *p_aout, AudioUnit au);
diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c
index b6e4573384..b781d44271 100644
--- a/modules/audio_output/directsound.c
+++ b/modules/audio_output/directsound.c
@@ -139,7 +139,7 @@ typedef struct
 } aout_sys_t;
 
 static HRESULT Flush( aout_stream_sys_t *sys, bool drain);
-static HRESULT TimeGet( aout_stream_sys_t *sys, mtime_t *delay )
+static HRESULT TimeGet( aout_stream_sys_t *sys, vlc_tick_t *delay )
 {
     DWORD read, status;
     HRESULT hr;
@@ -176,12 +176,12 @@ static HRESULT TimeGet( aout_stream_sys_t *sys, mtime_t *delay )
     return DS_OK;
 }
 
-static HRESULT StreamTimeGet( aout_stream_t *s, mtime_t *delay )
+static HRESULT StreamTimeGet( aout_stream_t *s, vlc_tick_t *delay )
 {
     return TimeGet( s->sys, delay );
 }
 
-static int OutputTimeGet( audio_output_t *aout, mtime_t *delay )
+static int OutputTimeGet( audio_output_t *aout, vlc_tick_t *delay )
 {
     aout_sys_t *sys = aout->sys;
     return (TimeGet( &sys->s, delay ) == DS_OK) ? 0 : -1;
@@ -303,7 +303,7 @@ static HRESULT StreamPlay( aout_stream_t *s, block_t *block )
     return Play( VLC_OBJECT(s), s->sys, block );
 }
 
-static void OutputPlay( audio_output_t *aout, block_t *block, mtime_t date )
+static void OutputPlay( audio_output_t *aout, block_t *block, vlc_tick_t date )
 {
     aout_sys_t *sys = aout->sys;
     Play( VLC_OBJECT(aout), &sys->s, block );
@@ -334,7 +334,7 @@ static HRESULT StreamPause( aout_stream_t *s, bool pause )
     return Pause( s->sys, pause );
 }
 
-static void OutputPause( audio_output_t *aout, bool pause, mtime_t date )
+static void OutputPause( audio_output_t *aout, bool pause, vlc_tick_t date )
 {
     aout_sys_t *sys = aout->sys;
     Pause( &sys->s, pause );
diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c
index 4982d6c80b..25196521bb 100644
--- a/modules/audio_output/file.c
+++ b/modules/audio_output/file.c
@@ -74,8 +74,8 @@ static const int pi_channels_maps[CHANNELS_MAX+1] =
  * Local prototypes.
  *****************************************************************************/
 static int     Open        ( vlc_object_t * );
-static void    Play        ( audio_output_t *, block_t *, mtime_t );
-static void    Pause       ( audio_output_t *, bool, mtime_t );
+static void    Play        ( audio_output_t *, block_t *, vlc_tick_t );
+static void    Pause       ( audio_output_t *, bool, vlc_tick_t );
 static void    Flush       ( audio_output_t *, bool );
 
 /*****************************************************************************
@@ -316,7 +316,7 @@ static void Stop( audio_output_t *p_aout )
 /*****************************************************************************
  * Play: pretend to play a sound
  *****************************************************************************/
-static void Play( audio_output_t * p_aout, block_t *p_buffer, mtime_t date )
+static void Play( audio_output_t * p_aout, block_t *p_buffer, vlc_tick_t date )
 {
     aout_sys_t *p_sys = p_aout->sys;
     if( fwrite( p_buffer->p_buffer, p_buffer->i_buffer, 1,
@@ -335,7 +335,7 @@ static void Play( audio_output_t * p_aout, block_t *p_buffer, mtime_t date )
     (void) date;
 }
 
-static void Pause( audio_output_t *aout, bool paused, mtime_t date )
+static void Pause( audio_output_t *aout, bool paused, vlc_tick_t date )
 {
     (void) aout; (void) paused; (void) date;
 }
diff --git a/modules/audio_output/jack.c b/modules/audio_output/jack.c
index e7696e0978..e16986221a 100644
--- a/modules/audio_output/jack.c
+++ b/modules/audio_output/jack.c
@@ -62,7 +62,7 @@ typedef struct
     jack_nframes_t latency;
     float soft_gain;
     bool soft_mute;
-    mtime_t paused; /**< Time when (last) paused */
+    vlc_tick_t paused; /**< Time when (last) paused */
 } aout_sys_t;
 
 /*****************************************************************************
@@ -70,10 +70,10 @@ typedef struct
  *****************************************************************************/
 static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );
-static void Play         ( audio_output_t * p_aout, block_t *, mtime_t );
-static void Pause        ( audio_output_t *aout, bool paused, mtime_t date );
+static void Play         ( audio_output_t * p_aout, block_t *, vlc_tick_t );
+static void Pause        ( audio_output_t *aout, bool paused, vlc_tick_t date );
 static void Flush        ( audio_output_t *p_aout, bool wait );
-static int  TimeGet      ( audio_output_t *, mtime_t * );
+static int  TimeGet      ( audio_output_t *, vlc_tick_t * );
 static int  Process      ( jack_nframes_t i_frames, void *p_arg );
 static int  GraphChange  ( void *p_arg );
 
@@ -283,7 +283,7 @@ error_out:
     return status;
 }
 
-static void Play(audio_output_t * p_aout, block_t * p_block, mtime_t date)
+static void Play(audio_output_t * p_aout, block_t * p_block, vlc_tick_t date)
 {
     aout_sys_t *p_sys = p_aout->sys;
     jack_ringbuffer_t *rb = p_sys->p_jack_ringbuffer;
@@ -316,7 +316,7 @@ static void Play(audio_output_t * p_aout, block_t * p_block, mtime_t date)
 /**
  * Pause or unpause playback
  */
-static void Pause(audio_output_t *aout, bool paused, mtime_t date)
+static void Pause(audio_output_t *aout, bool paused, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
 
@@ -337,7 +337,7 @@ static void Flush(audio_output_t *p_aout, bool wait)
     /* Sleep if wait was requested */
     if( wait )
     {
-        mtime_t delay;
+        vlc_tick_t delay;
         if (!TimeGet(p_aout, &delay))
             msleep(delay);
     }
@@ -346,7 +346,7 @@ static void Flush(audio_output_t *p_aout, bool wait)
     jack_ringbuffer_reset(rb);
 }
 
-static int TimeGet(audio_output_t *p_aout, mtime_t *delay)
+static int TimeGet(audio_output_t *p_aout, vlc_tick_t *delay)
 {
     aout_sys_t * p_sys = p_aout->sys;
     jack_ringbuffer_t *rb = p_sys->p_jack_ringbuffer;
diff --git a/modules/audio_output/kai.c b/modules/audio_output/kai.c
index 6127a1cb98..b3b64c8432 100644
--- a/modules/audio_output/kai.c
+++ b/modules/audio_output/kai.c
@@ -72,10 +72,10 @@ typedef struct
  *****************************************************************************/
 static int  Open    ( vlc_object_t * );
 static void Close   ( vlc_object_t * );
-static void Play    ( audio_output_t *_p_aout, block_t *block, mtime_t );
-static void Pause   ( audio_output_t *, bool, mtime_t );
+static void Play    ( audio_output_t *_p_aout, block_t *block, vlc_tick_t );
+static void Pause   ( audio_output_t *, bool, vlc_tick_t );
 static void Flush   ( audio_output_t *, bool );
-static int  TimeGet ( audio_output_t *, mtime_t *restrict );
+static int  TimeGet ( audio_output_t *, vlc_tick_t *restrict );
 
 static ULONG APIENTRY KaiCallback ( PVOID, PVOID, ULONG );
 
@@ -233,7 +233,7 @@ exit_kai_done :
 /*****************************************************************************
  * Play: play a sound samples buffer
  *****************************************************************************/
-static void Play(audio_output_t *p_aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *p_aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *p_sys = p_aout->sys;
 
@@ -298,7 +298,7 @@ static void Close( vlc_object_t *obj )
     free(sys);
 }
 
-static void Pause( audio_output_t *aout, bool pause, mtime_t date )
+static void Pause( audio_output_t *aout, bool pause, vlc_tick_t date )
 {
     VLC_UNUSED( date );
 
@@ -331,7 +331,7 @@ static void Flush( audio_output_t *aout, bool drain )
     vlc_mutex_unlock( &buffer->mutex );
 }
 
-static int TimeGet( audio_output_t *aout, mtime_t *restrict delay )
+static int TimeGet( audio_output_t *aout, vlc_tick_t *restrict delay )
 {
     aout_sys_t            *sys = aout->sys;
     audio_sample_format_t *format = &sys->format;
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 4a07403acb..3aded2b9d3 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -124,7 +124,7 @@ static int vlc_FromHR(audio_output_t *aout, HRESULT hr)
 }
 
 /*** VLC audio output callbacks ***/
-static int TimeGet(audio_output_t *aout, mtime_t *restrict delay)
+static int TimeGet(audio_output_t *aout, vlc_tick_t *restrict delay)
 {
     aout_sys_t *sys = aout->sys;
     HRESULT hr;
@@ -136,7 +136,7 @@ static int TimeGet(audio_output_t *aout, mtime_t *restrict delay)
     return SUCCEEDED(hr) ? 0 : -1;
 }
 
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     HRESULT hr;
@@ -149,7 +149,7 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t date)
     (void) date;
 }
 
-static void Pause(audio_output_t *aout, bool paused, mtime_t date)
+static void Pause(audio_output_t *aout, bool paused, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     HRESULT hr;
diff --git a/modules/audio_output/mmdevice.h b/modules/audio_output/mmdevice.h
index 64cf730b30..f727779fe9 100644
--- a/modules/audio_output/mmdevice.h
+++ b/modules/audio_output/mmdevice.h
@@ -36,7 +36,7 @@ struct aout_stream
     struct vlc_common_members obj;
     void *sys;
 
-    HRESULT (*time_get)(aout_stream_t *, mtime_t *);
+    HRESULT (*time_get)(aout_stream_t *, vlc_tick_t *);
     HRESULT (*play)(aout_stream_t *, block_t *);
     HRESULT (*pause)(aout_stream_t *, bool);
     HRESULT (*flush)(aout_stream_t *);
@@ -62,7 +62,7 @@ typedef HRESULT (*aout_stream_start_t)(aout_stream_t *s,
  */
 typedef HRESULT (*aout_stream_stop_t)(aout_stream_t *);
 
-static inline HRESULT aout_stream_TimeGet(aout_stream_t *s, mtime_t *delay)
+static inline HRESULT aout_stream_TimeGet(aout_stream_t *s, vlc_tick_t *delay)
 {
     return (s->time_get)(s, delay);
 }
@@ -81,7 +81,7 @@ static inline HRESULT aout_stream_Flush(aout_stream_t *s, bool wait)
 {
     if (wait)
     {   /* Loosy drain emulation */
-        mtime_t delay;
+        vlc_tick_t delay;
 
         if (SUCCEEDED(aout_stream_TimeGet(s, &delay))
          && delay <= INT64_C(5000000))
diff --git a/modules/audio_output/opensles_android.c b/modules/audio_output/opensles_android.c
index f3ee62da5c..f663bccba2 100644
--- a/modules/audio_output/opensles_android.c
+++ b/modules/audio_output/opensles_android.c
@@ -150,7 +150,7 @@ static inline int bytesPerSample(void)
     return 2 /* S16 */ * 2 /* stereo */;
 }
 
-static int TimeGet(audio_output_t* aout, mtime_t* restrict drift)
+static int TimeGet(audio_output_t* aout, vlc_tick_t* restrict drift)
 {
     aout_sys_t *sys = aout->sys;
 
@@ -182,7 +182,7 @@ static void Flush(audio_output_t *aout, bool drain)
     aout_sys_t *sys = aout->sys;
 
     if (drain) {
-        mtime_t delay;
+        vlc_tick_t delay;
         if (!TimeGet(aout, &delay))
             msleep(delay);
     } else {
@@ -233,7 +233,7 @@ static int MuteSet(audio_output_t *aout, bool mute)
     return (r == SL_RESULT_SUCCESS) ? 0 : -1;
 }
 
-static void Pause(audio_output_t *aout, bool pause, mtime_t date)
+static void Pause(audio_output_t *aout, bool pause, vlc_tick_t date)
 {
     (void)date;
     aout_sys_t *sys = aout->sys;
@@ -323,7 +323,7 @@ static int WriteBuffer(audio_output_t *aout)
 /*****************************************************************************
  * Play: play a sound
  *****************************************************************************/
-static void Play(audio_output_t *aout, block_t *p_buffer, mtime_t date)
+static void Play(audio_output_t *aout, block_t *p_buffer, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
 
diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c
index 7202e95992..f46a74aad7 100644
--- a/modules/audio_output/oss.c
+++ b/modules/audio_output/oss.c
@@ -87,9 +87,9 @@ vlc_module_begin ()
     set_callbacks (Open, Close)
 vlc_module_end ()
 
-static int TimeGet (audio_output_t *, mtime_t *);
-static void Play(audio_output_t *, block_t *, mtime_t);
-static void Pause (audio_output_t *, bool, mtime_t);
+static int TimeGet (audio_output_t *, vlc_tick_t *);
+static void Play(audio_output_t *, block_t *, vlc_tick_t);
+static void Pause (audio_output_t *, bool, vlc_tick_t);
 static void Flush (audio_output_t *, bool);
 
 static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
@@ -250,7 +250,7 @@ error:
     return VLC_EGENERIC;
 }
 
-static int TimeGet (audio_output_t *aout, mtime_t *restrict pts)
+static int TimeGet (audio_output_t *aout, vlc_tick_t *restrict pts)
 {
     aout_sys_t *sys = aout->sys;
     int delay;
@@ -269,7 +269,7 @@ static int TimeGet (audio_output_t *aout, mtime_t *restrict pts)
 /**
  * Queues one audio buffer to the hardware.
  */
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     int fd = sys->fd;
@@ -292,7 +292,7 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t date)
 /**
  * Pauses/resumes the audio playback.
  */
-static void Pause (audio_output_t *aout, bool pause, mtime_t date)
+static void Pause (audio_output_t *aout, bool pause, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     int fd = sys->fd;
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index c9ff167211..560b9b891a 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -68,8 +68,8 @@ typedef struct
     pa_threaded_mainloop *mainloop; /**< PulseAudio thread */
     pa_time_event *trigger; /**< Deferred stream trigger */
     pa_cvolume cvolume; /**< actual sink input volume */
-    mtime_t first_pts; /**< Play stream timestamp of buffer start */
-    mtime_t first_date; /**< Play system timestamp of buffer start */
+    vlc_tick_t first_pts; /**< Play stream timestamp of buffer start */
+    vlc_tick_t first_date; /**< Play system timestamp of buffer start */
 
     pa_volume_t volume_force; /**< Forced volume (stream must be NULL) */
     pa_stream_flags_t flags_force; /**< Forced flags (stream must be NULL) */
@@ -222,10 +222,10 @@ static void stream_trigger_cb(pa_mainloop_api *api, pa_time_event *e,
  * in order to minimize desync and resampling during early playback.
  * @note PulseAudio lock required.
  */
-static void stream_start(pa_stream *s, audio_output_t *aout, mtime_t date)
+static void stream_start(pa_stream *s, audio_output_t *aout, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
-    mtime_t delta;
+    vlc_tick_t delta;
 
     assert (sys->first_pts != VLC_TS_INVALID);
 
@@ -439,7 +439,7 @@ static void context_cb(pa_context *ctx, pa_subscription_event_type_t type,
 
 /*** VLC audio output callbacks ***/
 
-static int TimeGet(audio_output_t *aout, mtime_t *restrict delay)
+static int TimeGet(audio_output_t *aout, vlc_tick_t *restrict delay)
 {
     aout_sys_t *sys = aout->sys;
     pa_stream *s = sys->stream;
@@ -448,7 +448,7 @@ static int TimeGet(audio_output_t *aout, mtime_t *restrict delay)
     pa_threaded_mainloop_lock(sys->mainloop);
     if (pa_stream_is_corked(s) <= 0)
     {   /* latency is relevant only if not corked */
-        mtime_t delta = vlc_pa_get_latency(aout, sys->context, s);
+        vlc_tick_t delta = vlc_pa_get_latency(aout, sys->context, s);
         if (delta != VLC_TS_INVALID)
         {
             *delay = delta;
@@ -486,7 +486,7 @@ static void *data_convert(block_t **pp)
 /**
  * Queue one audio frame to the playback stream
  */
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     pa_stream *s = sys->stream;
@@ -531,7 +531,7 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t date)
 /**
  * Cork or uncork the playback stream
  */
-static void Pause(audio_output_t *aout, bool paused, mtime_t date)
+static void Pause(audio_output_t *aout, bool paused, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     pa_stream *s = sys->stream;
@@ -568,7 +568,7 @@ static void Flush(audio_output_t *aout, bool wait)
 
         /* XXX: Loosy drain emulation.
          * See #18141: drain callback is never received */
-        mtime_t delay;
+        vlc_tick_t delay;
         if (TimeGet(aout, &delay) == 0 && delay <= INT64_C(5000000))
             msleep(delay);
     }
diff --git a/modules/audio_output/sndio.c b/modules/audio_output/sndio.c
index fedcda53ad..0063a7feae 100644
--- a/modules/audio_output/sndio.c
+++ b/modules/audio_output/sndio.c
@@ -43,8 +43,8 @@ vlc_module_begin ()
     set_callbacks (Open, Close)
 vlc_module_end ()
 
-static int TimeGet (audio_output_t *, mtime_t *);
-static void Play(audio_output_t *, block_t *, mtime_t);
+static int TimeGet (audio_output_t *, vlc_tick_t *);
+static void Play(audio_output_t *, block_t *, vlc_tick_t);
 static void Flush (audio_output_t *, bool);
 static int VolumeSet (audio_output_t *, float);
 static int MuteSet (audio_output_t *, bool);
@@ -220,17 +220,17 @@ static void PositionChanged (void *arg, int delta)
     sys->started = 1;
 }
 
-static int TimeGet (audio_output_t *aout, mtime_t *restrict delay)
+static int TimeGet (audio_output_t *aout, vlc_tick_t *restrict delay)
 {
     aout_sys_t *sys = aout->sys;
 
     if (!sys->started)
         return -1;
-    *delay = (mtime_t)sys->delay * CLOCK_FREQ / sys->rate;
+    *delay = (vlc_tick_t)sys->delay * CLOCK_FREQ / sys->rate;
     return 0;
 }
 
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
 
diff --git a/modules/audio_output/tizen_audio.c b/modules/audio_output/tizen_audio.c
index 972bb667a7..6ed34ac3d3 100644
--- a/modules/audio_output/tizen_audio.c
+++ b/modules/audio_output/tizen_audio.c
@@ -265,7 +265,7 @@ Stop( audio_output_t *p_aout )
 }
 
 static void
-Play( audio_output_t *p_aout, block_t *p_block, mtime_t date )
+Play( audio_output_t *p_aout, block_t *p_block, vlc_tick_t date )
 {
     aout_sys_t *p_sys = p_aout->sys;
 
@@ -299,7 +299,7 @@ Play( audio_output_t *p_aout, block_t *p_block, mtime_t date )
 }
 
 static void
-Pause( audio_output_t *p_aout, bool b_pause, mtime_t i_date )
+Pause( audio_output_t *p_aout, bool b_pause, vlc_tick_t i_date )
 {
     aout_sys_t *p_sys = p_aout->sys;
     (void) i_date;
diff --git a/modules/audio_output/vlcpulse.c b/modules/audio_output/vlcpulse.c
index fe0829ef0a..2cdb414bf6 100644
--- a/modules/audio_output/vlcpulse.c
+++ b/modules/audio_output/vlcpulse.c
@@ -252,7 +252,7 @@ void vlc_pa_rttime_free (pa_threaded_mainloop *mainloop, pa_time_event *e)
  * Gets latency of a PulseAudio stream.
  * \return the latency or VLC_TS_INVALID on error.
  */
-mtime_t vlc_pa_get_latency(vlc_object_t *obj, pa_context *ctx, pa_stream *s)
+vlc_tick_t vlc_pa_get_latency(vlc_object_t *obj, pa_context *ctx, pa_stream *s)
 {
     /* NOTE: pa_stream_get_latency() will report 0 rather than negative latency
      * when the write index of a playback stream is behind its read index.
diff --git a/modules/audio_output/vlcpulse.h b/modules/audio_output/vlcpulse.h
index bfd3fe0b03..1a817bc234 100644
--- a/modules/audio_output/vlcpulse.h
+++ b/modules/audio_output/vlcpulse.h
@@ -34,7 +34,7 @@ VLC_API void vlc_pa_disconnect (vlc_object_t *obj, pa_context *ctx,
 VLC_API void vlc_pa_error (vlc_object_t *, const char *msg, pa_context *);
 #define vlc_pa_error(o, m, c) vlc_pa_error(VLC_OBJECT(o), m, c)
 
-VLC_API mtime_t vlc_pa_get_latency (vlc_object_t *, pa_context *, pa_stream *);
+VLC_API vlc_tick_t vlc_pa_get_latency (vlc_object_t *, pa_context *, pa_stream *);
 #define vlc_pa_get_latency(o, c, s) vlc_pa_get_latency(VLC_OBJECT(o), c, s)
 
 VLC_API void vlc_pa_rttime_free (pa_threaded_mainloop *, pa_time_event *);
diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index 0ce85db45d..19f5cf2f20 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -98,7 +98,7 @@ typedef struct aout_stream_sys
 
 
 /*** VLC audio output callbacks ***/
-static HRESULT TimeGet(aout_stream_t *s, mtime_t *restrict delay)
+static HRESULT TimeGet(aout_stream_t *s, vlc_tick_t *restrict delay)
 {
     aout_stream_sys_t *sys = s->sys;
     void *pv;
diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index 750bd7840a..cdf38262d7 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -49,7 +49,7 @@
  *****************************************************************************/
 static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );
-static void Play         ( audio_output_t *, block_t *, mtime_t );
+static void Play         ( audio_output_t *, block_t *, vlc_tick_t );
 
 /*****************************************************************************
  * notification_thread_t: waveOut event thread
@@ -79,9 +79,9 @@ static void WaveOutClearBuffer( HWAVEOUT, WAVEHDR *);
 
 static int ReloadWaveoutDevices( const char *, char ***, char *** );
 static uint32_t findDeviceID(char *);
-static int WaveOutTimeGet(audio_output_t * , mtime_t *);
+static int WaveOutTimeGet(audio_output_t * , vlc_tick_t *);
 static void WaveOutFlush( audio_output_t *, bool);
-static void WaveOutPause( audio_output_t *, bool, mtime_t);
+static void WaveOutPause( audio_output_t *, bool, vlc_tick_t);
 static int WaveoutVolumeSet(audio_output_t * p_aout, float volume);
 static int WaveoutMuteSet(audio_output_t * p_aout, bool mute);
 
@@ -122,7 +122,7 @@ struct aout_sys_t
     uint8_t chan_table[AOUT_CHAN_MAX];
     vlc_fourcc_t format;
 
-    mtime_t i_played_length;
+    vlc_tick_t i_played_length;
 
     struct lkwavehdr * p_free_list;
 
@@ -343,7 +343,7 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
  * This doesn't actually play the buffer. This just stores the buffer so it
  * can be played by the callback thread.
  *****************************************************************************/
-static void Play( audio_output_t *p_aout, block_t *block, mtime_t date )
+static void Play( audio_output_t *p_aout, block_t *block, vlc_tick_t date )
 {
     aout_sys_t *sys = p_aout->sys;
 
@@ -849,7 +849,7 @@ static void Close(vlc_object_t *obj)
     free(sys);
 }
 
-static int WaveOutTimeGet(audio_output_t * p_aout, mtime_t *delay)
+static int WaveOutTimeGet(audio_output_t * p_aout, vlc_tick_t *delay)
 {
     MMTIME mmtime;
     mmtime.wType = TIME_SAMPLES;
@@ -865,7 +865,7 @@ static int WaveOutTimeGet(audio_output_t * p_aout, mtime_t *delay)
         return -1;
     }
 
-    mtime_t i_pos = (mtime_t) mmtime.u.sample * CLOCK_FREQ / sys->i_rate;
+    vlc_tick_t i_pos = (vlc_tick_t) mmtime.u.sample * CLOCK_FREQ / sys->i_rate;
     *delay = sys->i_played_length - i_pos;
     return 0;
 }
@@ -893,7 +893,7 @@ static void WaveOutFlush( audio_output_t *p_aout, bool wait)
     }
 }
 
-static void WaveOutPause( audio_output_t * p_aout, bool pause, mtime_t date)
+static void WaveOutPause( audio_output_t * p_aout, bool pause, vlc_tick_t date)
 {
     MMRESULT res;
     (void) date;
diff --git a/modules/audio_output/winstore.c b/modules/audio_output/winstore.c
index 494f61d332..5dcad97908 100644
--- a/modules/audio_output/winstore.c
+++ b/modules/audio_output/winstore.c
@@ -136,7 +136,7 @@ done:
     return SUCCEEDED(hr) ? 0 : -1;
 }
 
-static int TimeGet(audio_output_t *aout, mtime_t *restrict delay)
+static int TimeGet(audio_output_t *aout, vlc_tick_t *restrict delay)
 {
     aout_sys_t *sys = aout->sys;
     if( unlikely( sys->client == NULL ) )
@@ -150,7 +150,7 @@ static int TimeGet(audio_output_t *aout, mtime_t *restrict delay)
     return SUCCEEDED(hr) ? 0 : -1;
 }
 
-static void Play(audio_output_t *aout, block_t *block, mtime_t date)
+static void Play(audio_output_t *aout, block_t *block, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     if( unlikely( sys->client == NULL ) )
@@ -164,7 +164,7 @@ static void Play(audio_output_t *aout, block_t *block, mtime_t date)
     (void) date;
 }
 
-static void Pause(audio_output_t *aout, bool paused, mtime_t date)
+static void Pause(audio_output_t *aout, bool paused, vlc_tick_t date)
 {
     aout_sys_t *sys = aout->sys;
     if( unlikely( sys->client == NULL ) )
diff --git a/modules/codec/aom.c b/modules/codec/aom.c
index e7b490e51e..5c17c33f02 100644
--- a/modules/codec/aom.c
+++ b/modules/codec/aom.c
@@ -161,7 +161,7 @@ static int Decode(decoder_t *dec, block_t *block)
     }
 
     /* Associate packet PTS with decoded frame */
-    mtime_t *pkt_pts = malloc(sizeof(*pkt_pts));
+    vlc_tick_t *pkt_pts = malloc(sizeof(*pkt_pts));
     if (!pkt_pts) {
         block_Release(block);
         return VLCDEC_SUCCESS;
@@ -189,7 +189,7 @@ static int Decode(decoder_t *dec, block_t *block)
 
     /* fetches back the PTS */
     pkt_pts = img->user_priv;
-    mtime_t pts = *pkt_pts;
+    vlc_tick_t pts = *pkt_pts;
     free(pkt_pts);
 
     dec->fmt_out.i_codec = FindVlcChroma(img);
diff --git a/modules/codec/arib/substext.h b/modules/codec/arib/substext.h
index 6c89862a9b..d2ad92b180 100644
--- a/modules/codec/arib/substext.h
+++ b/modules/codec/arib/substext.h
@@ -48,7 +48,7 @@ typedef struct
 static int SubpictureTextValidate(subpicture_t *subpic,
                                   bool has_src_changed, const video_format_t *fmt_src,
                                   bool has_dst_changed, const video_format_t *fmt_dst,
-                                  mtime_t ts)
+                                  vlc_tick_t ts)
 {
     arib_spu_updater_sys_t *sys = subpic->updater.p_sys;
     VLC_UNUSED(fmt_src); VLC_UNUSED(fmt_dst); VLC_UNUSED(ts);
@@ -63,7 +63,7 @@ static int SubpictureTextValidate(subpicture_t *subpic,
 static void SubpictureTextUpdate(subpicture_t *subpic,
                                  const video_format_t *fmt_src,
                                  const video_format_t *fmt_dst,
-                                 mtime_t ts)
+                                 vlc_tick_t ts)
 {
     arib_spu_updater_sys_t *sys = subpic->updater.p_sys;
     VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 8f9408a221..e90ce7fbd1 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -106,9 +106,9 @@ typedef struct
     /*
      * Video properties
      */
-    mtime_t i_last_ref_pts;
-    mtime_t i_buggy_pts_detect;
-    mtime_t i_last_pts;
+    vlc_tick_t i_last_ref_pts;
+    vlc_tick_t i_buggy_pts_detect;
+    vlc_tick_t i_last_pts;
     bool    b_inited;
 
     /*
@@ -119,7 +119,7 @@ typedef struct
     size_t i_samples_delay; //How much samples in delay buffer
     bool b_planar;
     bool b_variable;    //Encoder can be fed with any size frames not just frame_size
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
     date_t  buffer_date;
 
     /* Multichannel (>2) channel reordering */
@@ -1069,7 +1069,7 @@ static void vlc_av_packet_Release(block_t *block)
     free(b);
 }
 
-static block_t *vlc_av_packet_Wrap(AVPacket *packet, mtime_t i_length, AVCodecContext *context )
+static block_t *vlc_av_packet_Wrap(AVPacket *packet, vlc_tick_t i_length, AVCodecContext *context )
 {
     if ( packet->data == NULL &&
          packet->flags == 0 &&
@@ -1103,7 +1103,7 @@ static block_t *vlc_av_packet_Wrap(AVPacket *packet, mtime_t i_length, AVCodecCo
 
 static void check_hurry_up( encoder_sys_t *p_sys, AVFrame *frame, encoder_t *p_enc )
 {
-    mtime_t current_date = mdate();
+    vlc_tick_t current_date = mdate();
 
     if ( current_date + HURRY_UP_GUARD3 > frame->pts )
     {
diff --git a/modules/codec/avcodec/subtitle.c b/modules/codec/avcodec/subtitle.c
index 91c391115e..86a09afc17 100644
--- a/modules/codec/avcodec/subtitle.c
+++ b/modules/codec/avcodec/subtitle.c
@@ -45,7 +45,7 @@ typedef struct
     bool b_need_ephemer; /* Does the format need the ephemer flag (no end time set) */
 } decoder_sys_t;
 
-static subpicture_t *ConvertSubtitle(decoder_t *, AVSubtitle *, mtime_t pts,
+static subpicture_t *ConvertSubtitle(decoder_t *, AVSubtitle *, vlc_tick_t pts,
                                      AVCodecContext *avctx);
 static int  DecodeSubtitle(decoder_t *, block_t *);
 static void Flush(decoder_t *);
@@ -311,7 +311,7 @@ static subpicture_region_t *ConvertRegionRGBA(AVSubtitleRect *ffregion)
 /**
  * Convert a libavcodec subtitle to our format.
  */
-static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, mtime_t pts,
+static subpicture_t *ConvertSubtitle(decoder_t *dec, AVSubtitle *ffsub, vlc_tick_t pts,
                                      AVCodecContext *avctx)
 {
     subpicture_t *spu = decoder_NewSubpicture(dec, NULL);
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index f58af6545e..a9eaa38c85 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -91,7 +91,7 @@ typedef struct
     /* how many decoded frames are late */
     int     i_late_frames;
     int64_t i_last_output_frame;
-    mtime_t i_last_late_delay;
+    vlc_tick_t i_last_late_delay;
 
     /* for direct rendering */
     bool        b_direct_rendering;
@@ -756,11 +756,11 @@ static void interpolate_next_pts( decoder_t *p_dec, AVFrame *frame )
 }
 
 static void update_late_frame_count( decoder_t *p_dec, block_t *p_block,
-                                     mtime_t current_time, mtime_t i_pts, int64_t i_fnum )
+                                     vlc_tick_t current_time, vlc_tick_t i_pts, int64_t i_fnum )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
    /* Update frame late count (except when doing preroll) */
-   mtime_t i_display_date = VLC_TS_INVALID;
+   vlc_tick_t i_display_date = VLC_TS_INVALID;
    if( !p_block || !(p_block->i_flags & BLOCK_FLAG_PREROLL) )
        i_display_date = decoder_GetDisplayDate( p_dec, i_pts );
 
@@ -1140,12 +1140,12 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
         /* Compute the PTS */
 #ifdef FF_API_PKT_PTS
-        mtime_t i_pts = frame->pts;
+        vlc_tick_t i_pts = frame->pts;
 
         if (i_pts == AV_NOPTS_VALUE )
             i_pts = frame->pkt_dts;
 #else
-        mtime_t i_pts = frame->pkt_pts;
+        vlc_tick_t i_pts = frame->pkt_pts;
 #endif
         if( i_pts == AV_NOPTS_VALUE )
             i_pts = date_Get( &p_sys->pts );
diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 3b7f22bfbc..29513318f9 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -231,7 +231,7 @@ typedef struct
 static int Decode( decoder_t *, block_t * );
 static void Flush( decoder_t * );
 
-static void DTVCC_ServiceData_Handler( void *priv, uint8_t i_sid, mtime_t i_time,
+static void DTVCC_ServiceData_Handler( void *priv, uint8_t i_sid, vlc_tick_t i_time,
                                        const uint8_t *p_data, size_t i_data )
 {
     decoder_t *p_dec = priv;
@@ -340,7 +340,7 @@ static void Flush( decoder_t *p_dec )
  ****************************************************************************/
 static void     Push( decoder_t *, block_t * );
 static block_t *Pop( decoder_t *, bool );
-static void     Convert( decoder_t *, mtime_t, const uint8_t *, size_t );
+static void     Convert( decoder_t *, vlc_tick_t, const uint8_t *, size_t );
 
 static bool DoDecode( decoder_t *p_dec, bool b_drain )
 {
@@ -482,7 +482,7 @@ static block_t *Pop( decoder_t *p_dec, bool b_forced )
     return p_block;
 }
 
-static subpicture_t *Subtitle( decoder_t *p_dec, eia608_t *h, mtime_t i_pts )
+static subpicture_t *Subtitle( decoder_t *p_dec, eia608_t *h, vlc_tick_t i_pts )
 {
     //decoder_sys_t *p_sys = p_dec->p_sys;
     subpicture_t *p_spu = NULL;
@@ -531,7 +531,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, eia608_t *h, mtime_t i_pts )
     return p_spu;
 }
 
-static void Convert( decoder_t *p_dec, mtime_t i_pts,
+static void Convert( decoder_t *p_dec, vlc_tick_t i_pts,
                      const uint8_t *p_buffer, size_t i_buffer )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
@@ -541,7 +541,7 @@ static void Convert( decoder_t *p_dec, mtime_t i_pts,
     {
         if( (p_buffer[0] & 0x04) /* Valid bit */ )
         {
-            const mtime_t i_spupts = i_pts + i_ticks * CLOCK_FREQ / (1200/3);
+            const vlc_tick_t i_spupts = i_pts + i_ticks * CLOCK_FREQ / (1200/3);
             /* Mask off the specific i_field bit, else some sequences can be lost. */
             if ( p_sys->p_eia608 &&
                 (p_buffer[0] & 0x03) == p_sys->i_field )
diff --git a/modules/codec/cea708.c b/modules/codec/cea708.c
index 74b6740361..0b8195bc84 100644
--- a/modules/codec/cea708.c
+++ b/modules/codec/cea708.c
@@ -45,7 +45,7 @@ struct cea708_demux_t
    uint8_t i_total_data;
    uint8_t i_data;
    uint8_t data[CEA708_DTVCC_MAX_PKT_SIZE];
-   mtime_t i_time;
+   vlc_tick_t i_time;
    service_data_hdlr_t p_callback;
    void *priv;
 };
@@ -73,7 +73,7 @@ cea708_demux_t * CEA708_DTVCC_Demuxer_New( void *priv, service_data_hdlr_t hdlr
     return h;
 }
 
-static void CEA708_DTVCC_Demux_ServiceBlocks( cea708_demux_t *h, mtime_t i_start,
+static void CEA708_DTVCC_Demux_ServiceBlocks( cea708_demux_t *h, vlc_tick_t i_start,
                                               const uint8_t *p_data, size_t i_data )
 {
     while( i_data >= 2 )
@@ -103,7 +103,7 @@ static void CEA708_DTVCC_Demux_ServiceBlocks( cea708_demux_t *h, mtime_t i_start
     }
 }
 
-void CEA708_DTVCC_Demuxer_Push( cea708_demux_t *h, mtime_t i_start, const uint8_t data[3] )
+void CEA708_DTVCC_Demuxer_Push( cea708_demux_t *h, vlc_tick_t i_start, const uint8_t data[3] )
 {
     if( (data[0] & 0x03) == 3 ) /* Header packet */
     {
@@ -442,8 +442,8 @@ struct cea708_t
 
     /* Decoding context */
     cea708_window_t *p_cw; /* current window */
-    mtime_t suspended_deadline; /* > 0 when delay is active */
-    mtime_t i_clock;
+    vlc_tick_t suspended_deadline; /* > 0 when delay is active */
+    vlc_tick_t i_clock;
     bool b_text_waiting;
 };
 
@@ -1664,7 +1664,7 @@ static void CEA708_Decode_ServiceBuffer( cea708_t *h )
     }
 }
 
-void CEA708_Decoder_Push( cea708_t *h, mtime_t i_time,
+void CEA708_Decoder_Push( cea708_t *h, vlc_tick_t i_time,
                           const uint8_t *p_data, size_t i_data )
 {
     /* Set new buffer start time */
diff --git a/modules/codec/cea708.h b/modules/codec/cea708.h
index ac33103283..8b47558d57 100644
--- a/modules/codec/cea708.h
+++ b/modules/codec/cea708.h
@@ -20,7 +20,7 @@
 #ifndef VLC_CEA708_H_
 #define VLC_CEA708_H_
 
-typedef void(*service_data_hdlr_t)(void *, uint8_t i_sid, mtime_t,
+typedef void(*service_data_hdlr_t)(void *, uint8_t i_sid, vlc_tick_t,
                                    const uint8_t *p_data, size_t i_data);
 
 /* DVTCC Services demuxing */
@@ -29,7 +29,7 @@ typedef struct cea708_demux_t cea708_demux_t;
 
 cea708_demux_t * CEA708_DTVCC_Demuxer_New( void *, service_data_hdlr_t );
 void CEA708_DTVCC_Demuxer_Release( cea708_demux_t * );
-void CEA708_DTVCC_Demuxer_Push( cea708_demux_t *h, mtime_t, const uint8_t data[3] );
+void CEA708_DTVCC_Demuxer_Push( cea708_demux_t *h, vlc_tick_t, const uint8_t data[3] );
 void CEA708_DTVCC_Demuxer_Flush( cea708_demux_t *h );
 
 /* DVTCC Services decoding */
@@ -37,7 +37,7 @@ typedef struct cea708_t cea708_t;
 
 cea708_t *CEA708_Decoder_New( decoder_t * );
 void CEA708_Decoder_Release( cea708_t *p_cea708 );
-void CEA708_Decoder_Push( cea708_t *p_cea708, mtime_t,
+void CEA708_Decoder_Push( cea708_t *p_cea708, vlc_tick_t,
                           const uint8_t *p_data, size_t i_data );
 void CEA708_Decoder_Flush( cea708_t *p_cea708 );
 
diff --git a/modules/codec/cvdsub.c b/modules/codec/cvdsub.c
index aefca5cc12..159faf5c1d 100644
--- a/modules/codec/cvdsub.c
+++ b/modules/codec/cvdsub.c
@@ -91,7 +91,7 @@ typedef struct
   size_t metadata_offset;          /* offset to data describing the image */
   size_t metadata_length;          /* length of metadata */
 
-  mtime_t i_duration;   /* how long to display the image, 0 stands
+  vlc_tick_t i_duration;   /* how long to display the image, 0 stands
                            for "until next subtitle" */
 
   uint16_t i_x_start, i_y_start; /* position of top leftmost pixel of
diff --git a/modules/codec/daala.c b/modules/codec/daala.c
index e3f1afc2c4..f26cb8c430 100644
--- a/modules/codec/daala.c
+++ b/modules/codec/daala.c
@@ -70,7 +70,7 @@ typedef struct
     /*
      * Common properties
      */
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 } decoder_sys_t;
 
 /*****************************************************************************
diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c
index baa9f3afca..26851e6d22 100644
--- a/modules/codec/dmo/dmo.c
+++ b/modules/codec/dmo/dmo.c
@@ -1460,7 +1460,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data )
     block_t *p_block_in;
     uint32_t i_status;
     int i_result;
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 
     if( !p_data ) return NULL;
 
diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c
index a167e99dbe..cc1017cc35 100644
--- a/modules/codec/dvbsub.c
+++ b/modules/codec/dvbsub.c
@@ -256,7 +256,7 @@ typedef struct
     /* Decoder internal data */
     int                i_id;
     int                i_ancillary_id;
-    mtime_t            i_pts;
+    vlc_tick_t         i_pts;
 
     bool               b_absolute;
     int                i_spu_position;
@@ -1503,10 +1503,10 @@ static subpicture_t *render( decoder_t *p_dec )
     p_spu->b_absolute = p_sys->b_absolute;
     /* Set the pf_render callback */
     p_spu->i_start = p_sys->i_pts;
-    //p_spu->i_stop = (mtime_t) 0;
+    //p_spu->i_stop = (vlc_tick_t) 0;
     p_spu->b_ephemer = true;
     //p_spu->b_fade = true;
-    //p_spu->i_stop = p_spu->i_start + (mtime_t) (i_timeout * 1000000);
+    //p_spu->i_stop = p_spu->i_start + (vlc_tick_t) (i_timeout * 1000000);
     p_spu->b_subtitle = true;
 
     /* Correct positioning of SPU */
@@ -1691,7 +1691,7 @@ typedef struct
     int i_regions;
     encoder_region_t *p_regions;
 
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 
     /* subpicture positioning */
     int i_offset_x;
diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index 5b9afc4dfb..56a087bd5a 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -257,7 +257,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
         }
     }
 
-    const mtime_t i_pts = p_block->i_pts;
+    const vlc_tick_t i_pts = p_block->i_pts;
 
     /* Append block as temporary buffer */
     if( p_sys->p_block == NULL )
diff --git a/modules/codec/fdkaac.c b/modules/codec/fdkaac.c
index 44fa6c1e20..0394225c7b 100644
--- a/modules/codec/fdkaac.c
+++ b/modules/codec/fdkaac.c
@@ -134,7 +134,7 @@ static const char *const ppsz_enc_options[] = {
 typedef struct
 {
     double d_compression_ratio;
-    mtime_t i_pts_last;
+    vlc_tick_t i_pts_last;
     int i_encoderdelay; /* Samples delay introduced by the profile */
     int i_frame_size;
     int i_maxoutputsize; /* Maximum buffer size for encoded output */
@@ -321,18 +321,18 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf)
 {
     int16_t *p_buffer;
     int i_samples;
-    mtime_t i_pts_out;
+    vlc_tick_t i_pts_out;
 
     encoder_sys_t *p_sys = p_enc->p_sys;
 
     if (likely(p_aout_buf)) {
         p_buffer = (int16_t *)p_aout_buf->p_buffer;
         i_samples = p_aout_buf->i_nb_samples;
-        i_pts_out = p_aout_buf->i_pts - (mtime_t)((double)CLOCK_FREQ *
+        i_pts_out = p_aout_buf->i_pts - (vlc_tick_t)((double)CLOCK_FREQ *
                (double)p_sys->i_encoderdelay /
                (double)p_enc->fmt_out.audio.i_rate);
         if (p_sys->i_pts_last == 0)
-            p_sys->i_pts_last = i_pts_out - (mtime_t)((double)CLOCK_FREQ *
+            p_sys->i_pts_last = i_pts_out - (vlc_tick_t)((double)CLOCK_FREQ *
                (double)(p_sys->i_frame_size) /
                (double)p_enc->fmt_out.audio.i_rate);
     } else {
@@ -395,10 +395,10 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf)
             if (unlikely(i_samples == 0)) {
                 // I only have the numOutBytes so approximate based on compression factor
                 double d_samples_forward = p_sys->d_compression_ratio*(double)out_args.numOutBytes;
-                i_pts_out += (mtime_t)d_samples_forward;
-                p_block->i_length = (mtime_t)d_samples_forward;
+                i_pts_out += (vlc_tick_t)d_samples_forward;
+                p_block->i_length = (vlc_tick_t)d_samples_forward;
                 // TODO: It would be more precise (a few microseconds) to use d_samples_forward =
-                // (mtime_t)CLOCK_FREQ * (mtime_t)p_sys->i_frame_size/(mtime_t)p_enc->fmt_out.audio.i_rate
+                // (vlc_tick_t)CLOCK_FREQ * (vlc_tick_t)p_sys->i_frame_size/(vlc_tick_t)p_enc->fmt_out.audio.i_rate
                 // but I am not sure if the lib always outputs a full frame when
                 // emptying the internal buffer in the EOF scenario
             } else {
@@ -407,9 +407,9 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf)
                     // in the library buffer from the prior block
                     double d_samples_delay = (double)p_sys->i_frame_size - (double)out_args.numInSamples /
                                              (double)p_enc->fmt_in.audio.i_channels;
-                    i_pts_out -= (mtime_t)((double)CLOCK_FREQ * d_samples_delay /
+                    i_pts_out -= (vlc_tick_t)((double)CLOCK_FREQ * d_samples_delay /
                                            (double)p_enc->fmt_out.audio.i_rate);
-                    p_block->i_length = (mtime_t)((double)CLOCK_FREQ * (double)p_sys->i_frame_size /
+                    p_block->i_length = (vlc_tick_t)((double)CLOCK_FREQ * (double)p_sys->i_frame_size /
                         (double)p_enc->fmt_out.audio.i_rate);
                     p_block->i_nb_samples = d_samples_delay;
                     //p_block->i_length = i_pts_out - p_sys->i_pts_last;
@@ -417,8 +417,8 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf)
                     double d_samples_forward = (double)out_args.numInSamples/(double)p_enc->fmt_in.audio.i_channels;
                     double d_length = ((double)CLOCK_FREQ * d_samples_forward /
                                             (double)p_enc->fmt_out.audio.i_rate);
-                    i_pts_out += (mtime_t) d_length;
-                    p_block->i_length = (mtime_t) d_length;
+                    i_pts_out += (vlc_tick_t) d_length;
+                    p_block->i_length = (vlc_tick_t) d_length;
                     p_block->i_nb_samples = d_samples_forward;
                 }
             }
diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index aca1cae9bf..5d7091cba8 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -724,7 +724,7 @@ typedef struct
     /*
      * Common properties
      */
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 } encoder_sys_t;
 
 #define STREAMINFO_SIZE 34
@@ -771,7 +771,7 @@ EncoderWriteCallback( const FLAC__StreamEncoder *encoder,
     p_sys->i_samples_delay -= samples;
 
     p_block->i_length = CLOCK_FREQ *
-        (mtime_t)samples / (mtime_t)p_enc->fmt_in.audio.i_rate;
+        (vlc_tick_t)samples / (vlc_tick_t)p_enc->fmt_in.audio.i_rate;
 
     /* Update pts */
     p_sys->i_pts += p_block->i_length;
@@ -880,8 +880,8 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
     if( unlikely( !p_aout_buf ) ) return NULL;
 
     p_sys->i_pts = p_aout_buf->i_pts -
-                CLOCK_FREQ * (mtime_t)p_sys->i_samples_delay /
-                (mtime_t)p_enc->fmt_in.audio.i_rate;
+                CLOCK_FREQ * (vlc_tick_t)p_sys->i_samples_delay /
+                (vlc_tick_t)p_enc->fmt_in.audio.i_rate;
 
     p_sys->i_samples_delay += p_aout_buf->i_nb_samples;
 
diff --git a/modules/codec/kate.c b/modules/codec/kate.c
index e9d6215844..70c4e41e72 100644
--- a/modules/codec/kate.c
+++ b/modules/codec/kate.c
@@ -86,8 +86,8 @@ typedef struct
     /*
      * Common properties
      */
-    mtime_t i_pts;
-    mtime_t i_max_stop;
+    vlc_tick_t i_pts;
+    vlc_tick_t i_max_stop;
 
     /* decoder_sys_t is shared between decoder and spu units */
     vlc_mutex_t lock;
@@ -118,7 +118,7 @@ typedef struct
 typedef struct
 {
     decoder_sys_t *p_dec_sys;
-    mtime_t        i_start;
+    vlc_tick_t     i_start;
 } kate_spu_updater_sys_t;
 
 
@@ -805,7 +805,7 @@ static void PostprocessTigerImage( plane_t *p_plane, unsigned int i_width )
 static int TigerValidateSubpicture( subpicture_t *p_subpic,
                                     bool b_fmt_src, const video_format_t *p_fmt_src,
                                     bool b_fmt_dst, const video_format_t *p_fmt_dst,
-                                    mtime_t ts )
+                                    vlc_tick_t ts )
 {
     VLC_UNUSED(p_fmt_src); VLC_UNUSED(p_fmt_dst);
 
@@ -849,7 +849,7 @@ exit:
 static void TigerUpdateSubpicture( subpicture_t *p_subpic,
                                    const video_format_t *p_fmt_src,
                                    const video_format_t *p_fmt_dst,
-                                   mtime_t ts )
+                                   vlc_tick_t ts )
 {
     kate_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
     decoder_sys_t *p_sys = p_spusys->p_dec_sys;
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 9e3a963001..a314844708 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -74,7 +74,7 @@ static void Flush( decoder_t * );
 /* */
 typedef struct
 {
-    mtime_t        i_max_stop;
+    vlc_tick_t     i_max_stop;
 
     /* The following fields of decoder_sys_t are shared between decoder and spu units */
     vlc_mutex_t    lock;
@@ -95,11 +95,11 @@ static void DecSysHold( decoder_sys_t *p_sys );
 static int SubpictureValidate( subpicture_t *,
                                bool, const video_format_t *,
                                bool, const video_format_t *,
-                               mtime_t );
+                               vlc_tick_t );
 static void SubpictureUpdate( subpicture_t *,
                               const video_format_t *,
                               const video_format_t *,
-                              mtime_t );
+                              vlc_tick_t );
 static void SubpictureDestroy( subpicture_t * );
 
 typedef struct
@@ -107,7 +107,7 @@ typedef struct
     decoder_sys_t *p_dec_sys;
     void          *p_subs_data;
     int           i_subs_len;
-    mtime_t       i_pts;
+    vlc_tick_t    i_pts;
 
     ASS_Image     *p_img;
 } libass_spu_updater_sys_t;
@@ -416,7 +416,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
 static int SubpictureValidate( subpicture_t *p_subpic,
                                bool b_fmt_src, const video_format_t *p_fmt_src,
                                bool b_fmt_dst, const video_format_t *p_fmt_dst,
-                               mtime_t i_ts )
+                               vlc_tick_t i_ts )
 {
     libass_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
     decoder_sys_t *p_sys = p_spusys->p_dec_sys;
@@ -438,7 +438,7 @@ static int SubpictureValidate( subpicture_t *p_subpic,
     }
 
     /* */
-    const mtime_t i_stream_date = p_spusys->i_pts + (i_ts - p_subpic->i_start);
+    const vlc_tick_t i_stream_date = p_spusys->i_pts + (i_ts - p_subpic->i_start);
     int i_changed;
     ASS_Image *p_img = ass_render_frame( p_sys->p_renderer, p_sys->p_track,
                                          i_stream_date/1000, &i_changed );
@@ -458,7 +458,7 @@ static int SubpictureValidate( subpicture_t *p_subpic,
 static void SubpictureUpdate( subpicture_t *p_subpic,
                               const video_format_t *p_fmt_src,
                               const video_format_t *p_fmt_dst,
-                              mtime_t i_ts )
+                              vlc_tick_t i_ts )
 {
     VLC_UNUSED( p_fmt_src ); VLC_UNUSED( p_fmt_dst ); VLC_UNUSED( i_ts );
 
diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index db003980b8..2dcf094c73 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -71,10 +71,10 @@ typedef struct
     /*
      * Input properties
      */
-    mtime_t          i_previous_pts;
-    mtime_t          i_current_pts;
-    mtime_t          i_previous_dts;
-    mtime_t          i_current_dts;
+    vlc_tick_t       i_previous_pts;
+    vlc_tick_t       i_current_pts;
+    vlc_tick_t       i_previous_dts;
+    vlc_tick_t       i_current_dts;
     bool             b_garbage_pic;
     bool             b_after_sequence_header; /* is it the next frame after
                                                * the sequence header ?    */
@@ -92,12 +92,12 @@ typedef struct
     decoder_synchro_t *p_synchro;
     int             i_sar_num;
     int             i_sar_den;
-    mtime_t         i_last_frame_pts;
+    vlc_tick_t      i_last_frame_pts;
 
     /* Closed captioning support */
     uint32_t        i_cc_flags;
-    mtime_t         i_cc_pts;
-    mtime_t         i_cc_dts;
+    vlc_tick_t      i_cc_pts;
+    vlc_tick_t      i_cc_dts;
 #if MPEG2_RELEASE >= MPEG2_VERSION (0, 5, 0)
     cc_data_t       cc;
 #endif
@@ -324,7 +324,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             const mpeg2_info_t *p_info = p_sys->p_info;
             const mpeg2_picture_t *p_current = p_info->current_picture;
 
-            mtime_t i_pts, i_dts;
+            vlc_tick_t i_pts, i_dts;
 
             if( p_sys->b_after_sequence_header &&
                 (p_current->flags &
diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c
index 94996162ec..9cf3e5d556 100644
--- a/modules/codec/lpcm.c
+++ b/modules/codec/lpcm.c
@@ -660,9 +660,9 @@ static block_t *EncodeFrames( encoder_t *p_enc, block_t *p_aout_buf )
         i_bytes_consumed += i_consume_bytes;
 
         /* We need to find i_length by means of next_pts due to possible roundoff errors. */
-        mtime_t this_pts = p_aout_buf->i_pts +
+        vlc_tick_t this_pts = p_aout_buf->i_pts +
             (i * p_sys->i_frame_samples + i_start_offset) * CLOCK_FREQ / p_sys->i_rate;
-        mtime_t next_pts = p_aout_buf->i_pts +
+        vlc_tick_t next_pts = p_aout_buf->i_pts +
             ((i + 1) * p_sys->i_frame_samples + i_start_offset) * CLOCK_FREQ / p_sys->i_rate;
 
         p_block->i_pts = p_block->i_dts = this_pts;
diff --git a/modules/codec/mpg123.c b/modules/codec/mpg123.c
index 9011626d9e..f7c037ab95 100644
--- a/modules/codec/mpg123.c
+++ b/modules/codec/mpg123.c
@@ -202,7 +202,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
 {
     int i_err;
     decoder_sys_t *p_sys = p_dec->p_sys;
-    mtime_t i_pts = VLC_TS_INVALID;
+    vlc_tick_t i_pts = VLC_TS_INVALID;
 
     if( !p_sys->b_opened )
     {
diff --git a/modules/codec/oggspots.c b/modules/codec/oggspots.c
index be7ab77143..29b32438d8 100644
--- a/modules/codec/oggspots.c
+++ b/modules/codec/oggspots.c
@@ -57,7 +57,7 @@ typedef struct
     /*
      * Common properties
      */
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 } decoder_sys_t;
 
 /*****************************************************************************
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 9790fa59e2..68587533fb 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -875,7 +875,7 @@ static void ReleasePicture(decoder_t *p_dec, unsigned i_index, bool b_render)
     p_sys->api.release_out(&p_sys->api, i_index, b_render);
 }
 
-static void ReleasePictureTs(decoder_t *p_dec, unsigned i_index, mtime_t i_ts)
+static void ReleasePictureTs(decoder_t *p_dec, unsigned i_index, vlc_tick_t i_ts)
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     assert(p_sys->api.release_out_ts);
@@ -1340,7 +1340,7 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block,
             return VLC_EGENERIC;
 
         bool b_config = false;
-        mtime_t i_ts = 0;
+        vlc_tick_t i_ts = 0;
         p_sys->b_input_dequeued = true;
         const void *p_buf = NULL;
         size_t i_size = 0;
@@ -1422,7 +1422,7 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block,
         /* Wait for the OutThread to stop (and process all remaining output
          * frames. Use a timeout here since we can't know if all decoders will
          * behave correctly. */
-        mtime_t deadline = mdate() + INT64_C(3000000);
+        vlc_tick_t deadline = mdate() + INT64_C(3000000);
         while (!p_sys->b_aborted && !p_sys->b_drained
             && vlc_cond_timedwait(&p_sys->dec_cond, &p_sys->lock, deadline) == 0);
 
diff --git a/modules/codec/omxil/mediacodec.h b/modules/codec/omxil/mediacodec.h
index 628a3a022d..dab785d935 100644
--- a/modules/codec/omxil/mediacodec.h
+++ b/modules/codec/omxil/mediacodec.h
@@ -60,7 +60,7 @@ struct mc_api_out
         struct
         {
             int i_index;
-            mtime_t i_ts;
+            vlc_tick_t i_ts;
             const uint8_t *p_ptr;
             size_t i_size;
         } buf;
@@ -136,13 +136,13 @@ struct mc_api
      * - MC_API_INFO_OUTPUT_FORMAT_CHANGED if output format changed
      * - MC_API_INFO_OUTPUT_BUFFERS_CHANGED if buffers changed
      * - MC_API_ERROR in case of error. */
-    int (*dequeue_in)(mc_api *, mtime_t i_timeout);
-    int (*dequeue_out)(mc_api *, mtime_t i_timeout);
+    int (*dequeue_in)(mc_api *, vlc_tick_t i_timeout);
+    int (*dequeue_out)(mc_api *, vlc_tick_t i_timeout);
 
     /* i_index is the index returned by dequeue_in and should be >= 0
      * Returns 0 if buffer is successfully queued, or MC_API_ERROR */
     int (*queue_in)(mc_api *, int i_index, const void *p_buf, size_t i_size,
-                    mtime_t i_ts, bool b_config);
+                    vlc_tick_t i_ts, bool b_config);
 
     /* i_index is the index returned by dequeue_out and should be >= 0,
      * MC_API_INFO_OUTPUT_FORMAT_CHANGED, or MC_API_INFO_OUTPUT_BUFFERS_CHANGED.
diff --git a/modules/codec/omxil/mediacodec_jni.c b/modules/codec/omxil/mediacodec_jni.c
index 2ef6f60637..fc753b715c 100644
--- a/modules/codec/omxil/mediacodec_jni.c
+++ b/modules/codec/omxil/mediacodec_jni.c
@@ -705,7 +705,7 @@ static int Flush(mc_api *api)
 /*****************************************************************************
  * DequeueInput
  *****************************************************************************/
-static int DequeueInput(mc_api *api, mtime_t i_timeout)
+static int DequeueInput(mc_api *api, vlc_tick_t i_timeout)
 {
     mc_api_sys *p_sys = api->p_sys;
     JNIEnv *env;
@@ -731,7 +731,7 @@ static int DequeueInput(mc_api *api, mtime_t i_timeout)
  * QueueInput
  *****************************************************************************/
 static int QueueInput(mc_api *api, int i_index, const void *p_buf,
-                      size_t i_size, mtime_t i_ts, bool b_config)
+                      size_t i_size, vlc_tick_t i_ts, bool b_config)
 {
     mc_api_sys *p_sys = api->p_sys;
     JNIEnv *env;
@@ -785,7 +785,7 @@ static int QueueInput(mc_api *api, int i_index, const void *p_buf,
 /*****************************************************************************
  * DequeueOutput
  *****************************************************************************/
-static int DequeueOutput(mc_api *api, mtime_t i_timeout)
+static int DequeueOutput(mc_api *api, vlc_tick_t i_timeout)
 {
     mc_api_sys *p_sys = api->p_sys;
     JNIEnv *env;
diff --git a/modules/codec/omxil/mediacodec_ndk.c b/modules/codec/omxil/mediacodec_ndk.c
index 3d782252e5..e3ea084433 100644
--- a/modules/codec/omxil/mediacodec_ndk.c
+++ b/modules/codec/omxil/mediacodec_ndk.c
@@ -398,7 +398,7 @@ static int Flush(mc_api *api)
 /*****************************************************************************
  * DequeueInput
  *****************************************************************************/
-static int DequeueInput(mc_api *api, mtime_t i_timeout)
+static int DequeueInput(mc_api *api, vlc_tick_t i_timeout)
 {
     mc_api_sys *p_sys = api->p_sys;
     ssize_t i_index;
@@ -419,7 +419,7 @@ static int DequeueInput(mc_api *api, mtime_t i_timeout)
  * QueueInput
  *****************************************************************************/
 static int QueueInput(mc_api *api, int i_index, const void *p_buf,
-                      size_t i_size, mtime_t i_ts, bool b_config)
+                      size_t i_size, vlc_tick_t i_ts, bool b_config)
 {
     mc_api_sys *p_sys = api->p_sys;
     uint8_t *p_mc_buf;
@@ -458,7 +458,7 @@ static int32_t GetFormatInteger(AMediaFormat *p_format, const char *psz_name)
 /*****************************************************************************
  * DequeueOutput
  *****************************************************************************/
-static int DequeueOutput(mc_api *api, mtime_t i_timeout)
+static int DequeueOutput(mc_api *api, vlc_tick_t i_timeout)
 {
     mc_api_sys *p_sys = api->p_sys;
     ssize_t i_index;
diff --git a/modules/codec/omxil/omxil_utils.h b/modules/codec/omxil/omxil_utils.h
index db0a381d4b..58c9e99b6e 100644
--- a/modules/codec/omxil/omxil_utils.h
+++ b/modules/codec/omxil/omxil_utils.h
@@ -108,7 +108,7 @@ static inline OMX_TICKS ToOmxTicks(int64_t value)
 
 #define OMX_FIFO_GET_TIMEOUT(p_fifo, p_buffer, timeout) \
     do { vlc_mutex_lock( &(p_fifo)->lock ); \
-         mtime_t end = mdate() + timeout; \
+         vlc_tick_t end = mdate() + timeout; \
          if( !(p_fifo)->p_first ) \
              vlc_cond_timedwait( &(p_fifo)->wait, &(p_fifo)->lock, end ); \
          p_buffer = (p_fifo)->p_first; \
diff --git a/modules/codec/omxil/utils.c b/modules/codec/omxil/utils.c
index bdb8e445ce..0b877f323e 100644
--- a/modules/codec/omxil/utils.c
+++ b/modules/codec/omxil/utils.c
@@ -81,7 +81,7 @@ OMX_ERRORTYPE WaitForOmxEvent(OmxEventQueue *queue, OMX_EVENTTYPE *event,
     OMX_U32 *data_1, OMX_U32 *data_2, OMX_PTR *event_data)
 {
     OmxEvent *p_event;
-    mtime_t deadline = mdate() + CLOCK_FREQ;
+    vlc_tick_t deadline = mdate() + CLOCK_FREQ;
 
     vlc_mutex_lock(&queue->mutex);
 
@@ -116,7 +116,7 @@ OMX_ERRORTYPE WaitForSpecificOmxEvent(OmxEventQueue *queue,
 {
     OMX_ERRORTYPE status;
     OMX_EVENTTYPE event;
-    mtime_t before =  mdate();
+    vlc_tick_t before =  mdate();
 
     while(1)
     {
diff --git a/modules/codec/opus.c b/modules/codec/opus.c
index d98d96830b..3a72868e05 100644
--- a/modules/codec/opus.c
+++ b/modules/codec/opus.c
@@ -160,7 +160,7 @@ static int  ProcessHeaders( decoder_t * );
 static int  ProcessInitialHeader ( decoder_t *, ogg_packet * );
 static block_t *ProcessPacket( decoder_t *, ogg_packet *, block_t * );
 
-static block_t *DecodePacket( decoder_t *, ogg_packet *, int, mtime_t );
+static block_t *DecodePacket( decoder_t *, ogg_packet *, int, vlc_tick_t );
 
 /*****************************************************************************
  * OpenDecoder: probe the decoder and return score
@@ -436,7 +436,7 @@ static block_t *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
     }
 
     /* trimming info */
-    mtime_t i_max_duration = (p_block->i_flags & BLOCK_FLAG_END_OF_SEQUENCE) ?
+    vlc_tick_t i_max_duration = (p_block->i_flags & BLOCK_FLAG_END_OF_SEQUENCE) ?
                              p_block->i_length : 0;
 
     block_t *p_aout_buffer = DecodePacket( p_dec, p_oggpacket,
@@ -451,7 +451,7 @@ static block_t *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
  * DecodePacket: decodes a Opus packet.
  *****************************************************************************/
 static block_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
-                              int i_nb_samples, mtime_t i_duration )
+                              int i_nb_samples, vlc_tick_t i_duration )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
@@ -579,9 +579,9 @@ static block_t *Encode(encoder_t *enc, block_t *buf)
     if (!buf)
         return NULL;
 
-    mtime_t i_pts = buf->i_pts -
-                (mtime_t) CLOCK_FREQ * (mtime_t) sys->i_samples_delay /
-                (mtime_t) enc->fmt_in.audio.i_rate;
+    vlc_tick_t i_pts = buf->i_pts -
+                (vlc_tick_t) CLOCK_FREQ * (vlc_tick_t) sys->i_samples_delay /
+                (vlc_tick_t) enc->fmt_in.audio.i_rate;
 
     sys->i_samples_delay += buf->i_nb_samples;
 
@@ -626,8 +626,8 @@ static block_t *Encode(encoder_t *enc, block_t *buf)
         }
         else
         {
-            out_block->i_length = (mtime_t) CLOCK_FREQ *
-                (mtime_t) OPUS_FRAME_SIZE / (mtime_t) enc->fmt_in.audio.i_rate;
+            out_block->i_length = (vlc_tick_t) CLOCK_FREQ *
+                (vlc_tick_t) OPUS_FRAME_SIZE / (vlc_tick_t) enc->fmt_in.audio.i_rate;
 
             out_block->i_dts = out_block->i_pts = i_pts;
 
diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c
index 6ae7bcdfb5..0521cb24d0 100644
--- a/modules/codec/qsv.c
+++ b/modules/codec/qsv.c
@@ -292,8 +292,8 @@ typedef struct
     uint64_t         busy_warn_counter;   // Device Busy warning counter for rate-limiting of msg;
     uint64_t         async_depth;         // Number of parallel encoding operations.
     fifo_t           packets;             // FIFO of queued packets
-    mtime_t          offset_pts;          // The pts of the first frame, to avoid conversion overflow.
-    mtime_t          last_dts;            // The dts of the last frame, to interpolate over buggy dts
+    vlc_tick_t       offset_pts;          // The pts of the first frame, to avoid conversion overflow.
+    vlc_tick_t       last_dts;            // The dts of the last frame, to interpolate over buggy dts
 
     picture_pool_t   *input_pool;         // pool of pictures to feed the decoder
                                           //  as it doesn't like constantly changing buffers
@@ -302,12 +302,12 @@ typedef struct
 static block_t *Encode(encoder_t *, picture_t *);
 
 
-static inline mtime_t qsv_timestamp_to_mtime(int64_t mfx_ts)
+static inline vlc_tick_t qsv_timestamp_to_mtime(int64_t mfx_ts)
 {
     return mfx_ts / INT64_C(9) * INT64_C(100);
 }
 
-static inline uint64_t qsv_mtime_to_timestamp(mtime_t vlc_ts)
+static inline uint64_t qsv_mtime_to_timestamp(vlc_tick_t vlc_ts)
 {
     return vlc_ts / UINT64_C(100) * UINT64_C(9);
 }
diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c
index bba878421d..1c21d0d22d 100644
--- a/modules/codec/schroedinger.c
+++ b/modules/codec/schroedinger.c
@@ -541,8 +541,8 @@ typedef struct
     /*
      * Dirac properties
      */
-    mtime_t i_lastpts;
-    mtime_t i_frame_pts_delta;
+    vlc_tick_t i_lastpts;
+    vlc_tick_t i_frame_pts_delta;
     SchroDecoder *p_schro;
     SchroVideoFormat *p_format;
 } decoder_sys_t;
@@ -783,7 +783,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
         p_schrobuffer->free = SchroBufferFree;
         p_schrobuffer->priv = p_block;
         if( p_block->i_pts != VLC_TS_INVALID ) {
-            mtime_t *p_pts = malloc( sizeof(*p_pts) );
+            vlc_tick_t *p_pts = malloc( sizeof(*p_pts) );
             if( p_pts ) {
                 *p_pts = p_block->i_pts;
                 /* if this call fails, p_pts is freed automatically */
@@ -841,7 +841,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
             if( p_tag )
             {
                 /* free is handled by schro_frame_unref */
-                p_pic->date = *(mtime_t*) p_tag->value;
+                p_pic->date = *(vlc_tick_t*) p_tag->value;
                 schro_tag_free( p_tag );
             }
             else if( p_sys->i_lastpts != VLC_TS_INVALID )
@@ -882,7 +882,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict );
  *****************************************************************************/
 struct picture_pts_t
 {
-   mtime_t i_pts;    /* associated pts */
+   vlc_tick_t i_pts;    /* associated pts */
    uint32_t u_pnum;  /* dirac picture number */
    bool b_empty;     /* entry is invalid */
 };
@@ -957,7 +957,7 @@ static void ResetPTStlb( encoder_t *p_enc )
 /*****************************************************************************
  * StorePicturePTS: Store the PTS value for a particular picture number
  *****************************************************************************/
-static void StorePicturePTS( encoder_t *p_enc, uint32_t u_pnum, mtime_t i_pts )
+static void StorePicturePTS( encoder_t *p_enc, uint32_t u_pnum, vlc_tick_t i_pts )
 {
     encoder_sys_t *p_sys = p_enc->p_sys;
 
@@ -979,7 +979,7 @@ static void StorePicturePTS( encoder_t *p_enc, uint32_t u_pnum, mtime_t i_pts )
 /*****************************************************************************
  * GetPicturePTS: Retrieve the PTS value for a particular picture number
  *****************************************************************************/
-static mtime_t GetPicturePTS( encoder_t *p_enc, uint32_t u_pnum )
+static vlc_tick_t GetPicturePTS( encoder_t *p_enc, uint32_t u_pnum )
 {
     encoder_sys_t *p_sys = p_enc->p_sys;
 
diff --git a/modules/codec/scte27.c b/modules/codec/scte27.c
index 5376de0577..826f8219ad 100644
--- a/modules/codec/scte27.c
+++ b/modules/codec/scte27.c
@@ -55,7 +55,7 @@ typedef struct
     int     segment_id;
     int     segment_size;
     uint8_t *segment_buffer;
-    mtime_t segment_date;
+    vlc_tick_t segment_date;
 } decoder_sys_t;
 
 typedef struct {
@@ -331,7 +331,7 @@ static subpicture_region_t *DecodeSimpleBitmap(decoder_t *dec,
 
 static subpicture_t *DecodeSubtitleMessage(decoder_t *dec,
                                            const uint8_t *data, int size,
-                                           mtime_t date)
+                                           vlc_tick_t date)
 {
     if (size < 12)
         goto error;
diff --git a/modules/codec/shine.c b/modules/codec/shine.c
index a448084ee6..581f01c62a 100644
--- a/modules/codec/shine.c
+++ b/modules/codec/shine.c
@@ -227,8 +227,8 @@ static block_t *EncodeFrame( encoder_t *p_enc, block_t *p_block )
     block_t *p_pcm_block;
     block_t *p_chain = NULL;
     unsigned int i_samples = p_block->i_buffer >> 2 /* s16l stereo */;
-    mtime_t start_date = p_block->i_pts;
-    start_date -= (mtime_t)i_samples * CLOCK_FREQ / (mtime_t)p_enc->fmt_out.audio.i_rate;
+    vlc_tick_t start_date = p_block->i_pts;
+    start_date -= (vlc_tick_t)i_samples * CLOCK_FREQ / (vlc_tick_t)p_enc->fmt_out.audio.i_rate;
 
     VLC_UNUSED(p_enc);
 
diff --git a/modules/codec/speex.c b/modules/codec/speex.c
index ef44d3562a..9b0ebaac32 100644
--- a/modules/codec/speex.c
+++ b/modules/codec/speex.c
@@ -1094,9 +1094,9 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
     unsigned i_samples = p_aout_buf->i_nb_samples;
     int i_samples_delay = p_sys->i_samples_delay;
 
-    mtime_t i_pts = p_aout_buf->i_pts -
-                CLOCK_FREQ * (mtime_t)p_sys->i_samples_delay /
-                (mtime_t)p_enc->fmt_in.audio.i_rate;
+    vlc_tick_t i_pts = p_aout_buf->i_pts -
+                CLOCK_FREQ * (vlc_tick_t)p_sys->i_samples_delay /
+                (vlc_tick_t)p_enc->fmt_in.audio.i_rate;
 
     p_sys->i_samples_delay += i_samples;
 
@@ -1155,8 +1155,8 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
         memcpy( p_block->p_buffer, p_sys->p_buffer_out, i_out );
 
         p_block->i_length = CLOCK_FREQ *
-            (mtime_t)p_sys->i_frame_length * p_sys->header.frames_per_packet /
-            (mtime_t)p_enc->fmt_in.audio.i_rate;
+            (vlc_tick_t)p_sys->i_frame_length * p_sys->header.frames_per_packet /
+            (vlc_tick_t)p_enc->fmt_in.audio.i_rate;
 
         p_block->i_dts = p_block->i_pts = i_pts;
 
diff --git a/modules/codec/spudec/parse.c b/modules/codec/spudec/parse.c
index 275864f187..5688d51e8d 100644
--- a/modules/codec/spudec/parse.c
+++ b/modules/codec/spudec/parse.c
@@ -65,7 +65,7 @@ typedef struct
 } subpicture_data_t;
 
 static int  ParseControlSeq( decoder_t *, subpicture_t *, subpicture_data_t *,
-                             spu_properties_t *, mtime_t i_pts );
+                             spu_properties_t *, vlc_tick_t i_pts );
 static int  ParseRLE       ( decoder_t *, subpicture_data_t *,
                              const spu_properties_t * );
 static void Render         ( decoder_t *, subpicture_t *, subpicture_data_t *,
@@ -156,7 +156,7 @@ subpicture_t * ParsePacket( decoder_t *p_dec )
  * subtitles format, see http://sam.zoy.org/doc/dvd/subtitles/index.html
  *****************************************************************************/
 static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
-                            subpicture_data_t *p_spu_data, spu_properties_t *p_spu_properties, mtime_t i_pts )
+                            subpicture_data_t *p_spu_data, spu_properties_t *p_spu_properties, vlc_tick_t i_pts )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
@@ -168,7 +168,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
 
     /* Command and date */
     uint8_t i_command = SPU_CMD_END;
-    mtime_t date = 0;
+    vlc_tick_t date = 0;
     bool b_cmd_offset = false;
     bool b_cmd_alpha = false;
     subpicture_data_t spu_data_cmd;
@@ -215,7 +215,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
             b_cmd_offset = false;
             b_cmd_alpha = false;
             /* Get the control sequence date */
-            date = (mtime_t)GetWBE( &p_sys->buffer[i_index] ) * 11000;
+            date = (vlc_tick_t)GetWBE( &p_sys->buffer[i_index] ) * 11000;
 
             /* Next offset */
             i_cur_seq = i_index;
@@ -425,7 +425,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
     if( p_spu->i_stop <= p_spu->i_start && !p_spu->b_ephemer )
     {
         /* This subtitle will live for 5 seconds or until the next subtitle */
-        p_spu->i_stop = p_spu->i_start + (mtime_t)500 * 11000;
+        p_spu->i_stop = p_spu->i_start + (vlc_tick_t)500 * 11000;
         p_spu->b_ephemer = true;
     }
 
diff --git a/modules/codec/spudec/spudec.h b/modules/codec/spudec/spudec.h
index bbab8da15a..c56f09fe7c 100644
--- a/modules/codec/spudec/spudec.h
+++ b/modules/codec/spudec/spudec.h
@@ -28,7 +28,7 @@ typedef struct
     bool b_packetizer;
     bool b_disabletrans;
 
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
     unsigned int i_spu_size;
     unsigned int i_rle_size;
     unsigned int i_spu;
diff --git a/modules/codec/substext.h b/modules/codec/substext.h
index d71e2f3acf..08686fd288 100644
--- a/modules/codec/substext.h
+++ b/modules/codec/substext.h
@@ -62,7 +62,7 @@ typedef struct
     /* styling */
     text_style_t *p_default_style; /* decoder (full or partial) defaults */
     float margin_ratio;
-    mtime_t i_next_update;
+    vlc_tick_t i_next_update;
     bool b_blink_even;
 } subtext_updater_sys_t;
 
@@ -98,7 +98,7 @@ static inline void SubpictureUpdaterSysRegionAdd(substext_updater_region_t *p_pr
 static int SubpictureTextValidate(subpicture_t *subpic,
                                   bool has_src_changed, const video_format_t *fmt_src,
                                   bool has_dst_changed, const video_format_t *fmt_dst,
-                                  mtime_t ts)
+                                  vlc_tick_t ts)
 {
     subtext_updater_sys_t *sys = subpic->updater.p_sys;
     VLC_UNUSED(fmt_src); VLC_UNUSED(fmt_dst);
@@ -129,7 +129,7 @@ static int SubpictureTextValidate(subpicture_t *subpic,
 static void SubpictureTextUpdate(subpicture_t *subpic,
                                  const video_format_t *fmt_src,
                                  const video_format_t *fmt_dst,
-                                 mtime_t ts)
+                                 vlc_tick_t ts)
 {
     subtext_updater_sys_t *sys = subpic->updater.p_sys;
     VLC_UNUSED(fmt_src);
diff --git a/modules/codec/svcdsub.c b/modules/codec/svcdsub.c
index 7ecfdee958..3fcb0528ad 100644
--- a/modules/codec/svcdsub.c
+++ b/modules/codec/svcdsub.c
@@ -98,7 +98,7 @@ typedef struct
   size_t metadata_offset;          /* offset to data describing the image */
   size_t metadata_length;          /* length of metadata */
 
-  mtime_t i_duration;   /* how long to display the image, 0 stands
+  vlc_tick_t i_duration;   /* how long to display the image, 0 stands
                            for "until next subtitle" */
 
   uint16_t i_x_start, i_y_start; /* position of top leftmost pixel of
diff --git a/modules/codec/synchro.c b/modules/codec/synchro.c
index 02e8753825..c60fa066e4 100644
--- a/modules/codec/synchro.c
+++ b/modules/codec/synchro.c
@@ -120,13 +120,13 @@ struct decoder_synchro_t
     bool            b_quiet;
 
     /* date of the beginning of the decoding of the current picture */
-    mtime_t         decoding_start;
+    vlc_tick_t      decoding_start;
 
     /* stream properties */
     unsigned int    i_n_p, i_n_b;
 
     /* decoding values */
-    mtime_t         p_tau[4];                  /* average decoding durations */
+    vlc_tick_t      p_tau[4];                  /* average decoding durations */
     unsigned int    pi_meaningful[4];            /* number of durations read */
 
     /* render_time filled by SynchroChoose() */
@@ -139,7 +139,7 @@ struct decoder_synchro_t
     int             i_trash_nb_ref;    /* Number of reference pictures we'll *
                                         * have if we trash the current pic   */
     unsigned int    i_eta_p, i_eta_b;
-    mtime_t         backward_pts, current_pts;
+    vlc_tick_t      backward_pts, current_pts;
     int             i_current_period;   /* period to add to the next picture */
     int             i_backward_period;  /* period to add after the next
                                          * reference picture
@@ -172,7 +172,7 @@ decoder_synchro_t * decoder_SynchroInit( decoder_t *p_dec, int i_frame_rate )
     /* We use a fake stream pattern, which is often right. */
     p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;
     p_synchro->i_n_b = p_synchro->i_eta_b = DEFAULT_NB_B;
-    memset( p_synchro->p_tau, 0, 4 * sizeof(mtime_t) );
+    memset( p_synchro->p_tau, 0, 4 * sizeof(vlc_tick_t) );
     memset( p_synchro->pi_meaningful, 0, 4 * sizeof(unsigned int) );
     p_synchro->i_nb_ref = 0;
     p_synchro->i_trash_nb_ref = p_synchro->i_dec_nb_ref = 0;
@@ -214,8 +214,8 @@ bool decoder_SynchroChoose( decoder_synchro_t * p_synchro, int i_coding_type,
                                     + (p_synchro->p_tau[(coding_type)] >> 1) \
                                     + p_synchro->i_render_time)
 #define S (*p_synchro)
-    mtime_t         now, period;
-    mtime_t         pts;
+    vlc_tick_t      now, period;
+    vlc_tick_t      pts;
     bool      b_decode = 0;
     float     i_current_rate;
 
@@ -366,7 +366,7 @@ void decoder_SynchroDecode( decoder_synchro_t * p_synchro )
 void decoder_SynchroEnd( decoder_synchro_t * p_synchro, int i_coding_type,
                       bool b_garbage )
 {
-    mtime_t     tau;
+    vlc_tick_t  tau;
 
     if( b_garbage )
         return;
@@ -393,7 +393,7 @@ void decoder_SynchroEnd( decoder_synchro_t * p_synchro, int i_coding_type,
 /*****************************************************************************
  * decoder_SynchroDate : When an image has been decoded, ask for its date
  *****************************************************************************/
-mtime_t decoder_SynchroDate( decoder_synchro_t * p_synchro )
+vlc_tick_t decoder_SynchroDate( decoder_synchro_t * p_synchro )
 {
     /* No need to lock, since PTS are only used by the video parser. */
     return p_synchro->current_pts;
@@ -403,12 +403,12 @@ mtime_t decoder_SynchroDate( decoder_synchro_t * p_synchro )
  * decoder_SynchroNewPicture: Update stream structure and PTS
  *****************************************************************************/
 void decoder_SynchroNewPicture( decoder_synchro_t * p_synchro, int i_coding_type,
-                                int i_repeat_field, mtime_t next_pts,
-                                mtime_t next_dts, bool b_low_delay )
+                                int i_repeat_field, vlc_tick_t next_pts,
+                                vlc_tick_t next_dts, bool b_low_delay )
 {
-    mtime_t         period = CLOCK_FREQ * 1001 / p_synchro->i_frame_rate;
+    vlc_tick_t      period = CLOCK_FREQ * 1001 / p_synchro->i_frame_rate;
 #if 0
-    mtime_t         now = mdate();
+    vlc_tick_t      now = mdate();
 #endif
 
     switch( i_coding_type )
diff --git a/modules/codec/synchro.h b/modules/codec/synchro.h
index 13180e6fea..58792a17ff 100644
--- a/modules/codec/synchro.h
+++ b/modules/codec/synchro.h
@@ -44,6 +44,6 @@ bool decoder_SynchroChoose( decoder_synchro_t *, int, int, bool );
 void decoder_SynchroTrash( decoder_synchro_t * );
 void decoder_SynchroDecode( decoder_synchro_t * );
 void decoder_SynchroEnd( decoder_synchro_t *, int, bool );
-mtime_t decoder_SynchroDate( decoder_synchro_t * ) VLC_USED;
-void decoder_SynchroNewPicture( decoder_synchro_t *, int, int, mtime_t, mtime_t, bool );
+vlc_tick_t decoder_SynchroDate( decoder_synchro_t * ) VLC_USED;
+void decoder_SynchroNewPicture( decoder_synchro_t *, int, int, vlc_tick_t, vlc_tick_t, bool );
 
diff --git a/modules/codec/telx.c b/modules/codec/telx.c
index 130ff699b3..d6e92fc9b6 100644
--- a/modules/codec/telx.c
+++ b/modules/codec/telx.c
@@ -94,7 +94,7 @@ typedef struct
   bool        b_is_subtitle[9];
   char        ppsz_lines[32][128];
   char        psz_prev_text[512];
-  mtime_t     prev_pts;
+  vlc_tick_t  prev_pts;
   int         i_page[9];
   bool        b_erase[9];
   const uint16_t *  pi_active_national_set[9];
diff --git a/modules/codec/theora.c b/modules/codec/theora.c
index c826f20093..4e85835dfe 100644
--- a/modules/codec/theora.c
+++ b/modules/codec/theora.c
@@ -72,7 +72,7 @@ typedef struct
     /*
      * Common properties
      */
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 } decoder_sys_t;
 
 /*****************************************************************************
diff --git a/modules/codec/ttml/imageupdater.h b/modules/codec/ttml/imageupdater.h
index 384de27eb9..dac5501e62 100644
--- a/modules/codec/ttml/imageupdater.h
+++ b/modules/codec/ttml/imageupdater.h
@@ -76,7 +76,7 @@ static void TTML_ImageSpuAppendRegion(ttml_image_updater_sys_t *p_sys,
 static int TTML_ImageSpuValidate(subpicture_t *p_spu,
                                  bool b_src_changed, const video_format_t *p_fmt_src,
                                  bool b_dst_changed, const video_format_t *p_fmt_dst,
-                                 mtime_t ts)
+                                 vlc_tick_t ts)
 {
     VLC_UNUSED(p_spu);
     VLC_UNUSED(b_src_changed); VLC_UNUSED(p_fmt_src);
@@ -88,7 +88,7 @@ static int TTML_ImageSpuValidate(subpicture_t *p_spu,
 static void TTML_ImageSpuUpdate(subpicture_t *p_spu,
                                 const video_format_t *p_fmt_src,
                                 const video_format_t *p_fmt_dst,
-                                mtime_t i_ts)
+                                vlc_tick_t i_ts)
 {
     VLC_UNUSED(p_fmt_src); VLC_UNUSED(p_fmt_dst);
     VLC_UNUSED(i_ts);
diff --git a/modules/codec/ttml/ttml.h b/modules/codec/ttml/ttml.h
index 07b6117ad6..b9bf3129cf 100644
--- a/modules/codec/ttml/ttml.h
+++ b/modules/codec/ttml/ttml.h
@@ -106,7 +106,7 @@ static inline void tt_time_Init( tt_time_t *t )
     t->frames = 0;
 }
 
-static inline tt_time_t tt_time_Create( mtime_t i )
+static inline tt_time_t tt_time_Create( vlc_tick_t i )
 {
     tt_time_t t;
     t.base = i;
@@ -119,7 +119,7 @@ static inline bool tt_time_Valid( const tt_time_t *t )
     return t->base != -1;
 }
 
-static inline mtime_t tt_time_Convert( const tt_time_t *t )
+static inline vlc_tick_t tt_time_Convert( const tt_time_t *t )
 {
     if( !tt_time_Valid( t ) )
         return VLC_TS_INVALID;
@@ -129,8 +129,8 @@ static inline mtime_t tt_time_Convert( const tt_time_t *t )
 
 static inline int tt_time_Compare( const tt_time_t *t1, const tt_time_t *t2 )
 {
-    mtime_t ttt1 = tt_time_Convert( t1 );
-    mtime_t ttt2 = tt_time_Convert( t2 );
+    vlc_tick_t ttt1 = tt_time_Convert( t1 );
+    vlc_tick_t ttt2 = tt_time_Convert( t2 );
     if (ttt1 < ttt2)
         return -1;
     return ttt1 > ttt2;
diff --git a/modules/codec/twolame.c b/modules/codec/twolame.c
index 4fd249b697..eed7e30262 100644
--- a/modules/codec/twolame.c
+++ b/modules/codec/twolame.c
@@ -103,7 +103,7 @@ typedef struct
      */
     int16_t p_buffer[MPEG_FRAME_SIZE * 2];
     int i_nb_samples;
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 
     /*
      * libtwolame properties
@@ -290,7 +290,7 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
             return NULL;
         memcpy( p_block->p_buffer, p_sys->p_out_buffer, i_used );
         p_block->i_length = CLOCK_FREQ *
-                (mtime_t)MPEG_FRAME_SIZE / (mtime_t)p_enc->fmt_out.audio.i_rate;
+                (vlc_tick_t)MPEG_FRAME_SIZE / (vlc_tick_t)p_enc->fmt_out.audio.i_rate;
         p_block->i_dts = p_block->i_pts = p_sys->i_pts;
         p_sys->i_pts += p_block->i_length;
 
@@ -301,8 +301,8 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
     int i_nb_samples = p_aout_buf->i_nb_samples;
 
     p_sys->i_pts = p_aout_buf->i_pts -
-                CLOCK_FREQ * (mtime_t)p_sys->i_nb_samples /
-                (mtime_t)p_enc->fmt_out.audio.i_rate;
+                CLOCK_FREQ * (vlc_tick_t)p_sys->i_nb_samples /
+                (vlc_tick_t)p_enc->fmt_out.audio.i_rate;
 
     while ( p_sys->i_nb_samples + i_nb_samples >= MPEG_FRAME_SIZE )
     {
@@ -333,7 +333,7 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
         }
         memcpy( p_block->p_buffer, p_sys->p_out_buffer, i_used );
         p_block->i_length = CLOCK_FREQ *
-                (mtime_t)MPEG_FRAME_SIZE / (mtime_t)p_enc->fmt_out.audio.i_rate;
+                (vlc_tick_t)MPEG_FRAME_SIZE / (vlc_tick_t)p_enc->fmt_out.audio.i_rate;
         p_block->i_dts = p_block->i_pts = p_sys->i_pts;
         p_sys->i_pts += p_block->i_length;
         block_ChainAppend( &p_chain, p_block );
diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 3577975ce0..32dc0c114f 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -2143,7 +2143,7 @@ static int pic_holder_wait(struct pic_holder *pic_holder, const picture_t *pic)
      * output pictures (will they be rendered immediately ?), so don't wait
      * infinitely. The output will be paced anyway by the vlc_cond_timedwait()
      * call. */
-    mtime_t deadline = mdate() + INT64_C(200000);
+    vlc_tick_t deadline = mdate() + INT64_C(200000);
     int ret = 0;
     while (ret == 0 && pic_holder->field_reorder_max != 0
         && pic_holder->nb_field_out >= pic_holder->field_reorder_max + reserved_fields)
diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c
index 79390059ec..a474caf9c9 100644
--- a/modules/codec/vorbis.c
+++ b/modules/codec/vorbis.c
@@ -896,9 +896,9 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
     /* Packets are already flushed, see bellow. */
     if( unlikely( !p_aout_buf ) ) return NULL;
 
-    mtime_t i_pts = p_aout_buf->i_pts -
-                CLOCK_FREQ * (mtime_t)p_sys->i_samples_delay /
-                (mtime_t)p_enc->fmt_in.audio.i_rate;
+    vlc_tick_t i_pts = p_aout_buf->i_pts -
+                CLOCK_FREQ * (vlc_tick_t)p_sys->i_samples_delay /
+                (vlc_tick_t)p_enc->fmt_in.audio.i_rate;
 
     p_sys->i_samples_delay += p_aout_buf->i_nb_samples;
 
@@ -937,7 +937,7 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
             p_sys->i_last_block_size = i_block_size;
 
             p_block->i_length = CLOCK_FREQ *
-                (mtime_t)i_samples / (mtime_t)p_enc->fmt_in.audio.i_rate;
+                (vlc_tick_t)i_samples / (vlc_tick_t)p_enc->fmt_in.audio.i_rate;
 
             p_block->i_dts = p_block->i_pts = i_pts;
 
diff --git a/modules/codec/vpx.c b/modules/codec/vpx.c
index d7ea0196a0..919f66583c 100644
--- a/modules/codec/vpx.c
+++ b/modules/codec/vpx.c
@@ -173,7 +173,7 @@ static int Decode(decoder_t *dec, block_t *block)
     }
 
     /* Associate packet PTS with decoded frame */
-    mtime_t *pkt_pts = malloc(sizeof(*pkt_pts));
+    vlc_tick_t *pkt_pts = malloc(sizeof(*pkt_pts));
     if (!pkt_pts) {
         block_Release(block);
         return VLCDEC_SUCCESS;
@@ -204,7 +204,7 @@ static int Decode(decoder_t *dec, block_t *block)
 
     /* fetches back the PTS */
     pkt_pts = img->user_priv;
-    mtime_t pts = *pkt_pts;
+    vlc_tick_t pts = *pkt_pts;
     free(pkt_pts);
 
     dec->fmt_out.i_codec = FindVlcChroma(img);
diff --git a/modules/codec/webvtt/subsvtt.c b/modules/codec/webvtt/subsvtt.c
index 54b5dd223a..154b7aa902 100644
--- a/modules/codec/webvtt/subsvtt.c
+++ b/modules/codec/webvtt/subsvtt.c
@@ -122,8 +122,8 @@ struct webvtt_dom_cue_t
 {
     WEBVTT_NODE_BASE_MEMBERS
     char *psz_id;
-    mtime_t i_start;
-    mtime_t i_stop;
+    vlc_tick_t i_start;
+    vlc_tick_t i_stop;
     webvtt_cue_settings_t settings;
     unsigned i_lines;
     text_style_t *p_cssstyle;
@@ -139,7 +139,7 @@ typedef struct
 typedef struct
 {
     WEBVTT_NODE_BASE_MEMBERS
-    mtime_t i_start;
+    vlc_tick_t i_start;
     char *psz_tag;
     char *psz_attrs;
     text_style_t *p_cssstyle;
@@ -551,13 +551,13 @@ static webvtt_dom_node_t * webvtt_domnode_getFirstChild( webvtt_dom_node_t *p_no
 }
 #define webvtt_domnode_getFirstChild(a) webvtt_domnode_getFirstChild((webvtt_dom_node_t *)a)
 
-static mtime_t webvtt_domnode_GetPlaybackTime( const webvtt_dom_node_t *p_node, bool b_end )
+static vlc_tick_t webvtt_domnode_GetPlaybackTime( const webvtt_dom_node_t *p_node, bool b_end )
 {
     for( ; p_node; p_node = p_node->p_parent )
     {
         if( p_node->type == NODE_TAG )
         {
-            mtime_t i_start = ((const webvtt_dom_tag_t *) p_node)->i_start;
+            vlc_tick_t i_start = ((const webvtt_dom_tag_t *) p_node)->i_start;
             if( i_start > -1 && !b_end )
                 return i_start;
         }
@@ -620,11 +620,11 @@ static bool webvtt_domnode_Match_Tag( const webvtt_dom_node_t *p_node, const cha
 }
 
 static bool webvtt_domnode_Match_PseudoClass( const webvtt_dom_node_t *p_node, const char *psz,
-                                              mtime_t i_playbacktime )
+                                              vlc_tick_t i_playbacktime )
 {
     if( !strcmp(psz, "past") || !strcmp(psz, "future") )
     {
-        mtime_t i_start = webvtt_domnode_GetPlaybackTime( p_node, false );
+        vlc_tick_t i_start = webvtt_domnode_GetPlaybackTime( p_node, false );
         return ( *psz == 'p' ) ? i_start < i_playbacktime : i_start > i_playbacktime;
     }
     return false;
@@ -717,7 +717,7 @@ static bool webvtt_domnode_Match_Attribute( const webvtt_dom_node_t *p_node,
 }
 
 static bool webvtt_domnode_MatchType( decoder_t *p_dec, const webvtt_dom_node_t *p_node,
-                                      const vlc_css_selector_t *p_sel, mtime_t i_playbacktime )
+                                      const vlc_css_selector_t *p_sel, vlc_tick_t i_playbacktime )
 {
     VLC_UNUSED(p_dec);
     switch( p_sel->type )
@@ -787,11 +787,11 @@ static void webvtt_domnode_setCSSStyle( webvtt_dom_node_t *p_node, text_style_t
 #ifdef HAVE_CSS
 static void webvtt_domnode_SelectNodesInTree( decoder_t *p_dec, const vlc_css_selector_t *p_sel,
                                               const webvtt_dom_node_t *p_tree, int i_max_depth,
-                                              mtime_t i_playbacktime, vlc_array_t *p_results );
+                                              vlc_tick_t i_playbacktime, vlc_array_t *p_results );
 
 static void webvtt_domnode_SelectChildNodesInTree( decoder_t *p_dec, const vlc_css_selector_t *p_sel,
                                                    const webvtt_dom_node_t *p_root, int i_max_depth,
-                                                   mtime_t i_playbacktime, vlc_array_t *p_results )
+                                                   vlc_tick_t i_playbacktime, vlc_array_t *p_results )
 {
     const webvtt_dom_node_t *p_child = webvtt_domnode_getFirstChild( p_root );
     if( i_max_depth > 0 )
@@ -804,7 +804,7 @@ static void webvtt_domnode_SelectChildNodesInTree( decoder_t *p_dec, const vlc_c
 
 static void webvtt_domnode_SelectNodesBySpeficier( decoder_t *p_dec, const vlc_css_selector_t *p_spec,
                                                    const webvtt_dom_node_t *p_node,
-                                                   mtime_t i_playbacktime, vlc_array_t *p_results )
+                                                   vlc_tick_t i_playbacktime, vlc_array_t *p_results )
 {
     if( p_spec == NULL )
         return;
@@ -838,7 +838,7 @@ static void webvtt_domnode_SelectNodesBySpeficier( decoder_t *p_dec, const vlc_c
 
 static void webvtt_domnode_SelectNodesInTree( decoder_t *p_dec, const vlc_css_selector_t *p_sel,
                                               const webvtt_dom_node_t *p_root, int i_max_depth,
-                                              mtime_t i_playbacktime, vlc_array_t *p_results )
+                                              vlc_tick_t i_playbacktime, vlc_array_t *p_results )
 {
     if( p_root == NULL )
         return;
@@ -860,7 +860,7 @@ static void webvtt_domnode_SelectNodesInTree( decoder_t *p_dec, const vlc_css_se
 }
 
 static void webvtt_domnode_SelectRuleNodes( decoder_t *p_dec, const vlc_css_rule_t *p_rule,
-                                            mtime_t i_playbacktime, vlc_array_t *p_results )
+                                            vlc_tick_t i_playbacktime, vlc_array_t *p_results )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     const webvtt_dom_node_t *p_cues = p_sys->p_root->p_child;
@@ -928,7 +928,7 @@ static const char *SplitTag( const char *psz_tag, size_t *pi_tag, const char **p
 /*****************************************************************************
  *
  *****************************************************************************/
-static webvtt_dom_cue_t * webvtt_dom_cue_New( mtime_t i_start, mtime_t i_end )
+static webvtt_dom_cue_t * webvtt_dom_cue_New( vlc_tick_t i_start, vlc_tick_t i_end )
 {
     webvtt_dom_cue_t *p_cue = calloc( 1, sizeof(*p_cue) );
     if( p_cue )
@@ -1077,7 +1077,7 @@ static void webvtt_region_ClearCues( webvtt_region_t *p_region )
     p_region->p_child = NULL;
 }
 
-static void ClearCuesByTime( webvtt_dom_node_t **pp_next, mtime_t i_time )
+static void ClearCuesByTime( webvtt_dom_node_t **pp_next, vlc_tick_t i_time )
 {
     while( *pp_next )
     {
@@ -1309,7 +1309,7 @@ static text_style_t * ComputeStyle( decoder_t *p_dec, const webvtt_dom_node_t *p
     VLC_UNUSED(p_dec);
     text_style_t *p_style = NULL;
     text_style_t *p_dfltstyle = NULL;
-    mtime_t i_tagtime = -1;
+    vlc_tick_t i_tagtime = -1;
     decoder_sys_t *p_sys = p_dec->p_sys;
 
     for( const webvtt_dom_node_t *p_node = p_leaf ; p_node; p_node = p_node->p_parent )
@@ -1596,7 +1596,7 @@ static void ChainCueSegments( const webvtt_dom_cue_t *p_cue, text_segment_t *p_n
     }
 }
 
-static text_segment_t * ConvertCuesToSegments( decoder_t *p_dec, mtime_t i_start, mtime_t i_stop,
+static text_segment_t * ConvertCuesToSegments( decoder_t *p_dec, vlc_tick_t i_start, vlc_tick_t i_stop,
                                                struct render_variables_s *p_vars,
                                                const webvtt_dom_cue_t *p_cue )
 {
@@ -1619,7 +1619,7 @@ static text_segment_t * ConvertCuesToSegments( decoder_t *p_dec, mtime_t i_start
 }
 
 static void GetTimedTags( const webvtt_dom_node_t *p_node,
-                           mtime_t i_start, mtime_t i_stop, vlc_array_t *p_times )
+                           vlc_tick_t i_start, vlc_tick_t i_stop, vlc_array_t *p_times )
 {
     for( ; p_node; p_node = p_node->p_next )
     {
@@ -1679,7 +1679,7 @@ static void ClearCSSStyles( webvtt_dom_node_t *p_node )
 
 #ifdef HAVE_CSS
 static void ApplyCSSRules( decoder_t *p_dec, const vlc_css_rule_t *p_rule,
-                           mtime_t i_playbacktime )
+                           vlc_tick_t i_playbacktime )
 {
     for ( ;  p_rule ; p_rule = p_rule->p_next )
     {
@@ -1715,7 +1715,7 @@ static void ApplyCSSRules( decoder_t *p_dec, const vlc_css_rule_t *p_rule,
 }
 #endif
 
-static void RenderRegions( decoder_t *p_dec, mtime_t i_start, mtime_t i_stop )
+static void RenderRegions( decoder_t *p_dec, vlc_tick_t i_start, vlc_tick_t i_stop )
 {
     subpicture_t *p_spu = NULL;
     substext_updater_region_t *p_updtregion = NULL;
@@ -1848,7 +1848,7 @@ static int timedtagsArrayCmp( const void *a, const void *b )
     return result == 0 ? 0 : result > 0 ? 1 : -1;
 }
 
-static void Render( decoder_t *p_dec, mtime_t i_start, mtime_t i_stop )
+static void Render( decoder_t *p_dec, vlc_tick_t i_start, vlc_tick_t i_stop )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
@@ -1858,7 +1858,7 @@ static void Render( decoder_t *p_dec, mtime_t i_start, mtime_t i_stop )
     GetTimedTags( p_sys->p_root->p_child, i_start, i_stop, &timedtags );
     qsort( timedtags.pp_elems, timedtags.i_count, sizeof(*timedtags.pp_elems), timedtagsArrayCmp );
 
-    mtime_t i_substart = i_start;
+    vlc_tick_t i_substart = i_start;
     for( size_t i=0; i<timedtags.i_count; i++ )
     {
          const webvtt_dom_tag_t *p_tag =
@@ -1883,7 +1883,7 @@ static void Render( decoder_t *p_dec, mtime_t i_start, mtime_t i_stop )
 
 static int ProcessISOBMFF( decoder_t *p_dec,
                            const uint8_t *p_buffer, size_t i_buffer,
-                           mtime_t i_start, mtime_t i_stop )
+                           vlc_tick_t i_start, vlc_tick_t i_stop )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     mp4_box_iterator_t it;
@@ -2061,8 +2061,8 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
 
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    mtime_t i_start = p_block->i_pts - VLC_TS_0;
-    mtime_t i_stop = i_start + p_block->i_length;
+    vlc_tick_t i_start = p_block->i_pts - VLC_TS_0;
+    vlc_tick_t i_stop = i_start + p_block->i_length;
 
     if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
         ClearCuesByTime( &p_sys->p_root->p_child, INT64_MAX );
diff --git a/modules/codec/webvtt/webvtt.c b/modules/codec/webvtt/webvtt.c
index 855462c05a..b8d991f9d5 100644
--- a/modules/codec/webvtt/webvtt.c
+++ b/modules/codec/webvtt/webvtt.c
@@ -87,7 +87,7 @@ struct webvtt_text_parser_t
     webvtt_cue_t *p_cue;
 };
 
-static mtime_t MakeTime( unsigned t[4] )
+static vlc_tick_t MakeTime( unsigned t[4] )
 {
     return t[0] * 3600 * CLOCK_FREQ +
            t[1] * 60 * CLOCK_FREQ +
@@ -95,7 +95,7 @@ static mtime_t MakeTime( unsigned t[4] )
            t[3] * 1000;
 }
 
-bool webvtt_scan_time( const char *psz, mtime_t *p_time )
+bool webvtt_scan_time( const char *psz, vlc_tick_t *p_time )
 {
     unsigned t[4];
     if( sscanf( psz, "%2u:%2u.%3u",
@@ -244,7 +244,7 @@ void webvtt_text_parser_Feed( webvtt_text_parser_t *p, char *psz_line )
         const char *psz_split = strstr( p->reads[1], " --> " );
         if( psz_split )
         {
-            mtime_t i_start, i_stop;
+            vlc_tick_t i_start, i_stop;
 
             if( webvtt_scan_time( p->reads[1], &i_start ) &&
                 webvtt_scan_time( psz_split + 5,  &i_stop ) && i_start <= i_stop )
diff --git a/modules/codec/webvtt/webvtt.h b/modules/codec/webvtt/webvtt.h
index a45013d909..3b5bb176b0 100644
--- a/modules/codec/webvtt/webvtt.h
+++ b/modules/codec/webvtt/webvtt.h
@@ -42,8 +42,8 @@ enum webvtt_header_line_e
 
 typedef struct
 {
-    mtime_t i_start;
-    mtime_t i_stop;
+    vlc_tick_t i_start;
+    vlc_tick_t i_stop;
     char *psz_id;
     char *psz_text;
     char *psz_attrs;
@@ -75,6 +75,6 @@ webvtt_text_parser_t * webvtt_text_parser_New(
 void webvtt_text_parser_Delete( webvtt_text_parser_t *p );
 void webvtt_text_parser_Feed( webvtt_text_parser_t *p, char *psz_line );
 
-bool webvtt_scan_time( const char *psz, mtime_t *p_time );
+bool webvtt_scan_time( const char *psz, vlc_tick_t *p_time );
 
 #endif
diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 2487803e4a..36641126e3 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -762,7 +762,7 @@ typedef struct
     x264_t          *h;
     x264_param_t    param;
 
-    mtime_t         i_initial_delay;
+    vlc_tick_t      i_initial_delay;
 
     char            *psz_stat_name;
     int             i_sei_size;
diff --git a/modules/codec/x265.c b/modules/codec/x265.c
index 3c02a8cf7e..cee528cc97 100644
--- a/modules/codec/x265.c
+++ b/modules/codec/x265.c
@@ -55,12 +55,12 @@ typedef struct
     x265_encoder    *h;
     x265_param      param;
 
-    mtime_t         i_initial_delay;
+    vlc_tick_t      i_initial_delay;
 
-    mtime_t         dts;
-    mtime_t         initial_date;
+    vlc_tick_t      dts;
+    vlc_tick_t      initial_date;
 #ifndef NDEBUG
-    mtime_t         start;
+    vlc_tick_t      start;
 #endif
 } encoder_sys_t;
 
diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index 4c5147df42..f63f2792fc 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -178,7 +178,7 @@ static int Decode( decoder_t *, block_t * );
 static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
                                  bool b_text,
                                  int i_columns, int i_rows,
-                                 int i_align, mtime_t i_pts );
+                                 int i_align, vlc_tick_t i_pts );
 
 static void EventHandler( vbi_event *ev, void *user_data );
 static int OpaquePage( picture_t *p_src, const vbi_page *p_page,
@@ -516,7 +516,7 @@ error:
 static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
                                  bool b_text,
                                  int i_columns, int i_rows, int i_align,
-                                 mtime_t i_pts )
+                                 vlc_tick_t i_pts )
 {
     video_format_t fmt;
     subpicture_t *p_spu=NULL;
diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index 13c48122f4..588e4413c0 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -336,7 +336,7 @@ static dbus_bool_t add_timeout(DBusTimeout *to, void *data)
     intf_thread_t *intf = data;
     intf_sys_t *sys = intf->p_sys;
 
-    mtime_t *expiry = malloc(sizeof (*expiry));
+    vlc_tick_t *expiry = malloc(sizeof (*expiry));
     if (unlikely(expiry == NULL))
         return FALSE;
 
@@ -365,7 +365,7 @@ static void toggle_timeout(DBusTimeout *to, void *data)
 {
     intf_thread_t *intf = data;
     intf_sys_t *sys = intf->p_sys;
-    mtime_t *expiry = dbus_timeout_get_data(to);
+    vlc_tick_t *expiry = dbus_timeout_get_data(to);
 
     vlc_mutex_lock(&sys->lock);
     if (dbus_timeout_get_enabled(to))
@@ -384,7 +384,7 @@ static void toggle_timeout(DBusTimeout *to, void *data)
 static int next_timeout(intf_thread_t *intf)
 {
     intf_sys_t *sys = intf->p_sys;
-    mtime_t next_timeout = INT64_MAX;
+    vlc_tick_t next_timeout = INT64_MAX;
     unsigned count = vlc_array_count(&sys->timeouts);
 
     for (unsigned i = 0; i < count; i++)
@@ -394,7 +394,7 @@ static int next_timeout(intf_thread_t *intf)
         if (!dbus_timeout_get_enabled(to))
             continue;
 
-        mtime_t *expiry = dbus_timeout_get_data(to);
+        vlc_tick_t *expiry = dbus_timeout_get_data(to);
 
         if (next_timeout > *expiry)
             next_timeout = *expiry;
@@ -427,7 +427,7 @@ static void process_timeouts(intf_thread_t *intf)
         if (!dbus_timeout_get_enabled(to))
             continue;
 
-        mtime_t *expiry = dbus_timeout_get_data(to);
+        vlc_tick_t *expiry = dbus_timeout_get_data(to);
         if (*expiry > mdate())
             continue;
 
@@ -769,7 +769,7 @@ static void *Run( void *data )
 
     int canc = vlc_savecancel();
 
-    mtime_t events_last_date = VLC_TS_INVALID;
+    vlc_tick_t events_last_date = VLC_TS_INVALID;
     int events_poll_timeout = -1;
     for( ;; )
     {
@@ -831,7 +831,7 @@ static void *Run( void *data )
 
         if( i_events > 0 )
         {
-            mtime_t now = mdate();
+            vlc_tick_t now = mdate();
             if( events_last_date == VLC_TS_INVALID
              || now - events_last_date > EVENTS_DELAY )
             {
@@ -953,7 +953,7 @@ static int InputCallback( vlc_object_t *p_this, const char *psz_var,
             break;
         case INPUT_EVENT_POSITION:
         {
-            mtime_t i_now = mdate(), i_pos, i_projected_pos, i_interval;
+            vlc_tick_t i_now = mdate(), i_pos, i_projected_pos, i_interval;
             float f_current_rate;
 
             /* Detect seeks
diff --git a/modules/control/dbus/dbus_common.h b/modules/control/dbus/dbus_common.h
index 58780d0847..cce16efefd 100644
--- a/modules/control/dbus/dbus_common.h
+++ b/modules/control/dbus/dbus_common.h
@@ -105,8 +105,8 @@ struct intf_sys_t
     vlc_thread_t    thread;
     input_thread_t *p_input;
 
-    mtime_t         i_last_input_pos; /* Only access from input thread */
-    mtime_t         i_last_input_pos_event; /* Same as above */
+    vlc_tick_t      i_last_input_pos; /* Only access from input thread */
+    vlc_tick_t      i_last_input_pos_event; /* Same as above */
 };
 
 enum
diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index 15680ec26d..133b9c5b54 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -129,7 +129,7 @@ DBUS_METHOD( Seek )
     input_thread_t *p_input = pl_CurrentInput( p_this );
     if( p_input && var_GetBool( p_input, "can-seek" ) )
     {
-        mtime_t i_pos = var_GetInteger( p_input, "time" ) + i_step;
+        vlc_tick_t i_pos = var_GetInteger( p_input, "time" ) + i_step;
         var_SetInteger( p_input, "time", (i_pos >= 0) ? i_pos : 0 );
     }
 
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index dcf0553a8b..12449d7e6a 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -712,7 +712,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
         case ACTIONID_SUBDELAY_DOWN:
         case ACTIONID_SUBDELAY_UP:
         {
-            mtime_t diff = (i_action == ACTIONID_SUBDELAY_UP) ? 50000 : -50000;
+            vlc_tick_t diff = (i_action == ACTIONID_SUBDELAY_UP) ? 50000 : -50000;
             if( p_input )
             {
                 vlc_value_t val;
@@ -729,7 +729,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
                     free(list);
                     break;
                 }
-                mtime_t i_delay = var_GetInteger( p_input, "spu-delay" ) + diff;
+                vlc_tick_t i_delay = var_GetInteger( p_input, "spu-delay" ) + diff;
 
                 var_SetInteger( p_input, "spu-delay", i_delay );
                 ClearChannels( p_vout, slider_chan );
@@ -742,10 +742,10 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
         case ACTIONID_AUDIODELAY_DOWN:
         case ACTIONID_AUDIODELAY_UP:
         {
-            mtime_t diff = (i_action == ACTIONID_AUDIODELAY_UP) ? 50000 : -50000;
+            vlc_tick_t diff = (i_action == ACTIONID_AUDIODELAY_UP) ? 50000 : -50000;
             if( p_input )
             {
-                mtime_t i_delay = var_GetInteger( p_input, "audio-delay" )
+                vlc_tick_t i_delay = var_GetInteger( p_input, "audio-delay" )
                                   + diff;
 
                 var_SetInteger( p_input, "audio-delay", i_delay );
@@ -978,7 +978,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
                     break;
             }
 
-            mtime_t it = var_InheritInteger( p_input, varname );
+            vlc_tick_t it = var_InheritInteger( p_input, varname );
             if( it < 0 )
                 break;
             var_SetInteger( p_input, "time-offset", it * sign * CLOCK_FREQ );
diff --git a/modules/control/netsync.c b/modules/control/netsync.c
index 82479db9d5..2a6a1a6a2b 100644
--- a/modules/control/netsync.c
+++ b/modules/control/netsync.c
@@ -163,11 +163,11 @@ void Close(vlc_object_t *object)
     free(sys);
 }
 
-static mtime_t GetPcrSystem(input_thread_t *input)
+static vlc_tick_t GetPcrSystem(input_thread_t *input)
 {
     int canc = vlc_savecancel();
     /* TODO use the delay */
-    mtime_t system;
+    vlc_tick_t system;
     if (input_GetPcrSystem(input, &system, NULL))
         system = -1;
     vlc_restorecancel(canc);
@@ -194,7 +194,7 @@ static void *Master(void *handle)
                      (struct sockaddr *)&from, &fromlen) < 8)
             continue;
 
-        mtime_t master_system = GetPcrSystem(sys->input);
+        vlc_tick_t master_system = GetPcrSystem(sys->input);
         if (master_system < 0)
             continue;
 
@@ -207,7 +207,7 @@ static void *Master(void *handle)
 #if 0
         /* not sure we need the client information to sync,
            since we are the master anyway */
-        mtime_t client_system = ntoh64(data[0]);
+        vlc_tick_t client_system = ntoh64(data[0]);
         msg_Dbg(intf, "Master clockref: %"PRId64" -> %"PRId64", from %s "
                  "(date: %"PRId64")", client_system, master_system,
                  (from.ss_family == AF_INET) ? inet_ntoa(((struct sockaddr_in *)&from)->sin_addr)
@@ -226,12 +226,12 @@ static void *Slave(void *handle)
         struct pollfd ufd = { .fd = sys->fd, .events = POLLIN, };
         uint64_t data[2];
 
-        mtime_t system = GetPcrSystem(sys->input);
+        vlc_tick_t system = GetPcrSystem(sys->input);
         if (system < 0)
             goto wait;
 
         /* Send clock request to the master */
-        const mtime_t send_date = mdate();
+        const vlc_tick_t send_date = mdate();
 
         data[0] = hton64(system);
         send(sys->fd, data, 8, 0);
@@ -240,21 +240,21 @@ static void *Slave(void *handle)
         if (poll(&ufd, 1, sys->timeout) <= 0)
             continue;
 
-        const mtime_t receive_date = mdate();
+        const vlc_tick_t receive_date = mdate();
         if (recv(sys->fd, data, 16, 0) < 16)
             goto wait;
 
-        const mtime_t master_date   = ntoh64(data[0]);
-        const mtime_t master_system = ntoh64(data[1]);
-        const mtime_t diff_date = receive_date -
+        const vlc_tick_t master_date   = ntoh64(data[0]);
+        const vlc_tick_t master_system = ntoh64(data[1]);
+        const vlc_tick_t diff_date = receive_date -
                                   ((receive_date - send_date) / 2 + master_date);
 
         if (master_system > 0) {
             int canc = vlc_savecancel();
 
-            mtime_t client_system;
+            vlc_tick_t client_system;
             if (!input_GetPcrSystem(sys->input, &client_system, NULL)) {
-                const mtime_t diff_system = client_system - master_system - diff_date;
+                const vlc_tick_t diff_system = client_system - master_system - diff_date;
                 if (diff_system != 0) {
                     input_ModifyPcrSystem(sys->input, true, master_system - diff_date);
 #if 0
diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 60a01a7966..657136a775 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -192,7 +192,7 @@ void PlaylistManager::stop()
 struct PrioritizedAbstractStream
 {
     AbstractStream::buffering_status status;
-    mtime_t demuxed_amount;
+    vlc_tick_t demuxed_amount;
     AbstractStream *st;
 };
 
@@ -208,8 +208,8 @@ static bool streamCompare(const PrioritizedAbstractStream &a,  const Prioritized
     return false;
 }
 
-AbstractStream::buffering_status PlaylistManager::bufferize(mtime_t i_nzdeadline,
-                                                            mtime_t i_min_buffering, mtime_t i_extra_buffering)
+AbstractStream::buffering_status PlaylistManager::bufferize(vlc_tick_t i_nzdeadline,
+                                                            vlc_tick_t i_min_buffering, vlc_tick_t i_extra_buffering)
 {
     AbstractStream::buffering_status i_return = AbstractStream::buffering_end;
 
@@ -258,18 +258,18 @@ AbstractStream::buffering_status PlaylistManager::bufferize(mtime_t i_nzdeadline
     return i_return;
 }
 
-AbstractStream::status PlaylistManager::dequeue(mtime_t i_floor, mtime_t *pi_nzbarrier)
+AbstractStream::status PlaylistManager::dequeue(vlc_tick_t i_floor, vlc_tick_t *pi_nzbarrier)
 {
     AbstractStream::status i_return = AbstractStream::status_eof;
 
-    const mtime_t i_nzdeadline = *pi_nzbarrier;
+    const vlc_tick_t i_nzdeadline = *pi_nzbarrier;
 
     std::vector<AbstractStream *>::iterator it;
     for(it=streams.begin(); it!=streams.end(); ++it)
     {
         AbstractStream *st = *it;
 
-        mtime_t i_pcr;
+        vlc_tick_t i_pcr;
         AbstractStream::status i_ret = st->dequeue(i_nzdeadline, &i_pcr);
         if( i_ret > i_return )
             i_return = i_ret;
@@ -305,19 +305,19 @@ void PlaylistManager::drain()
     es_out_Control(p_demux->out, ES_OUT_RESET_PCR);
 }
 
-mtime_t PlaylistManager::getResumeTime() const
+vlc_tick_t PlaylistManager::getResumeTime() const
 {
     vlc_mutex_locker locker(const_cast<vlc_mutex_t *>(&demux.lock));
     return demux.i_nzpcr;
 }
 
-mtime_t PlaylistManager::getFirstDTS() const
+vlc_tick_t PlaylistManager::getFirstDTS() const
 {
-    mtime_t mindts = VLC_TS_INVALID;
+    vlc_tick_t mindts = VLC_TS_INVALID;
     std::vector<AbstractStream *>::const_iterator it;
     for(it=streams.begin(); it!=streams.end(); ++it)
     {
-        const mtime_t dts = (*it)->getFirstDTS();
+        const vlc_tick_t dts = (*it)->getFirstDTS();
         if(mindts == VLC_TS_INVALID)
             mindts = dts;
         else if(dts != VLC_TS_INVALID)
@@ -326,7 +326,7 @@ mtime_t PlaylistManager::getFirstDTS() const
     return mindts;
 }
 
-mtime_t PlaylistManager::getDuration() const
+vlc_tick_t PlaylistManager::getDuration() const
 {
     if (playlist->isLive())
         return 0;
@@ -334,7 +334,7 @@ mtime_t PlaylistManager::getDuration() const
         return playlist->duration.Get();
 }
 
-bool PlaylistManager::setPosition(mtime_t time)
+bool PlaylistManager::setPosition(vlc_tick_t time)
 {
     bool ret = true;
     bool hasValidStream = false;
@@ -383,19 +383,19 @@ bool PlaylistManager::updatePlaylist()
     return true;
 }
 
-mtime_t PlaylistManager::getFirstPlaybackTime() const
+vlc_tick_t PlaylistManager::getFirstPlaybackTime() const
 {
     return 0;
 }
 
-mtime_t PlaylistManager::getCurrentPlaybackTime() const
+vlc_tick_t PlaylistManager::getCurrentPlaybackTime() const
 {
     return demux.i_nzpcr;
 }
 
 void PlaylistManager::pruneLiveStream()
 {
-    mtime_t minValidPos = getResumeTime();
+    vlc_tick_t minValidPos = getResumeTime();
     if(minValidPos != VLC_TS_INVALID)
         playlist->pruneByPlaybackTime(minValidPos);
 }
@@ -412,7 +412,7 @@ int PlaylistManager::demux_callback(demux_t *p_demux)
     return manager->doDemux(DEMUX_INCREMENT);
 }
 
-int PlaylistManager::doDemux(mtime_t increment)
+int PlaylistManager::doDemux(vlc_tick_t increment)
 {
     vlc_mutex_lock(&demux.lock);
     if(demux.i_nzpcr == VLC_TS_INVALID)
@@ -430,7 +430,7 @@ int PlaylistManager::doDemux(mtime_t increment)
     if(demux.i_firstpcr == VLC_TS_INVALID)
         demux.i_firstpcr = demux.i_nzpcr;
 
-    mtime_t i_nzbarrier = demux.i_nzpcr + increment;
+    vlc_tick_t i_nzbarrier = demux.i_nzpcr + increment;
     vlc_mutex_unlock(&demux.lock);
 
     AbstractStream::status status = dequeue(demux.i_nzpcr, &i_nzbarrier);
@@ -479,7 +479,7 @@ int PlaylistManager::doDemux(mtime_t increment)
         if( demux.i_nzpcr != VLC_TS_INVALID && i_nzbarrier != demux.i_nzpcr )
         {
             demux.i_nzpcr = i_nzbarrier;
-            mtime_t pcr = VLC_TS_0 + std::max(INT64_C(0), demux.i_nzpcr - CLOCK_FREQ / 10);
+            vlc_tick_t pcr = VLC_TS_0 + std::max(INT64_C(0), demux.i_nzpcr - CLOCK_FREQ / 10);
             es_out_Control(p_demux->out, ES_OUT_SET_GROUP_PCR, 0, pcr);
         }
         vlc_mutex_unlock(&demux.lock);
@@ -554,7 +554,7 @@ int PlaylistManager::doControl(int i_query, va_list args)
         {
             setBufferingRunState(false); /* stop downloader first */
 
-            const mtime_t i_duration = getDuration();
+            const vlc_tick_t i_duration = getDuration();
             if(i_duration == 0) /* == playlist->isLive() */
             {
                 setBufferingRunState(true);
@@ -617,8 +617,8 @@ void PlaylistManager::setBufferingRunState(bool b)
 void PlaylistManager::Run()
 {
     vlc_mutex_lock(&lock);
-    const mtime_t i_min_buffering = playlist->getMinBuffering();
-    const mtime_t i_extra_buffering = playlist->getMaxBuffering() - i_min_buffering;
+    const vlc_tick_t i_min_buffering = playlist->getMinBuffering();
+    const vlc_tick_t i_extra_buffering = playlist->getMaxBuffering() - i_min_buffering;
     while(1)
     {
         mutex_cleanup_push(&lock);
@@ -638,7 +638,7 @@ void PlaylistManager::Run()
         }
 
         vlc_mutex_lock(&demux.lock);
-        mtime_t i_nzpcr = demux.i_nzpcr;
+        vlc_tick_t i_nzpcr = demux.i_nzpcr;
         vlc_mutex_unlock(&demux.lock);
 
         int canc = vlc_savecancel();
@@ -647,7 +647,7 @@ void PlaylistManager::Run()
 
         if(i_return != AbstractStream::buffering_lessthanmin)
         {
-            mtime_t i_deadline = mdate();
+            vlc_tick_t i_deadline = mdate();
             if(i_return == AbstractStream::buffering_ongoing)
                 i_deadline += (CLOCK_FREQ / 100);
             else if(i_return == AbstractStream::buffering_full)
@@ -680,18 +680,18 @@ void * PlaylistManager::managerThread(void *opaque)
 void PlaylistManager::updateControlsPosition()
 {
     vlc_mutex_locker locker(&cached.lock);
-    const mtime_t i_duration = cached.i_length;
+    const vlc_tick_t i_duration = cached.i_length;
     if(i_duration == 0)
     {
         cached.f_position = 0.0;
     }
     else
     {
-        const mtime_t i_length = getCurrentPlaybackTime() - getFirstPlaybackTime();
+        const vlc_tick_t i_length = getCurrentPlaybackTime() - getFirstPlaybackTime();
         cached.f_position = (double) i_length / i_duration;
     }
 
-    mtime_t i_time = getCurrentPlaybackTime();
+    vlc_tick_t i_time = getCurrentPlaybackTime();
     if(!playlist->isLive())
         i_time -= getFirstPlaybackTime();
     cached.i_time = i_time;
diff --git a/modules/demux/adaptive/PlaylistManager.h b/modules/demux/adaptive/PlaylistManager.h
index 12b20996e4..56b1ad5d1f 100644
--- a/modules/demux/adaptive/PlaylistManager.h
+++ b/modules/demux/adaptive/PlaylistManager.h
@@ -57,8 +57,8 @@ namespace adaptive
             bool    start();
             void    stop();
 
-            AbstractStream::buffering_status bufferize(mtime_t, mtime_t, mtime_t);
-            AbstractStream::status dequeue(mtime_t, mtime_t *);
+            AbstractStream::buffering_status bufferize(vlc_tick_t, vlc_tick_t, vlc_tick_t);
+            AbstractStream::status dequeue(vlc_tick_t, vlc_tick_t *);
             void drain();
 
             virtual bool needsUpdate() const;
@@ -72,15 +72,15 @@ namespace adaptive
         protected:
             /* Demux calls */
             virtual int doControl(int, va_list);
-            virtual int doDemux(mtime_t);
+            virtual int doDemux(vlc_tick_t);
 
-            virtual bool    setPosition(mtime_t);
-            virtual mtime_t getDuration() const;
-            mtime_t getResumeTime() const;
-            mtime_t getFirstDTS() const;
+            virtual bool    setPosition(vlc_tick_t);
+            virtual vlc_tick_t getDuration() const;
+            vlc_tick_t getResumeTime() const;
+            vlc_tick_t getFirstDTS() const;
 
-            virtual mtime_t getFirstPlaybackTime() const;
-            mtime_t getCurrentPlaybackTime() const;
+            virtual vlc_tick_t getFirstPlaybackTime() const;
+            vlc_tick_t getCurrentPlaybackTime() const;
 
             void pruneLiveStream();
             virtual bool reactivateStream(AbstractStream *);
@@ -107,8 +107,8 @@ namespace adaptive
             /* shared with demux/buffering */
             struct
             {
-                mtime_t     i_nzpcr;
-                mtime_t     i_firstpcr;
+                vlc_tick_t  i_nzpcr;
+                vlc_tick_t  i_firstpcr;
                 vlc_mutex_t lock;
                 vlc_cond_t  cond;
             } demux;
@@ -121,8 +121,8 @@ namespace adaptive
             struct
             {
                 bool        b_live;
-                mtime_t     i_length;
-                mtime_t     i_time;
+                vlc_tick_t  i_length;
+                vlc_tick_t  i_time;
                 double      f_position;
                 vlc_mutex_t lock;
             } cached;
diff --git a/modules/demux/adaptive/SegmentTracker.cpp b/modules/demux/adaptive/SegmentTracker.cpp
index ce5db8874f..321488a8fb 100644
--- a/modules/demux/adaptive/SegmentTracker.cpp
+++ b/modules/demux/adaptive/SegmentTracker.cpp
@@ -60,7 +60,7 @@ SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, bool enabled)
     u.buffering.id = &id;
 }
 
-SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, mtime_t min, mtime_t current, mtime_t target)
+SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, vlc_tick_t min, vlc_tick_t current, vlc_tick_t target)
 {
     type = BUFFERING_LEVEL_CHANGE;
     u.buffering_level.minimum = min;
@@ -69,7 +69,7 @@ SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, mtime_t min, mtime_t curr
     u.buffering.id = &id;
 }
 
-SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, mtime_t duration)
+SegmentTrackerEvent::SegmentTrackerEvent(const ID &id, vlc_tick_t duration)
 {
     type = SEGMENT_CHANGE;
     u.segment.duration = duration;
@@ -278,7 +278,7 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed,
     return chunk;
 }
 
-bool SegmentTracker::setPositionByTime(mtime_t time, bool restarted, bool tryonly)
+bool SegmentTracker::setPositionByTime(vlc_tick_t time, bool restarted, bool tryonly)
 {
     uint64_t segnumber;
     BaseRepresentation *rep = curRepresentation;
@@ -306,9 +306,9 @@ void SegmentTracker::setPositionByNumber(uint64_t segnumber, bool restarted)
     curNumber = next = segnumber;
 }
 
-mtime_t SegmentTracker::getPlaybackTime() const
+vlc_tick_t SegmentTracker::getPlaybackTime() const
 {
-    mtime_t time, duration;
+    vlc_tick_t time, duration;
 
     BaseRepresentation *rep = curRepresentation;
     if(!rep)
@@ -322,7 +322,7 @@ mtime_t SegmentTracker::getPlaybackTime() const
     return 0;
 }
 
-mtime_t SegmentTracker::getMinAheadTime() const
+vlc_tick_t SegmentTracker::getMinAheadTime() const
 {
     BaseRepresentation *rep = curRepresentation;
     if(!rep)
@@ -337,7 +337,7 @@ void SegmentTracker::notifyBufferingState(bool enabled) const
     notify(SegmentTrackerEvent(adaptationSet->getID(), enabled));
 }
 
-void SegmentTracker::notifyBufferingLevel(mtime_t min, mtime_t current, mtime_t target) const
+void SegmentTracker::notifyBufferingLevel(vlc_tick_t min, vlc_tick_t current, vlc_tick_t target) const
 {
     notify(SegmentTrackerEvent(adaptationSet->getID(), min, current, target));
 }
diff --git a/modules/demux/adaptive/SegmentTracker.hpp b/modules/demux/adaptive/SegmentTracker.hpp
index 2c1f7ccb91..cb95227d64 100644
--- a/modules/demux/adaptive/SegmentTracker.hpp
+++ b/modules/demux/adaptive/SegmentTracker.hpp
@@ -57,8 +57,8 @@ namespace adaptive
             SegmentTrackerEvent(BaseRepresentation *, BaseRepresentation *);
             SegmentTrackerEvent(const StreamFormat *);
             SegmentTrackerEvent(const ID &, bool);
-            SegmentTrackerEvent(const ID &, mtime_t, mtime_t, mtime_t);
-            SegmentTrackerEvent(const ID &, mtime_t);
+            SegmentTrackerEvent(const ID &, vlc_tick_t, vlc_tick_t, vlc_tick_t);
+            SegmentTrackerEvent(const ID &, vlc_tick_t);
             enum
             {
                 DISCONTINUITY,
@@ -91,14 +91,14 @@ namespace adaptive
                struct
                {
                    const ID *id;
-                   mtime_t minimum;
-                   mtime_t current;
-                   mtime_t target;
+                   vlc_tick_t minimum;
+                   vlc_tick_t current;
+                   vlc_tick_t target;
                } buffering_level;
                struct
                {
                     const ID *id;
-                   mtime_t duration;
+                   vlc_tick_t duration;
                } segment;
             } u;
     };
@@ -119,12 +119,12 @@ namespace adaptive
             bool segmentsListReady() const;
             void reset();
             SegmentChunk* getNextChunk(bool, AbstractConnectionManager *);
-            bool setPositionByTime(mtime_t, bool, bool);
+            bool setPositionByTime(vlc_tick_t, bool, bool);
             void setPositionByNumber(uint64_t, bool);
-            mtime_t getPlaybackTime() const; /* Current segment start time if selected */
-            mtime_t getMinAheadTime() const;
+            vlc_tick_t getPlaybackTime() const; /* Current segment start time if selected */
+            vlc_tick_t getMinAheadTime() const;
             void notifyBufferingState(bool) const;
-            void notifyBufferingLevel(mtime_t, mtime_t, mtime_t) const;
+            void notifyBufferingLevel(vlc_tick_t, vlc_tick_t, vlc_tick_t) const;
             void registerListener(SegmentTrackerListenerInterface *);
             void updateSelected();
 
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 8550b4bf0d..5e0ad728d1 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -144,24 +144,24 @@ void AbstractStream::setDescription(const std::string &desc)
     description = desc;
 }
 
-mtime_t AbstractStream::getPCR() const
+vlc_tick_t AbstractStream::getPCR() const
 {
     vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
-    mtime_t pcr = isDisabled() ? VLC_TS_INVALID : commandsqueue->getPCR();
+    vlc_tick_t pcr = isDisabled() ? VLC_TS_INVALID : commandsqueue->getPCR();
     vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
     return pcr;
 }
 
-mtime_t AbstractStream::getMinAheadTime() const
+vlc_tick_t AbstractStream::getMinAheadTime() const
 {
     if(!segmentTracker)
         return 0;
     return segmentTracker->getMinAheadTime();
 }
 
-mtime_t AbstractStream::getFirstDTS() const
+vlc_tick_t AbstractStream::getFirstDTS() const
 {
-    mtime_t dts;
+    vlc_tick_t dts;
     vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
     if(isDisabled())
     {
@@ -208,7 +208,7 @@ bool AbstractStream::isSelected() const
     return fakeesout->hasSelectedEs();
 }
 
-bool AbstractStream::reactivate(mtime_t basetime)
+bool AbstractStream::reactivate(vlc_tick_t basetime)
 {
     if(setPosition(basetime, false))
     {
@@ -289,20 +289,20 @@ AbstractStream::buffering_status AbstractStream::getLastBufferStatus() const
     return last_buffer_status;
 }
 
-mtime_t AbstractStream::getDemuxedAmount() const
+vlc_tick_t AbstractStream::getDemuxedAmount() const
 {
     return commandsqueue->getDemuxedAmount();
 }
 
-AbstractStream::buffering_status AbstractStream::bufferize(mtime_t nz_deadline,
-                                                           mtime_t i_min_buffering, mtime_t i_extra_buffering)
+AbstractStream::buffering_status AbstractStream::bufferize(vlc_tick_t nz_deadline,
+                                                           vlc_tick_t i_min_buffering, vlc_tick_t i_extra_buffering)
 {
     last_buffer_status = doBufferize(nz_deadline, i_min_buffering, i_extra_buffering);
     return last_buffer_status;
 }
 
-AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline,
-                                                             mtime_t i_min_buffering, mtime_t i_extra_buffering)
+AbstractStream::buffering_status AbstractStream::doBufferize(vlc_tick_t nz_deadline,
+                                                             vlc_tick_t i_min_buffering, vlc_tick_t i_extra_buffering)
 {
     vlc_mutex_lock(&lock);
 
@@ -353,9 +353,9 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
         }
     }
 
-    const mtime_t i_total_buffering = i_min_buffering + i_extra_buffering;
+    const vlc_tick_t i_total_buffering = i_min_buffering + i_extra_buffering;
 
-    mtime_t i_demuxed = commandsqueue->getDemuxedAmount();
+    vlc_tick_t i_demuxed = commandsqueue->getDemuxedAmount();
     segmentTracker->notifyBufferingLevel(i_min_buffering, i_demuxed, i_total_buffering);
     if(i_demuxed < i_total_buffering) /* not already demuxed */
     {
@@ -365,7 +365,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
             return AbstractStream::buffering_suspended;
         }
 
-        mtime_t nz_extdeadline = commandsqueue->getBufferingLevel() +
+        vlc_tick_t nz_extdeadline = commandsqueue->getBufferingLevel() +
                                 (i_total_buffering - commandsqueue->getDemuxedAmount()) / 4;
         nz_deadline = std::max(nz_deadline, nz_extdeadline);
 
@@ -407,7 +407,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
     return AbstractStream::buffering_full;
 }
 
-AbstractStream::status AbstractStream::dequeue(mtime_t nz_deadline, mtime_t *pi_pcr)
+AbstractStream::status AbstractStream::dequeue(vlc_tick_t nz_deadline, vlc_tick_t *pi_pcr)
 {
     vlc_mutex_locker locker(&lock);
 
@@ -498,7 +498,7 @@ block_t * AbstractStream::readNextBlock()
     return block;
 }
 
-bool AbstractStream::setPosition(mtime_t time, bool tryonly)
+bool AbstractStream::setPosition(vlc_tick_t time, bool tryonly)
 {
     if(!seekAble())
         return false;
@@ -538,7 +538,7 @@ bool AbstractStream::setPosition(mtime_t time, bool tryonly)
     return ret;
 }
 
-mtime_t AbstractStream::getPlaybackTime() const
+vlc_tick_t AbstractStream::getPlaybackTime() const
 {
     return segmentTracker->getPlaybackTime();
 }
@@ -557,7 +557,7 @@ void AbstractStream::fillExtraFMTInfo( es_format_t *p_fmt ) const
         p_fmt->psz_description = strdup(description.c_str());
 }
 
-void AbstractStream::setTimeOffset(mtime_t i_offset)
+void AbstractStream::setTimeOffset(vlc_tick_t i_offset)
 {
     /* Check if we need to set an offset as the demuxer
      * will start from zero from seek point */
diff --git a/modules/demux/adaptive/Streams.hpp b/modules/demux/adaptive/Streams.hpp
index 42144598fe..f74db017ee 100644
--- a/modules/demux/adaptive/Streams.hpp
+++ b/modules/demux/adaptive/Streams.hpp
@@ -61,13 +61,13 @@ namespace adaptive
 
         void setLanguage(const std::string &);
         void setDescription(const std::string &);
-        mtime_t getPCR() const;
-        mtime_t getMinAheadTime() const;
-        mtime_t getFirstDTS() const;
+        vlc_tick_t getPCR() const;
+        vlc_tick_t getMinAheadTime() const;
+        vlc_tick_t getFirstDTS() const;
         int esCount() const;
         bool isSelected() const;
         bool canActivate() const;
-        virtual bool reactivate(mtime_t);
+        virtual bool reactivate(vlc_tick_t);
         void setDisabled(bool);
         bool isDisabled() const;
         typedef enum {
@@ -83,13 +83,13 @@ namespace adaptive
             buffering_ongoing,
             buffering_lessthanmin,
         } buffering_status;
-        buffering_status bufferize(mtime_t, mtime_t, mtime_t);
+        buffering_status bufferize(vlc_tick_t, vlc_tick_t, vlc_tick_t);
         buffering_status getLastBufferStatus() const;
-        mtime_t getDemuxedAmount() const;
-        status dequeue(mtime_t, mtime_t *);
+        vlc_tick_t getDemuxedAmount() const;
+        status dequeue(vlc_tick_t, vlc_tick_t *);
         bool decodersDrained();
-        virtual bool setPosition(mtime_t, bool);
-        mtime_t getPlaybackTime() const;
+        virtual bool setPosition(vlc_tick_t, bool);
+        vlc_tick_t getPlaybackTime() const;
         void runUpdates();
 
         /* Used by demuxers fake streams */
@@ -102,7 +102,7 @@ namespace adaptive
 
     protected:
         bool seekAble() const;
-        virtual void setTimeOffset(mtime_t);
+        virtual void setTimeOffset(vlc_tick_t);
         virtual block_t *checkBlock(block_t *, bool) = 0;
         AbstractDemuxer * createDemux(const StreamFormat &);
         virtual AbstractDemuxer * newDemux(demux_t *, const StreamFormat &,
@@ -134,7 +134,7 @@ namespace adaptive
         vlc_mutex_t lock; /* lock for everything accessed by dequeuing */
 
     private:
-        buffering_status doBufferize(mtime_t, mtime_t, mtime_t);
+        buffering_status doBufferize(vlc_tick_t, vlc_tick_t, vlc_tick_t);
         buffering_status last_buffer_status;
         bool dead;
         bool disabled;
diff --git a/modules/demux/adaptive/Time.hpp b/modules/demux/adaptive/Time.hpp
index 5302d17a21..2d9638e334 100644
--- a/modules/demux/adaptive/Time.hpp
+++ b/modules/demux/adaptive/Time.hpp
@@ -30,7 +30,7 @@ class Timescale
     public:
         Timescale(uint64_t v = 0) : scale(v) {}
 
-        mtime_t ToTime(stime_t t) const
+        vlc_tick_t ToTime(stime_t t) const
         {
             if( !scale ) return 0;
             stime_t v = t / scale;
@@ -38,10 +38,10 @@ class Timescale
             return v * 1000000 + r * 1000000 / scale;
         }
 
-        stime_t ToScaled(mtime_t t) const
+        stime_t ToScaled(vlc_tick_t t) const
         {
-            mtime_t v = t / 1000000;
-            mtime_t r = t % 1000000;
+            vlc_tick_t v = t / 1000000;
+            vlc_tick_t r = t % 1000000;
             return v * scale + r * scale / 1000000;
         }
 
diff --git a/modules/demux/adaptive/http/Chunk.cpp b/modules/demux/adaptive/http/Chunk.cpp
index 20a5644612..08ca84784c 100644
--- a/modules/demux/adaptive/http/Chunk.cpp
+++ b/modules/demux/adaptive/http/Chunk.cpp
@@ -192,7 +192,7 @@ block_t * HTTPChunkSource::read(size_t readsize)
         return NULL;
     }
 
-    mtime_t time = mdate();
+    vlc_tick_t time = mdate();
     ssize_t ret = connection->read(p_block->p_buffer, readsize);
     time = mdate() - time;
     if(ret < 0)
@@ -358,7 +358,7 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
     struct
     {
         size_t size;
-        mtime_t time;
+        vlc_tick_t time;
     } rate = {0,0};
 
     ssize_t ret = connection->read(p_block->p_buffer, readsize);
diff --git a/modules/demux/adaptive/http/Chunk.h b/modules/demux/adaptive/http/Chunk.h
index a8e73a0522..8470696457 100644
--- a/modules/demux/adaptive/http/Chunk.h
+++ b/modules/demux/adaptive/http/Chunk.h
@@ -135,7 +135,7 @@ namespace adaptive
                 size_t              buffered; /* read cache size */
                 bool                done;
                 bool                eof;
-                mtime_t             downloadstart;
+                vlc_tick_t          downloadstart;
                 mutable vlc_mutex_t lock;
                 vlc_cond_t          avail;
                 bool                held;
diff --git a/modules/demux/adaptive/http/HTTPConnectionManager.cpp b/modules/demux/adaptive/http/HTTPConnectionManager.cpp
index a6f1baf347..dc4c187b0f 100644
--- a/modules/demux/adaptive/http/HTTPConnectionManager.cpp
+++ b/modules/demux/adaptive/http/HTTPConnectionManager.cpp
@@ -47,7 +47,7 @@ AbstractConnectionManager::~AbstractConnectionManager()
 
 }
 
-void AbstractConnectionManager::updateDownloadRate(const adaptive::ID &sourceid, size_t size, mtime_t time)
+void AbstractConnectionManager::updateDownloadRate(const adaptive::ID &sourceid, size_t size, vlc_tick_t time)
 {
     if(rateObserver)
         rateObserver->updateDownloadRate(sourceid, size, time);
diff --git a/modules/demux/adaptive/http/HTTPConnectionManager.h b/modules/demux/adaptive/http/HTTPConnectionManager.h
index 09e65530a4..5fc4cf0f11 100644
--- a/modules/demux/adaptive/http/HTTPConnectionManager.h
+++ b/modules/demux/adaptive/http/HTTPConnectionManager.h
@@ -53,7 +53,7 @@ namespace adaptive
                 virtual void start(AbstractChunkSource *) = 0;
                 virtual void cancel(AbstractChunkSource *) = 0;
 
-                virtual void updateDownloadRate(const ID &, size_t, mtime_t); /* impl */
+                virtual void updateDownloadRate(const ID &, size_t, vlc_tick_t); /* impl */
                 void setDownloadRateObserver(IDownloadRateObserver *);
 
             protected:
diff --git a/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp b/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp
index a5336d5a8d..3f53b396be 100644
--- a/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp
+++ b/modules/demux/adaptive/logic/AbstractAdaptationLogic.cpp
@@ -41,7 +41,7 @@ AbstractAdaptationLogic::~AbstractAdaptationLogic   ()
 {
 }
 
-void AbstractAdaptationLogic::updateDownloadRate    (const adaptive::ID &, size_t, mtime_t)
+void AbstractAdaptationLogic::updateDownloadRate    (const adaptive::ID &, size_t, vlc_tick_t)
 {
 }
 
diff --git a/modules/demux/adaptive/logic/AbstractAdaptationLogic.h b/modules/demux/adaptive/logic/AbstractAdaptationLogic.h
index 9049dea688..53e43b7bae 100644
--- a/modules/demux/adaptive/logic/AbstractAdaptationLogic.h
+++ b/modules/demux/adaptive/logic/AbstractAdaptationLogic.h
@@ -48,7 +48,7 @@ namespace adaptive
                 virtual ~AbstractAdaptationLogic    ();
 
                 virtual BaseRepresentation* getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *) = 0;
-                virtual void                updateDownloadRate     (const ID &, size_t, mtime_t);
+                virtual void                updateDownloadRate     (const ID &, size_t, vlc_tick_t);
                 virtual void                trackerEvent           (const SegmentTrackerEvent &) {}
                 void                        setMaxDeviceResolution (int, int);
 
diff --git a/modules/demux/adaptive/logic/IDownloadRateObserver.h b/modules/demux/adaptive/logic/IDownloadRateObserver.h
index 76eb425e61..75c0a217c7 100644
--- a/modules/demux/adaptive/logic/IDownloadRateObserver.h
+++ b/modules/demux/adaptive/logic/IDownloadRateObserver.h
@@ -34,7 +34,7 @@ namespace adaptive
     class IDownloadRateObserver
     {
         public:
-            virtual void updateDownloadRate(const ID &, size_t, mtime_t) = 0;
+            virtual void updateDownloadRate(const ID &, size_t, vlc_tick_t) = 0;
             virtual ~IDownloadRateObserver(){}
     };
 }
diff --git a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
index a8f9143991..7a067abe50 100644
--- a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
+++ b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
@@ -65,7 +65,7 @@ NearOptimalAdaptationLogic::~NearOptimalAdaptationLogic()
 
 BaseRepresentation *
 NearOptimalAdaptationLogic::getNextQualityIndex( BaseAdaptationSet *adaptSet, RepresentationSelector &selector,
-                                                 float gammaP, mtime_t VD, mtime_t Q )
+                                                 float gammaP, vlc_tick_t VD, vlc_tick_t Q )
 {
     BaseRepresentation *ret = NULL;
     BaseRepresentation *prev = NULL;
@@ -177,7 +177,7 @@ unsigned NearOptimalAdaptationLogic::getMaxCurrentBw() const
     return i_max_bitrate;
 }
 
-void NearOptimalAdaptationLogic::updateDownloadRate(const ID &id, size_t dlsize, mtime_t time)
+void NearOptimalAdaptationLogic::updateDownloadRate(const ID &id, size_t dlsize, vlc_tick_t time)
 {
     vlc_mutex_lock(&lock);
     std::map<ID, NearOptimalContext>::iterator it = streams.find(id);
diff --git a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.hpp b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.hpp
index cd16618cb0..1a3f4ef2be 100644
--- a/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.hpp
+++ b/modules/demux/adaptive/logic/NearOptimalAdaptationLogic.hpp
@@ -37,9 +37,9 @@ namespace adaptive
                 NearOptimalContext();
 
             private:
-                mtime_t buffering_min;
-                mtime_t buffering_level;
-                mtime_t buffering_target;
+                vlc_tick_t buffering_min;
+                vlc_tick_t buffering_level;
+                vlc_tick_t buffering_target;
                 unsigned last_download_rate;
                 MovingAverage<unsigned> average;
         };
@@ -51,13 +51,13 @@ namespace adaptive
                 virtual ~NearOptimalAdaptationLogic();
 
                 virtual BaseRepresentation* getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *);
-                virtual void                updateDownloadRate     (const ID &, size_t, mtime_t); /* reimpl */
+                virtual void                updateDownloadRate     (const ID &, size_t, vlc_tick_t); /* reimpl */
                 virtual void                trackerEvent           (const SegmentTrackerEvent &); /* reimpl */
 
             private:
                 BaseRepresentation *        getNextQualityIndex( BaseAdaptationSet *, RepresentationSelector &,
-                                                                 float gammaP, mtime_t VD,
-                                                                 mtime_t Q /*current buffer level*/);
+                                                                 float gammaP, vlc_tick_t VD,
+                                                                 vlc_tick_t Q /*current buffer level*/);
                 float                       getUtility(const BaseRepresentation *);
                 unsigned                    getAvailableBw(unsigned, const BaseRepresentation *) const;
                 unsigned                    getMaxCurrentBw() const;
diff --git a/modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp b/modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp
index a64bbcec0c..4e85f16886 100644
--- a/modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp
+++ b/modules/demux/adaptive/logic/PredictiveAdaptationLogic.cpp
@@ -153,7 +153,7 @@ BaseRepresentation *PredictiveAdaptationLogic::getNextRepresentation(BaseAdaptat
     return rep;
 }
 
-void PredictiveAdaptationLogic::updateDownloadRate(const ID &id, size_t dlsize, mtime_t time)
+void PredictiveAdaptationLogic::updateDownloadRate(const ID &id, size_t dlsize, vlc_tick_t time)
 {
     vlc_mutex_lock(&lock);
     std::map<ID, PredictiveStats>::iterator it = streams.find(id);
diff --git a/modules/demux/adaptive/logic/PredictiveAdaptationLogic.hpp b/modules/demux/adaptive/logic/PredictiveAdaptationLogic.hpp
index e6e1807440..b7acfdc257 100644
--- a/modules/demux/adaptive/logic/PredictiveAdaptationLogic.hpp
+++ b/modules/demux/adaptive/logic/PredictiveAdaptationLogic.hpp
@@ -38,10 +38,10 @@ namespace adaptive
 
             private:
                 size_t  segments_count;
-                mtime_t buffering_level;
-                mtime_t buffering_target;
+                vlc_tick_t buffering_level;
+                vlc_tick_t buffering_target;
                 unsigned last_download_rate;
-                mtime_t last_duration;
+                vlc_tick_t last_duration;
                 MovingAverage<unsigned> average;
         };
 
@@ -52,7 +52,7 @@ namespace adaptive
                 virtual ~PredictiveAdaptationLogic();
 
                 virtual BaseRepresentation* getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *);
-                virtual void                updateDownloadRate     (const ID &, size_t, mtime_t); /* reimpl */
+                virtual void                updateDownloadRate     (const ID &, size_t, vlc_tick_t); /* reimpl */
                 virtual void                trackerEvent           (const SegmentTrackerEvent &); /* reimpl */
 
             private:
diff --git a/modules/demux/adaptive/logic/RateBasedAdaptationLogic.cpp b/modules/demux/adaptive/logic/RateBasedAdaptationLogic.cpp
index e100330cd2..1168fc7cfa 100644
--- a/modules/demux/adaptive/logic/RateBasedAdaptationLogic.cpp
+++ b/modules/demux/adaptive/logic/RateBasedAdaptationLogic.cpp
@@ -78,7 +78,7 @@ BaseRepresentation *RateBasedAdaptationLogic::getNextRepresentation(BaseAdaptati
     return rep;
 }
 
-void RateBasedAdaptationLogic::updateDownloadRate(const ID &, size_t size, mtime_t time)
+void RateBasedAdaptationLogic::updateDownloadRate(const ID &, size_t size, vlc_tick_t time)
 {
     if(unlikely(time == 0))
         return;
diff --git a/modules/demux/adaptive/logic/RateBasedAdaptationLogic.h b/modules/demux/adaptive/logic/RateBasedAdaptationLogic.h
index b99d18cdf2..e2823d37ee 100644
--- a/modules/demux/adaptive/logic/RateBasedAdaptationLogic.h
+++ b/modules/demux/adaptive/logic/RateBasedAdaptationLogic.h
@@ -40,7 +40,7 @@ namespace adaptive
                 virtual ~RateBasedAdaptationLogic   ();
 
                 BaseRepresentation *getNextRepresentation(BaseAdaptationSet *, BaseRepresentation *);
-                virtual void updateDownloadRate(const ID &, size_t, mtime_t); /* reimpl */
+                virtual void updateDownloadRate(const ID &, size_t, vlc_tick_t); /* reimpl */
                 virtual void trackerEvent(const SegmentTrackerEvent &); /* reimpl */
 
             private:
@@ -52,7 +52,7 @@ namespace adaptive
                 MovingAverage<size_t>   average;
 
                 size_t                  dlsize;
-                mtime_t                 dllength;
+                vlc_tick_t              dllength;
 
                 vlc_mutex_t             lock;
         };
diff --git a/modules/demux/adaptive/playlist/AbstractPlaylist.cpp b/modules/demux/adaptive/playlist/AbstractPlaylist.cpp
index c89527addc..e350b7eae7 100644
--- a/modules/demux/adaptive/playlist/AbstractPlaylist.cpp
+++ b/modules/demux/adaptive/playlist/AbstractPlaylist.cpp
@@ -79,19 +79,19 @@ void AbstractPlaylist::setType(const std::string &type_)
     type = type_;
 }
 
-void AbstractPlaylist::setMinBuffering( mtime_t min )
+void AbstractPlaylist::setMinBuffering( vlc_tick_t min )
 {
     minBufferTime = min;
 }
 
-mtime_t AbstractPlaylist::getMinBuffering() const
+vlc_tick_t AbstractPlaylist::getMinBuffering() const
 {
     return std::max(minBufferTime, 6*CLOCK_FREQ);
 }
 
-mtime_t AbstractPlaylist::getMaxBuffering() const
+vlc_tick_t AbstractPlaylist::getMaxBuffering() const
 {
-    const mtime_t minbuf = getMinBuffering();
+    const vlc_tick_t minbuf = getMinBuffering();
     return std::max(minbuf, 60 * CLOCK_FREQ);
 }
 
@@ -136,7 +136,7 @@ BasePeriod* AbstractPlaylist::getNextPeriod(BasePeriod *period)
     return NULL;
 }
 
-void AbstractPlaylist::mergeWith(AbstractPlaylist *updatedAbstractPlaylist, mtime_t prunebarrier)
+void AbstractPlaylist::mergeWith(AbstractPlaylist *updatedAbstractPlaylist, vlc_tick_t prunebarrier)
 {
     availabilityEndTime.Set(updatedAbstractPlaylist->availabilityEndTime.Get());
 
@@ -144,7 +144,7 @@ void AbstractPlaylist::mergeWith(AbstractPlaylist *updatedAbstractPlaylist, mtim
         periods.at(i)->mergeWith(updatedAbstractPlaylist->periods.at(i), prunebarrier);
 }
 
-void AbstractPlaylist::pruneByPlaybackTime(mtime_t time)
+void AbstractPlaylist::pruneByPlaybackTime(vlc_tick_t time)
 {
     for(size_t i = 0; i < periods.size(); i++)
         periods.at(i)->pruneByPlaybackTime(time);
diff --git a/modules/demux/adaptive/playlist/AbstractPlaylist.hpp b/modules/demux/adaptive/playlist/AbstractPlaylist.hpp
index 51cf19edc5..61fbc3c134 100644
--- a/modules/demux/adaptive/playlist/AbstractPlaylist.hpp
+++ b/modules/demux/adaptive/playlist/AbstractPlaylist.hpp
@@ -42,9 +42,9 @@ namespace adaptive
 
                 virtual bool                    isLive() const = 0;
                 void                            setType(const std::string &);
-                void                            setMinBuffering( mtime_t );
-                mtime_t                         getMinBuffering() const;
-                mtime_t                         getMaxBuffering() const;
+                void                            setMinBuffering( vlc_tick_t );
+                vlc_tick_t                      getMinBuffering() const;
+                vlc_tick_t                      getMaxBuffering() const;
                 virtual void                    debug() = 0;
 
                 void    addPeriod               (BasePeriod *period);
@@ -58,17 +58,17 @@ namespace adaptive
                 virtual BasePeriod*                      getFirstPeriod();
                 virtual BasePeriod*                      getNextPeriod(BasePeriod *period);
 
-                void                mergeWith(AbstractPlaylist *, mtime_t = 0);
-                void                pruneByPlaybackTime(mtime_t);
+                void                mergeWith(AbstractPlaylist *, vlc_tick_t = 0);
+                void                pruneByPlaybackTime(vlc_tick_t);
 
-                Property<mtime_t>                   duration;
+                Property<vlc_tick_t>                   duration;
                 Property<time_t>                    playbackStart;
                 Property<time_t>                    availabilityEndTime;
                 Property<time_t>                    availabilityStartTime;
-                Property<mtime_t>                   minUpdatePeriod;
-                Property<mtime_t>                   maxSegmentDuration;
-                Property<mtime_t>                   timeShiftBufferDepth;
-                Property<mtime_t>                   suggestedPresentationDelay;
+                Property<vlc_tick_t>                   minUpdatePeriod;
+                Property<vlc_tick_t>                   maxSegmentDuration;
+                Property<vlc_tick_t>                   timeShiftBufferDepth;
+                Property<vlc_tick_t>                   suggestedPresentationDelay;
 
             protected:
                 vlc_object_t                       *p_object;
@@ -76,7 +76,7 @@ namespace adaptive
                 std::vector<std::string>            baseUrls;
                 std::string                         playlistUrl;
                 std::string                         type;
-                mtime_t                             minBufferTime;
+                vlc_tick_t                          minBufferTime;
         };
     }
 }
diff --git a/modules/demux/adaptive/playlist/BasePeriod.cpp b/modules/demux/adaptive/playlist/BasePeriod.cpp
index 4f520d5bf6..7cee301f5f 100644
--- a/modules/demux/adaptive/playlist/BasePeriod.cpp
+++ b/modules/demux/adaptive/playlist/BasePeriod.cpp
@@ -89,7 +89,7 @@ void BasePeriod::debug(vlc_object_t *obj, int indent) const
         (*k)->debug(obj, indent + 1);
 }
 
-mtime_t BasePeriod::getPeriodStart() const
+vlc_tick_t BasePeriod::getPeriodStart() const
 {
     return startTime.Get();
 }
diff --git a/modules/demux/adaptive/playlist/BasePeriod.h b/modules/demux/adaptive/playlist/BasePeriod.h
index 6fe64f047c..b57a75d610 100644
--- a/modules/demux/adaptive/playlist/BasePeriod.h
+++ b/modules/demux/adaptive/playlist/BasePeriod.h
@@ -45,11 +45,11 @@ namespace adaptive
                 void                                addAdaptationSet    (BaseAdaptationSet *AdaptationSet);
                 void                                debug               (vlc_object_t *,int = 0) const;
 
-                virtual mtime_t getPeriodStart() const; /* reimpl */
+                virtual vlc_tick_t getPeriodStart() const; /* reimpl */
                 virtual AbstractPlaylist *getPlaylist() const; /* reimpl */
 
-                Property<mtime_t> duration;
-                Property<mtime_t> startTime;
+                Property<vlc_tick_t> duration;
+                Property<vlc_tick_t> startTime;
 
             private:
                 std::vector<BaseAdaptationSet *>    adaptationSets;
diff --git a/modules/demux/adaptive/playlist/BaseRepresentation.cpp b/modules/demux/adaptive/playlist/BaseRepresentation.cpp
index 680c410896..4b7dbcdf79 100644
--- a/modules/demux/adaptive/playlist/BaseRepresentation.cpp
+++ b/modules/demux/adaptive/playlist/BaseRepresentation.cpp
@@ -83,7 +83,7 @@ bool BaseRepresentation::needsUpdate() const
     return false;
 }
 
-bool BaseRepresentation::runLocalUpdates(mtime_t, uint64_t, bool)
+bool BaseRepresentation::runLocalUpdates(vlc_tick_t, uint64_t, bool)
 {
     return false;
 }
@@ -98,14 +98,14 @@ bool BaseRepresentation::consistentSegmentNumber() const
     return b_consistent;
 }
 
-void BaseRepresentation::pruneByPlaybackTime(mtime_t time)
+void BaseRepresentation::pruneByPlaybackTime(vlc_tick_t time)
 {
     uint64_t num;
     if(getSegmentNumberByTime(time, &num))
         pruneBySegmentNumber(num);
 }
 
-mtime_t BaseRepresentation::getMinAheadTime(uint64_t curnum) const
+vlc_tick_t BaseRepresentation::getMinAheadTime(uint64_t curnum) const
 {
     std::vector<ISegment *> seglist;
     getSegments(INFOTYPE_MEDIA, seglist);
@@ -124,7 +124,7 @@ mtime_t BaseRepresentation::getMinAheadTime(uint64_t curnum) const
         return CLOCK_FREQ;
     }
 
-    mtime_t minTime = 0;
+    vlc_tick_t minTime = 0;
     const Timescale timescale = inheritTimescale();
     std::vector<ISegment *>::const_iterator it;
     for(it = seglist.begin(); it != seglist.end(); ++it)
diff --git a/modules/demux/adaptive/playlist/BaseRepresentation.h b/modules/demux/adaptive/playlist/BaseRepresentation.h
index fbc6b2a126..cbbd8bd831 100644
--- a/modules/demux/adaptive/playlist/BaseRepresentation.h
+++ b/modules/demux/adaptive/playlist/BaseRepresentation.h
@@ -60,11 +60,11 @@ namespace adaptive
                 const std::list<std::string> & getCodecs    () const;
                 void                addCodec                (const std::string &);
                 bool                consistentSegmentNumber () const;
-                virtual void        pruneByPlaybackTime     (mtime_t);
+                virtual void        pruneByPlaybackTime     (vlc_tick_t);
 
-                virtual mtime_t     getMinAheadTime         (uint64_t) const;
+                virtual vlc_tick_t  getMinAheadTime         (uint64_t) const;
                 virtual bool        needsUpdate             () const;
-                virtual bool        runLocalUpdates         (mtime_t, uint64_t, bool);
+                virtual bool        runLocalUpdates         (vlc_tick_t, uint64_t, bool);
                 virtual void        scheduleNextUpdate      (uint64_t);
 
                 virtual void        debug                   (vlc_object_t *,int = 0) const;
diff --git a/modules/demux/adaptive/playlist/SegmentInformation.cpp b/modules/demux/adaptive/playlist/SegmentInformation.cpp
index 8d5a7fe3ae..0d71d65ef0 100644
--- a/modules/demux/adaptive/playlist/SegmentInformation.cpp
+++ b/modules/demux/adaptive/playlist/SegmentInformation.cpp
@@ -164,7 +164,7 @@ std::size_t SegmentInformation::getAllSegments(std::vector<ISegment *> &retSegme
 
 uint64_t SegmentInformation::getLiveStartSegmentNumber(uint64_t def) const
 {
-    const mtime_t i_max_buffering = getPlaylist()->getMaxBuffering() +
+    const vlc_tick_t i_max_buffering = getPlaylist()->getMaxBuffering() +
                                     /* FIXME: add dynamic pts-delay */ CLOCK_FREQ;
 
     /* Try to never buffer up to really end */
@@ -198,7 +198,7 @@ uint64_t SegmentInformation::getLiveStartSegmentNumber(uint64_t def) const
         /* Else compute, current time and timeshiftdepth based */
         else if( mediaSegmentTemplate->duration.Get() )
         {
-            mtime_t i_delay = getPlaylist()->suggestedPresentationDelay.Get();
+            vlc_tick_t i_delay = getPlaylist()->suggestedPresentationDelay.Get();
 
             if( i_delay == 0 || i_delay > getPlaylist()->timeShiftBufferDepth.Get() )
                  i_delay = getPlaylist()->timeShiftBufferDepth.Get();
@@ -340,7 +340,7 @@ ISegment * SegmentInformation::getSegment(SegmentInfoType type, uint64_t pos) co
     return NULL;
 }
 
-bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) const
+bool SegmentInformation::getSegmentNumberByTime(vlc_tick_t time, uint64_t *ret) const
 {
     if( mediaSegmentTemplate )
     {
@@ -391,7 +391,7 @@ bool SegmentInformation::getSegmentNumberByTime(mtime_t time, uint64_t *ret) con
 }
 
 bool SegmentInformation::getPlaybackTimeDurationBySegmentNumber(uint64_t number,
-                                                                mtime_t *time, mtime_t *duration) const
+                                                                vlc_tick_t *time, vlc_tick_t *duration) const
 {
     SegmentList *segList;
     MediaSegmentTemplate *mediaTemplate;
@@ -445,7 +445,7 @@ SegmentInformation * SegmentInformation::getChildByID(const adaptive::ID &id)
     return NULL;
 }
 
-void SegmentInformation::mergeWith(SegmentInformation *updated, mtime_t prunetime)
+void SegmentInformation::mergeWith(SegmentInformation *updated, vlc_tick_t prunetime)
 {
     /* Support Segment List for now */
     if(segmentList && updated->segmentList)
@@ -476,7 +476,7 @@ void SegmentInformation::mergeWithTimeline(SegmentTimeline *updated)
     }
 }
 
-void SegmentInformation::pruneByPlaybackTime(mtime_t time)
+void SegmentInformation::pruneByPlaybackTime(vlc_tick_t time)
 {
     if(segmentList)
         segmentList->pruneByPlaybackTime(time);
@@ -502,7 +502,7 @@ void SegmentInformation::pruneBySegmentNumber(uint64_t num)
 
 uint64_t SegmentInformation::translateSegmentNumber(uint64_t num, const SegmentInformation *from) const
 {
-    mtime_t time, duration;
+    vlc_tick_t time, duration;
     if( from->getPlaybackTimeDurationBySegmentNumber(num, &time, &duration) )
         getSegmentNumberByTime(time, &num);
     return num;
@@ -516,7 +516,7 @@ SegmentInformation::SwitchPolicy SegmentInformation::getSwitchPolicy() const
         return switchpolicy;
 }
 
-mtime_t SegmentInformation::getPeriodStart() const
+vlc_tick_t SegmentInformation::getPeriodStart() const
 {
     if(parent)
         return parent->getPeriodStart();
diff --git a/modules/demux/adaptive/playlist/SegmentInformation.hpp b/modules/demux/adaptive/playlist/SegmentInformation.hpp
index cb20e74304..d74764fde7 100644
--- a/modules/demux/adaptive/playlist/SegmentInformation.hpp
+++ b/modules/demux/adaptive/playlist/SegmentInformation.hpp
@@ -55,15 +55,15 @@ namespace adaptive
                     SWITCH_BITSWITCHEABLE
                 } SwitchPolicy;
                 SwitchPolicy getSwitchPolicy() const;
-                virtual mtime_t getPeriodStart() const;
+                virtual vlc_tick_t getPeriodStart() const;
                 virtual AbstractPlaylist *getPlaylist() const;
 
                 class SplitPoint
                 {
                     public:
                         size_t offset;
-                        mtime_t time;
-                        mtime_t duration;
+                        vlc_tick_t time;
+                        vlc_tick_t duration;
                 };
                 void SplitUsingIndex(std::vector<SplitPoint>&);
 
@@ -77,13 +77,13 @@ namespace adaptive
 
                 ISegment * getSegment(SegmentInfoType, uint64_t = 0) const;
                 ISegment * getNextSegment(SegmentInfoType, uint64_t, uint64_t *, bool *) const;
-                bool getSegmentNumberByTime(mtime_t, uint64_t *) const;
-                bool getPlaybackTimeDurationBySegmentNumber(uint64_t, mtime_t *, mtime_t *) const;
+                bool getSegmentNumberByTime(vlc_tick_t, uint64_t *) const;
+                bool getPlaybackTimeDurationBySegmentNumber(uint64_t, vlc_tick_t *, vlc_tick_t *) const;
                 uint64_t getLiveStartSegmentNumber(uint64_t) const;
-                virtual void mergeWith(SegmentInformation *, mtime_t);
+                virtual void mergeWith(SegmentInformation *, vlc_tick_t);
                 virtual void mergeWithTimeline(SegmentTimeline *); /* ! don't use with global merge */
                 virtual void pruneBySegmentNumber(uint64_t);
-                virtual void pruneByPlaybackTime(mtime_t);
+                virtual void pruneByPlaybackTime(vlc_tick_t);
                 virtual uint64_t translateSegmentNumber(uint64_t, const SegmentInformation *) const;
 
             protected:
diff --git a/modules/demux/adaptive/playlist/SegmentList.cpp b/modules/demux/adaptive/playlist/SegmentList.cpp
index 415a37c552..4aba0282b0 100644
--- a/modules/demux/adaptive/playlist/SegmentList.cpp
+++ b/modules/demux/adaptive/playlist/SegmentList.cpp
@@ -100,7 +100,7 @@ void SegmentList::mergeWith(SegmentList *updated, bool b_restamp)
     updated->segments.clear();
 }
 
-void SegmentList::pruneByPlaybackTime(mtime_t time)
+void SegmentList::pruneByPlaybackTime(vlc_tick_t time)
 {
     uint64_t num;
     const Timescale timescale = inheritTimescale();
@@ -140,7 +140,7 @@ bool SegmentList::getSegmentNumberByScaledTime(stime_t time, uint64_t *ret) cons
 }
 
 bool SegmentList::getPlaybackTimeDurationBySegmentNumber(uint64_t number,
-                                                         mtime_t *time, mtime_t *dur) const
+                                                         vlc_tick_t *time, vlc_tick_t *dur) const
 {
     *time = *dur = VLC_TS_INVALID;
 
diff --git a/modules/demux/adaptive/playlist/SegmentList.h b/modules/demux/adaptive/playlist/SegmentList.h
index 4c590c18db..58156b1550 100644
--- a/modules/demux/adaptive/playlist/SegmentList.h
+++ b/modules/demux/adaptive/playlist/SegmentList.h
@@ -46,9 +46,9 @@ namespace adaptive
                 void                    addSegment(ISegment *seg);
                 void                    mergeWith(SegmentList *, bool = false);
                 void                    pruneBySegmentNumber(uint64_t);
-                void                    pruneByPlaybackTime(mtime_t);
+                void                    pruneByPlaybackTime(vlc_tick_t);
                 bool                    getSegmentNumberByScaledTime(stime_t, uint64_t *) const;
-                bool                    getPlaybackTimeDurationBySegmentNumber(uint64_t, mtime_t *, mtime_t *) const;
+                bool                    getPlaybackTimeDurationBySegmentNumber(uint64_t, vlc_tick_t *, vlc_tick_t *) const;
 
             private:
                 std::vector<ISegment *>  segments;
diff --git a/modules/demux/adaptive/playlist/SegmentTemplate.cpp b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
index b9e78bbf50..c00348d839 100644
--- a/modules/demux/adaptive/playlist/SegmentTemplate.cpp
+++ b/modules/demux/adaptive/playlist/SegmentTemplate.cpp
@@ -48,7 +48,7 @@ MediaSegmentTemplate::MediaSegmentTemplate( SegmentInformation *parent ) :
     parentSegmentInformation = parent;
 }
 
-void MediaSegmentTemplate::mergeWith(MediaSegmentTemplate *updated, mtime_t prunebarrier)
+void MediaSegmentTemplate::mergeWith(MediaSegmentTemplate *updated, vlc_tick_t prunebarrier)
 {
     SegmentTimeline *timeline = segmentTimeline.Get();
     if(timeline && updated->segmentTimeline.Get())
@@ -64,7 +64,7 @@ void MediaSegmentTemplate::mergeWith(MediaSegmentTemplate *updated, mtime_t prun
     }
 }
 
-void MediaSegmentTemplate::pruneByPlaybackTime(mtime_t time)
+void MediaSegmentTemplate::pruneByPlaybackTime(vlc_tick_t time)
 {
     if(segmentTimeline.Get())
         return segmentTimeline.Get()->pruneByPlaybackTime(time);
diff --git a/modules/demux/adaptive/playlist/SegmentTemplate.h b/modules/demux/adaptive/playlist/SegmentTemplate.h
index 3c1d08084c..5c238e7aed 100644
--- a/modules/demux/adaptive/playlist/SegmentTemplate.h
+++ b/modules/demux/adaptive/playlist/SegmentTemplate.h
@@ -50,11 +50,11 @@ namespace adaptive
             public:
                 MediaSegmentTemplate( SegmentInformation * = NULL );
                 virtual void setSourceUrl( const std::string &url ); /* reimpl */
-                void mergeWith( MediaSegmentTemplate *, mtime_t );
+                void mergeWith( MediaSegmentTemplate *, vlc_tick_t );
                 virtual uint64_t getSequenceNumber() const; /* reimpl */
                 uint64_t getCurrentLiveTemplateNumber() const;
                 stime_t getMinAheadScaledTime(uint64_t) const;
-                void pruneByPlaybackTime(mtime_t);
+                void pruneByPlaybackTime(vlc_tick_t);
                 size_t pruneBySequenceNumber(uint64_t);
                 virtual void debug(vlc_object_t *, int = 0) const; /* reimpl */
                 Property<size_t>        startNumber;
diff --git a/modules/demux/adaptive/playlist/SegmentTimeline.cpp b/modules/demux/adaptive/playlist/SegmentTimeline.cpp
index 92eb1f470c..4bd7dc6599 100644
--- a/modules/demux/adaptive/playlist/SegmentTimeline.cpp
+++ b/modules/demux/adaptive/playlist/SegmentTimeline.cpp
@@ -62,7 +62,7 @@ void SegmentTimeline::addElement(uint64_t number, stime_t d, uint64_t r, stime_t
     }
 }
 
-mtime_t SegmentTimeline::getMinAheadScaledTime(uint64_t number) const
+vlc_tick_t SegmentTimeline::getMinAheadScaledTime(uint64_t number) const
 {
     stime_t totalscaledtime = 0;
 
@@ -174,7 +174,7 @@ uint64_t SegmentTimeline::minElementNumber() const
     return elements.front()->number;
 }
 
-void SegmentTimeline::pruneByPlaybackTime(mtime_t time)
+void SegmentTimeline::pruneByPlaybackTime(vlc_tick_t time)
 {
     const Timescale timescale = inheritTimescale();
     uint64_t num = getElementNumberByScaledPlaybackTime(timescale.ToScaled(time));
@@ -248,14 +248,14 @@ void SegmentTimeline::mergeWith(SegmentTimeline &other)
     }
 }
 
-mtime_t SegmentTimeline::start() const
+vlc_tick_t SegmentTimeline::start() const
 {
     if(elements.empty())
         return 0;
     return inheritTimescale().ToTime(elements.front()->t);
 }
 
-mtime_t SegmentTimeline::end() const
+vlc_tick_t SegmentTimeline::end() const
 {
     if(elements.empty())
         return 0;
diff --git a/modules/demux/adaptive/playlist/SegmentTimeline.h b/modules/demux/adaptive/playlist/SegmentTimeline.h
index 4094963bf2..7ea91c4d8b 100644
--- a/modules/demux/adaptive/playlist/SegmentTimeline.h
+++ b/modules/demux/adaptive/playlist/SegmentTimeline.h
@@ -42,16 +42,16 @@ namespace adaptive
                 virtual ~SegmentTimeline();
                 void addElement(uint64_t, stime_t d, uint64_t r = 0, stime_t t = 0);
                 uint64_t getElementNumberByScaledPlaybackTime(stime_t) const;
-                bool    getScaledPlaybackTimeDurationBySegmentNumber(uint64_t, mtime_t *, mtime_t *) const;
+                bool    getScaledPlaybackTimeDurationBySegmentNumber(uint64_t, vlc_tick_t *, vlc_tick_t *) const;
                 stime_t getScaledPlaybackTimeByElementNumber(uint64_t) const;
                 stime_t getMinAheadScaledTime(uint64_t) const;
                 uint64_t maxElementNumber() const;
                 uint64_t minElementNumber() const;
-                void pruneByPlaybackTime(mtime_t);
+                void pruneByPlaybackTime(vlc_tick_t);
                 size_t pruneBySequenceNumber(uint64_t);
                 void mergeWith(SegmentTimeline &);
-                mtime_t start() const;
-                mtime_t end() const;
+                vlc_tick_t start() const;
+                vlc_tick_t end() const;
                 void debug(vlc_object_t *, int = 0) const;
 
             private:
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.cpp b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
index ffe6c43a57..cbc6a17d99 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
@@ -51,7 +51,7 @@ AbstractCommand::~AbstractCommand()
 
 }
 
-mtime_t AbstractCommand::getTime() const
+vlc_tick_t AbstractCommand::getTime() const
 {
     return VLC_TS_INVALID;
 }
@@ -89,7 +89,7 @@ void EsOutSendCommand::Execute( es_out_t *out )
     p_fakeid->notifyData();
 }
 
-mtime_t EsOutSendCommand::getTime() const
+vlc_tick_t EsOutSendCommand::getTime() const
 {
     if( likely(p_block) )
         return p_block->i_dts;
@@ -127,7 +127,7 @@ void EsOutAddCommand::Execute( es_out_t * )
     p_fakeid->create();
 }
 
-EsOutControlPCRCommand::EsOutControlPCRCommand( int group_, mtime_t pcr_ ) :
+EsOutControlPCRCommand::EsOutControlPCRCommand( int group_, vlc_tick_t pcr_ ) :
     AbstractCommand( ES_OUT_SET_GROUP_PCR )
 {
     group = group_;
@@ -140,7 +140,7 @@ void EsOutControlPCRCommand::Execute( es_out_t * )
     // do nothing here
 }
 
-mtime_t EsOutControlPCRCommand::getTime() const
+vlc_tick_t EsOutControlPCRCommand::getTime() const
 {
     return pcr;
 }
@@ -200,7 +200,7 @@ EsOutAddCommand * CommandsFactory::createEsOutAddCommand( FakeESOutID *id ) cons
     return new (std::nothrow) EsOutAddCommand( id );
 }
 
-EsOutControlPCRCommand * CommandsFactory::createEsOutControlPCRCommand( int group, mtime_t pcr ) const
+EsOutControlPCRCommand * CommandsFactory::createEsOutControlPCRCommand( int group, vlc_tick_t pcr ) const
 {
     return new (std::nothrow) EsOutControlPCRCommand( group, pcr );
 }
@@ -297,9 +297,9 @@ const CommandsFactory * CommandsQueue::factory() const
     return commandsFactory;
 }
 
-mtime_t CommandsQueue::Process( es_out_t *out, mtime_t barrier )
+vlc_tick_t CommandsQueue::Process( es_out_t *out, vlc_tick_t barrier )
 {
-    mtime_t lastdts = barrier;
+    vlc_tick_t lastdts = barrier;
     std::set<const void *> disabled_esids;
     bool b_datasent = false;
 
@@ -376,7 +376,7 @@ mtime_t CommandsQueue::Process( es_out_t *out, mtime_t barrier )
 
         if( command->getType() == ES_OUT_PRIVATE_COMMAND_SEND )
         {
-            mtime_t dts = command->getTime();
+            vlc_tick_t dts = command->getTime();
             if( dts != VLC_TS_INVALID )
                 lastdts = dts;
         }
@@ -474,28 +474,28 @@ bool CommandsQueue::isEOF() const
     return b;
 }
 
-mtime_t CommandsQueue::getDemuxedAmount() const
+vlc_tick_t CommandsQueue::getDemuxedAmount() const
 {
     return bufferinglevel - getFirstDTS();
 }
 
-mtime_t CommandsQueue::getBufferingLevel() const
+vlc_tick_t CommandsQueue::getBufferingLevel() const
 {
-    mtime_t i_buffer;
+    vlc_tick_t i_buffer;
     vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
     i_buffer = bufferinglevel;
     vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
     return i_buffer;
 }
 
-mtime_t CommandsQueue::getFirstDTS() const
+vlc_tick_t CommandsQueue::getFirstDTS() const
 {
     std::list<AbstractCommand *>::const_iterator it;
     vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
-    mtime_t i_firstdts = pcr;
+    vlc_tick_t i_firstdts = pcr;
     for( it = commands.begin(); it != commands.end(); ++it )
     {
-        const mtime_t i_dts = (*it)->getTime();
+        const vlc_tick_t i_dts = (*it)->getTime();
         if( i_dts != VLC_TS_INVALID )
         {
             if( i_dts < i_firstdts || i_firstdts == VLC_TS_INVALID )
@@ -513,10 +513,10 @@ void CommandsQueue::LockedSetDraining()
     b_draining = !commands.empty();
 }
 
-mtime_t CommandsQueue::getPCR() const
+vlc_tick_t CommandsQueue::getPCR() const
 {
     vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
-    mtime_t i_pcr = pcr;
+    vlc_tick_t i_pcr = pcr;
     vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
     return i_pcr;
 }
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.hpp b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
index fe5abbd497..50ff75bbd4 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.hpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
@@ -37,7 +37,7 @@ namespace adaptive
         public:
             virtual ~AbstractCommand();
             virtual void Execute( es_out_t * ) = 0;
-            virtual mtime_t getTime() const;
+            virtual vlc_tick_t getTime() const;
             int getType() const;
 
         protected:
@@ -58,7 +58,7 @@ namespace adaptive
         public:
             virtual ~EsOutSendCommand();
             virtual void Execute( es_out_t *out );
-            virtual mtime_t getTime() const;
+            virtual vlc_tick_t getTime() const;
             const void * esIdentifier() const;
 
         protected:
@@ -92,12 +92,12 @@ namespace adaptive
         friend class CommandsFactory;
         public:
             virtual void Execute( es_out_t *out );
-            virtual mtime_t getTime() const;
+            virtual vlc_tick_t getTime() const;
 
         protected:
-            EsOutControlPCRCommand( int, mtime_t );
+            EsOutControlPCRCommand( int, vlc_tick_t );
             int group;
-            mtime_t pcr;
+            vlc_tick_t pcr;
     };
 
     class EsOutDestroyCommand : public AbstractCommand
@@ -141,7 +141,7 @@ namespace adaptive
             virtual EsOutSendCommand * createEsOutSendCommand( FakeESOutID *, block_t * ) const;
             virtual EsOutDelCommand * createEsOutDelCommand( FakeESOutID * ) const;
             virtual EsOutAddCommand * createEsOutAddCommand( FakeESOutID * ) const;
-            virtual EsOutControlPCRCommand * createEsOutControlPCRCommand( int, mtime_t ) const;
+            virtual EsOutControlPCRCommand * createEsOutControlPCRCommand( int, vlc_tick_t ) const;
             virtual EsOutControlResetPCRCommand * creatEsOutControlResetPCRCommand() const;
             virtual EsOutDestroyCommand * createEsOutDestroyCommand() const;
             virtual EsOutMetaCommand * createEsOutMetaCommand( int, const vlc_meta_t * ) const;
@@ -155,7 +155,7 @@ namespace adaptive
             ~CommandsQueue();
             const CommandsFactory * factory() const;
             void Schedule( AbstractCommand * );
-            mtime_t Process( es_out_t *out, mtime_t );
+            vlc_tick_t Process( es_out_t *out, vlc_tick_t );
             void Abort( bool b_reset );
             void Commit();
             bool isEmpty() const;
@@ -164,10 +164,10 @@ namespace adaptive
             void setEOF( bool );
             bool isDraining() const;
             bool isEOF() const;
-            mtime_t getDemuxedAmount() const;
-            mtime_t getBufferingLevel() const;
-            mtime_t getFirstDTS() const;
-            mtime_t getPCR() const;
+            vlc_tick_t getDemuxedAmount() const;
+            vlc_tick_t getBufferingLevel() const;
+            vlc_tick_t getFirstDTS() const;
+            vlc_tick_t getPCR() const;
 
         private:
             CommandsFactory *commandsFactory;
@@ -176,8 +176,8 @@ namespace adaptive
             void LockedSetDraining();
             std::list<AbstractCommand *> incoming;
             std::list<AbstractCommand *> commands;
-            mtime_t bufferinglevel;
-            mtime_t pcr;
+            vlc_tick_t bufferinglevel;
+            vlc_tick_t pcr;
             bool b_draining;
             bool b_drop;
             bool b_eof;
diff --git a/modules/demux/adaptive/plumbing/Demuxer.cpp b/modules/demux/adaptive/plumbing/Demuxer.cpp
index 213424cd96..8caf75df6b 100644
--- a/modules/demux/adaptive/plumbing/Demuxer.cpp
+++ b/modules/demux/adaptive/plumbing/Demuxer.cpp
@@ -131,7 +131,7 @@ void MimeDemuxer::drain()
         demuxer->drain();
 }
 
-int MimeDemuxer::demux(mtime_t t)
+int MimeDemuxer::demux(vlc_tick_t t)
 {
     if(!demuxer)
         return VLC_DEMUXER_EOF;
@@ -202,7 +202,7 @@ void Demuxer::drain()
     while(p_demux && demux_Demux(p_demux) == VLC_DEMUXER_SUCCESS);
 }
 
-int Demuxer::demux(mtime_t)
+int Demuxer::demux(vlc_tick_t)
 {
     if(!p_demux || b_eof)
         return VLC_DEMUXER_EOF;
@@ -237,10 +237,10 @@ bool SlaveDemuxer::create()
     return false;
 }
 
-int SlaveDemuxer::demux(mtime_t nz_deadline)
+int SlaveDemuxer::demux(vlc_tick_t nz_deadline)
 {
     /* Always call with increment or buffering will get slow stuck */
-    mtime_t i_next_demux_time = VLC_TS_0 + nz_deadline + CLOCK_FREQ / 4;
+    vlc_tick_t i_next_demux_time = VLC_TS_0 + nz_deadline + CLOCK_FREQ / 4;
     if( demux_Control(p_demux, DEMUX_SET_NEXT_DEMUX_TIME, i_next_demux_time ) != VLC_SUCCESS )
     {
         b_eof = true;
diff --git a/modules/demux/adaptive/plumbing/Demuxer.hpp b/modules/demux/adaptive/plumbing/Demuxer.hpp
index 1560c2af84..bc4a507317 100644
--- a/modules/demux/adaptive/plumbing/Demuxer.hpp
+++ b/modules/demux/adaptive/plumbing/Demuxer.hpp
@@ -34,7 +34,7 @@ namespace adaptive
         public:
             AbstractDemuxer();
             virtual ~AbstractDemuxer();
-            virtual int demux(mtime_t) = 0;
+            virtual int demux(vlc_tick_t) = 0;
             virtual void drain() = 0;
             virtual bool create() = 0;
             virtual void destroy() = 0;
@@ -58,7 +58,7 @@ namespace adaptive
             MimeDemuxer(demux_t *, const DemuxerFactoryInterface *,
                         es_out_t *, AbstractSourceStream *);
             virtual ~MimeDemuxer();
-            virtual int demux(mtime_t); /* impl */
+            virtual int demux(vlc_tick_t); /* impl */
             virtual void drain(); /* impl */
             virtual bool create(); /* impl */
             virtual void destroy(); /* impl */
@@ -76,7 +76,7 @@ namespace adaptive
         public:
             Demuxer(demux_t *, const std::string &, es_out_t *, AbstractSourceStream *);
             virtual ~Demuxer();
-            virtual int demux(mtime_t); /* impl */
+            virtual int demux(vlc_tick_t); /* impl */
             virtual void drain(); /* impl */
             virtual bool create(); /* impl */
             virtual void destroy(); /* impl */
@@ -96,10 +96,10 @@ namespace adaptive
             SlaveDemuxer(demux_t *, const std::string &, es_out_t *, AbstractSourceStream *);
             virtual ~SlaveDemuxer();
             virtual bool create(); /* reimpl */
-            virtual int demux(mtime_t); /* reimpl */
+            virtual int demux(vlc_tick_t); /* reimpl */
 
         private:
-            mtime_t length;
+            vlc_tick_t length;
     };
 
     class DemuxerFactoryInterface
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.cpp b/modules/demux/adaptive/plumbing/FakeESOut.cpp
index 59117108e4..596d1262b4 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.cpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.cpp
@@ -75,7 +75,7 @@ FakeESOut::~FakeESOut()
     vlc_mutex_destroy(&lock);
 }
 
-void FakeESOut::setExpectedTimestampOffset(mtime_t offset)
+void FakeESOut::setExpectedTimestampOffset(vlc_tick_t offset)
 {
     vlc_mutex_lock(&lock);
     timestamps_offset = 0;
@@ -84,7 +84,7 @@ void FakeESOut::setExpectedTimestampOffset(mtime_t offset)
     vlc_mutex_unlock(&lock);
 }
 
-void FakeESOut::setTimestampOffset(mtime_t offset)
+void FakeESOut::setTimestampOffset(vlc_tick_t offset)
 {
     vlc_mutex_lock(&lock);
     timestamps_offset = offset;
@@ -173,10 +173,10 @@ void FakeESOut::createOrRecycleRealEsID( FakeESOutID *es_id )
     vlc_mutex_unlock(&lock);
 }
 
-mtime_t FakeESOut::getTimestampOffset() const
+vlc_tick_t FakeESOut::getTimestampOffset() const
 {
     vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
-    mtime_t time = timestamps_offset;
+    vlc_tick_t time = timestamps_offset;
     vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
     return time;
 }
@@ -320,7 +320,7 @@ es_out_id_t * FakeESOut::esOutAdd_Callback(es_out_t *fakees, const es_format_t *
     return NULL;
 }
 
-void FakeESOut::checkTimestampsStart(mtime_t i_start)
+void FakeESOut::checkTimestampsStart(vlc_tick_t i_start)
 {
     if( i_start == VLC_TS_INVALID )
         return;
@@ -343,7 +343,7 @@ int FakeESOut::esOutSend_Callback(es_out_t *fakees, es_out_id_t *p_es, block_t *
 
     me->checkTimestampsStart( p_block->i_dts );
 
-    mtime_t offset = me->getTimestampOffset();
+    vlc_tick_t offset = me->getTimestampOffset();
     if( p_block->i_dts != VLC_TS_INVALID )
     {
         p_block->i_dts += offset;
@@ -385,7 +385,7 @@ int FakeESOut::esOutControl_Callback(es_out_t *fakees, int i_query, va_list args
                 i_group = va_arg( args, int );
             else
                 i_group = 0;
-            mtime_t  pcr = va_arg( args, mtime_t );
+            vlc_tick_t  pcr = va_arg( args, vlc_tick_t );
             me->checkTimestampsStart( pcr );
             pcr += me->getTimestampOffset();
             AbstractCommand *command = me->commandsqueue->factory()->createEsOutControlPCRCommand( i_group, pcr );
diff --git a/modules/demux/adaptive/plumbing/FakeESOut.hpp b/modules/demux/adaptive/plumbing/FakeESOut.hpp
index e740a5ab9b..3c434a7333 100644
--- a/modules/demux/adaptive/plumbing/FakeESOut.hpp
+++ b/modules/demux/adaptive/plumbing/FakeESOut.hpp
@@ -41,14 +41,14 @@ namespace adaptive
             FakeESOut( es_out_t *, CommandsQueue * );
             ~FakeESOut();
             es_out_t * getEsOut();
-            void setTimestampOffset( mtime_t );
-            void setExpectedTimestampOffset(mtime_t);
+            void setTimestampOffset( vlc_tick_t );
+            void setExpectedTimestampOffset(vlc_tick_t);
             size_t esCount() const;
             bool hasSelectedEs() const;
             bool decodersDrained();
             bool restarting() const;
             void setExtraInfoProvider( ExtraFMTInfoInterface * );
-            void checkTimestampsStart(mtime_t);
+            void checkTimestampsStart(vlc_tick_t);
 
             /* Used by FakeES ID */
             void recycle( FakeESOutID *id );
@@ -72,11 +72,11 @@ namespace adaptive
             es_out_t *real_es_out;
             FakeESOutID * createNewID( const es_format_t * );
             ExtraFMTInfoInterface *extrainfo;
-            mtime_t getTimestampOffset() const;
+            vlc_tick_t getTimestampOffset() const;
             CommandsQueue *commandsqueue;
             struct es_out_fake *fakeesout;
-            mtime_t timestamps_offset;
-            mtime_t timestamps_expected;
+            vlc_tick_t timestamps_offset;
+            vlc_tick_t timestamps_expected;
             bool timestamps_check_done;
             std::list<FakeESOutID *> fakeesidlist;
             std::list<FakeESOutID *> recycle_candidates;
diff --git a/modules/demux/adaptive/tools/Conversions.cpp b/modules/demux/adaptive/tools/Conversions.cpp
index 1deb3ef3ec..f6478c5e91 100644
--- a/modules/demux/adaptive/tools/Conversions.cpp
+++ b/modules/demux/adaptive/tools/Conversions.cpp
@@ -174,7 +174,7 @@ time_t UTCTime::time() const
     return t / CLOCK_FREQ;
 }
 
-mtime_t UTCTime::mtime() const
+vlc_tick_t UTCTime::mtime() const
 {
     return t;
 }
diff --git a/modules/demux/adaptive/tools/Conversions.hpp b/modules/demux/adaptive/tools/Conversions.hpp
index 07c6010916..8d4341871d 100644
--- a/modules/demux/adaptive/tools/Conversions.hpp
+++ b/modules/demux/adaptive/tools/Conversions.hpp
@@ -39,10 +39,10 @@ class UTCTime
     public:
         UTCTime(const std::string&);
         time_t  time() const;
-        mtime_t mtime() const;
+        vlc_tick_t mtime() const;
 
     private:
-        mtime_t t;
+        vlc_tick_t t;
 };
 
 template<typename T> class Integer
diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c
index 1fce0b5b22..d028d4b421 100644
--- a/modules/demux/aiff.c
+++ b/modules/demux/aiff.c
@@ -72,7 +72,7 @@ typedef struct
 
     int         i_ssnd_fsize;
 
-    mtime_t     i_time;
+    vlc_tick_t  i_time;
 } demux_sys_t;
 
 static int Demux  ( demux_t *p_demux );
diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index fb0100cf13..7f1332f5b2 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -77,9 +77,9 @@ static int Control( demux_t *, int i_query, va_list args );
 
 /* callbacks for packet parser */
 static void Packet_UpdateTime( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number,
-                               mtime_t i_time );
-static void Packet_SetSendTime( asf_packet_sys_t *p_packetsys, mtime_t i_time);
-static bool Block_Dequeue( demux_t *p_demux, mtime_t i_nexttime );
+                               vlc_tick_t i_time );
+static void Packet_SetSendTime( asf_packet_sys_t *p_packetsys, vlc_tick_t i_time);
+static bool Block_Dequeue( demux_t *p_demux, vlc_tick_t i_nexttime );
 static asf_track_info_t * Packet_GetTrackInfo( asf_packet_sys_t *p_packetsys,
                                                uint8_t i_stream_number );
 static bool Packet_DoSkip( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number, bool b_packet_keyframe );
@@ -95,7 +95,7 @@ typedef struct
     es_format_t     *p_fmt; /* format backup for video changes */
     bool             b_selected;
 
-    mtime_t          i_time; /* track time*/
+    vlc_tick_t       i_time; /* track time*/
 
     asf_track_info_t info;
 
@@ -109,9 +109,9 @@ typedef struct
 
 typedef struct
 {
-    mtime_t             i_time;     /* s */
-    mtime_t             i_sendtime;
-    mtime_t             i_length;   /* length of file */
+    vlc_tick_t          i_time;     /* s */
+    vlc_tick_t          i_sendtime;
+    vlc_tick_t          i_length;   /* length of file */
     uint64_t            i_bitrate;  /* global file bitrate */
     bool                b_eos;      /* end of current stream */
     bool                b_eof;      /* end of current media */
@@ -131,7 +131,7 @@ typedef struct
     uint8_t             i_access_selected_track[ES_CATEGORY_COUNT]; /* mms, depends on access algorithm */
     unsigned int        i_wait_keyframe;
 
-    mtime_t             i_preroll_start;
+    vlc_tick_t          i_preroll_start;
 
     asf_packet_sys_t    packet_sys;
 
@@ -350,7 +350,7 @@ static int SeekPercent( demux_t *p_demux, int i_query, va_list args )
                                    i_query, args );
 }
 
-static int SeekIndex( demux_t *p_demux, mtime_t i_date, float f_pos )
+static int SeekIndex( demux_t *p_demux, vlc_tick_t i_date, float f_pos )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     asf_object_index_t *p_index;
@@ -582,7 +582,7 @@ static void Packet_SetAR( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number
     tk->p_fmt->video.i_sar_den = i_ratio_y;
 }
 
-static void Packet_SetSendTime( asf_packet_sys_t *p_packetsys, mtime_t i_time )
+static void Packet_SetSendTime( asf_packet_sys_t *p_packetsys, vlc_tick_t i_time )
 {
     demux_t *p_demux = p_packetsys->p_demux;
     demux_sys_t *p_sys = p_demux->p_sys;
@@ -591,7 +591,7 @@ static void Packet_SetSendTime( asf_packet_sys_t *p_packetsys, mtime_t i_time )
 }
 
 static void Packet_UpdateTime( asf_packet_sys_t *p_packetsys, uint8_t i_stream_number,
-                               mtime_t i_time )
+                               vlc_tick_t i_time )
 {
     demux_t *p_demux = p_packetsys->p_demux;
     demux_sys_t *p_sys = p_demux->p_sys;
@@ -668,7 +668,7 @@ static void Packet_Enqueue( asf_packet_sys_t *p_packetsys, uint8_t i_stream_numb
     *pp_frame = NULL;
 }
 
-static bool Block_Dequeue( demux_t *p_demux, mtime_t i_nexttime )
+static bool Block_Dequeue( demux_t *p_demux, vlc_tick_t i_nexttime )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     bool b_tracks_have_data = false;
@@ -1247,9 +1247,9 @@ static int DemuxInit( demux_t *p_demux )
                   p_sys->p_fp->i_min_data_packet_size;
 
         /* calculate the time duration in micro-s */
-        p_sys->i_length = (mtime_t)p_sys->p_fp->i_play_duration / 10 *
-                   (mtime_t)i_count /
-                   (mtime_t)p_sys->p_fp->i_data_packets_count - p_sys->p_fp->i_preroll * 1000;
+        p_sys->i_length = (vlc_tick_t)p_sys->p_fp->i_play_duration / 10 *
+                   (vlc_tick_t)i_count /
+                   (vlc_tick_t)p_sys->p_fp->i_data_packets_count - p_sys->p_fp->i_preroll * 1000;
         if( p_sys->i_length < 0 )
             p_sys->i_length = 0;
 
diff --git a/modules/demux/asf/asfpacket.c b/modules/demux/asf/asfpacket.c
index cbcf2bab0e..5bdcfe14f3 100644
--- a/modules/demux/asf/asfpacket.c
+++ b/modules/demux/asf/asfpacket.c
@@ -78,7 +78,7 @@ static uint32_t SkipBytes( stream_t *s, uint32_t i_bytes )
 
 static int DemuxSubPayload( asf_packet_sys_t *p_packetsys,
                             uint8_t i_stream_number, block_t **pp_frame,
-                            uint32_t i_sub_payload_data_length, mtime_t i_pts, mtime_t i_dts,
+                            uint32_t i_sub_payload_data_length, vlc_tick_t i_pts, vlc_tick_t i_dts,
                             uint32_t i_media_object_offset, bool b_keyframe, bool b_ignore_pts )
 {
     /* FIXME I don't use i_media_object_number, sould I ? */
@@ -230,7 +230,7 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
     if( i_replicated_data_length > 7 ) // should be at least 8 bytes
     {
         /* Followed by 2 optional DWORDS, offset in media and *media* presentation time */
-        i_pkt_time = (mtime_t)GetDWLE( pkt->p_peek + pkt->i_skip + 4 );
+        i_pkt_time = (vlc_tick_t)GetDWLE( pkt->p_peek + pkt->i_skip + 4 );
 
         /* Parsing extensions, See 7.3.1 */
         ParsePayloadExtensions( p_packetsys, p_tkinfo,
@@ -243,7 +243,7 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
     else if ( i_replicated_data_length == 0 )
     {
         /* optional DWORDS missing */
-        i_pkt_time = (mtime_t)pkt->send_time;
+        i_pkt_time = (vlc_tick_t)pkt->send_time;
     }
     /* Compressed payload */
     else if( i_replicated_data_length == 1 )
@@ -252,7 +252,7 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
         /* Next byte is *media* Presentation Time Delta */
         i_pkt_time_delta = pkt->p_peek[pkt->i_skip];
         b_ignore_pts = false;
-        i_pkt_time = (mtime_t)i_media_object_offset;
+        i_pkt_time = (vlc_tick_t)i_media_object_offset;
         i_pkt_time -= *p_packetsys->pi_preroll;
         pkt->i_skip++;
         i_media_object_offset = 0;
@@ -311,7 +311,7 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
 
     if ( b_preroll_done )
     {
-        mtime_t i_track_time = i_pkt_time;
+        vlc_tick_t i_track_time = i_pkt_time;
 
         if ( p_packetsys->pf_updatetime )
             p_packetsys->pf_updatetime( p_packetsys, i_stream_number, i_track_time );
@@ -334,12 +334,12 @@ static int DemuxPayload(asf_packet_sys_t *p_packetsys, asf_packet_t *pkt, int i_
 
         SkipBytes( p_demux->s, pkt->i_skip );
 
-        mtime_t i_payload_pts;
-        i_payload_pts = i_pkt_time + (mtime_t)i_pkt_time_delta * i_subpayload_count * 1000;
+        vlc_tick_t i_payload_pts;
+        i_payload_pts = i_pkt_time + (vlc_tick_t)i_pkt_time_delta * i_subpayload_count * 1000;
         if ( p_tkinfo->p_sp )
             i_payload_pts -= p_tkinfo->p_sp->i_time_offset * 10;
 
-        mtime_t i_payload_dts = i_pkt_time;
+        vlc_tick_t i_payload_dts = i_pkt_time;
 
         if ( p_tkinfo->p_sp )
             i_payload_dts -= p_tkinfo->p_sp->i_time_offset * 10;
diff --git a/modules/demux/asf/asfpacket.h b/modules/demux/asf/asfpacket.h
index 445e34bfb5..3d4c1a5b22 100644
--- a/modules/demux/asf/asfpacket.h
+++ b/modules/demux/asf/asfpacket.h
@@ -44,7 +44,7 @@ struct asf_packet_sys_s
 
     /* global stream info */
     uint64_t *pi_preroll;
-    mtime_t *pi_preroll_start;
+    vlc_tick_t *pi_preroll_start;
 
     /* callbacks */
     void (*pf_send)(asf_packet_sys_t *, uint8_t, block_t **);
@@ -52,8 +52,8 @@ struct asf_packet_sys_s
 
     /* optional callbacks */
     bool (*pf_doskip)(asf_packet_sys_t *, uint8_t, bool);
-    void (*pf_updatesendtime)(asf_packet_sys_t *, mtime_t);
-    void (*pf_updatetime)(asf_packet_sys_t *, uint8_t, mtime_t);
+    void (*pf_updatesendtime)(asf_packet_sys_t *, vlc_tick_t);
+    void (*pf_updatetime)(asf_packet_sys_t *, uint8_t, vlc_tick_t);
     void (*pf_setaspectratio)(asf_packet_sys_t *, uint8_t, uint8_t, uint8_t);
 };
 
diff --git a/modules/demux/au.c b/modules/demux/au.c
index a0299bd366..9431bf747f 100644
--- a/modules/demux/au.c
+++ b/modules/demux/au.c
@@ -85,10 +85,10 @@ typedef struct
     es_format_t     fmt;
     es_out_id_t     *es;
 
-    mtime_t         i_time;
+    vlc_tick_t      i_time;
 
     int             i_frame_size;
-    mtime_t         i_frame_length;
+    vlc_tick_t      i_frame_length;
 
     uint32_t        i_header_size;
 } demux_sys_t;
@@ -289,8 +289,8 @@ static int Open( vlc_object_t *p_this )
         }
     }
     p_sys->i_frame_length = CLOCK_FREQ *
-                            (mtime_t)i_samples /
-                            (mtime_t)p_sys->fmt.audio.i_rate;
+                            (vlc_tick_t)i_samples /
+                            (vlc_tick_t)p_sys->fmt.audio.i_rate;
 
     p_demux->p_sys = p_sys;
     p_demux->pf_demux = Demux;
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index fc3bd2d52c..5bb31f6942 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -55,7 +55,7 @@
 struct avformat_track_s
 {
     es_out_id_t *p_es;
-    mtime_t i_pcr;
+    vlc_tick_t i_pcr;
 };
 
 /*****************************************************************************
@@ -69,7 +69,7 @@ typedef struct
     struct avformat_track_s *tracks;
     unsigned i_tracks;
 
-    mtime_t         i_pcr;
+    vlc_tick_t      i_pcr;
 
     unsigned    i_ssa_order;
 
@@ -873,14 +873,14 @@ static int Demux( demux_t *p_demux )
     if( p_frame->i_dts != VLC_TS_INVALID && p_track->p_es != NULL )
         p_track->i_pcr = p_frame->i_dts;
 
-    mtime_t i_ts_max = INT64_MIN;
+    vlc_tick_t i_ts_max = INT64_MIN;
     for( unsigned i = 0; i < p_sys->i_tracks; i++ )
     {
         if( p_sys->tracks[i].p_es != NULL )
             i_ts_max = __MAX( i_ts_max, p_sys->tracks[i].i_pcr );
     }
 
-    mtime_t i_ts_min = INT64_MAX;
+    vlc_tick_t i_ts_min = INT64_MAX;
     for( unsigned i = 0; i < p_sys->i_tracks; i++ )
     {
         if( p_sys->tracks[i].p_es != NULL &&
@@ -926,7 +926,7 @@ static void UpdateSeekPoint( demux_t *p_demux, int64_t i_time )
     }
 }
 
-static void ResetTime( demux_t *p_demux, mtime_t i_time )
+static void ResetTime( demux_t *p_demux, vlc_tick_t i_time )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index c6c3a68f31..0a900ce2a6 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -440,7 +440,7 @@ static int Mux( sout_mux_t *p_mux )
 
     for( ;; )
     {
-        mtime_t i_dts;
+        vlc_tick_t i_dts;
 
         int i_stream = sout_MuxGetStream( p_mux, 1, &i_dts );
         if( i_stream < 0 )
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index d3383a1786..93bb4fd2f9 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -87,7 +87,7 @@ vlc_module_end ()
  * Local prototypes
  *****************************************************************************/
 static int Control         ( demux_t *, int, va_list );
-static int Seek            ( demux_t *, mtime_t, double, bool );
+static int Seek            ( demux_t *, vlc_tick_t, double, bool );
 static int Demux_Seekable  ( demux_t * );
 static int Demux_UnSeekable( demux_t * );
 
@@ -170,14 +170,14 @@ typedef struct
 
 typedef struct
 {
-    mtime_t i_time;
-    mtime_t i_length;
+    vlc_tick_t i_time;
+    vlc_tick_t i_length;
 
     bool  b_interleaved;
     bool  b_seekable;
     bool  b_fastseekable;
     bool  b_indexloaded; /* if we read indexes from end of file before starting */
-    mtime_t i_read_increment;
+    vlc_tick_t i_read_increment;
     uint32_t i_avih_flags;
     avi_chunk_t ck_root;
 
@@ -199,10 +199,10 @@ typedef struct
 
 #define __EVEN(x) (((x) & 1) ? (x) + 1 : (x))
 
-static int64_t AVI_PTSToChunk( avi_track_t *, mtime_t i_pts );
-static int64_t AVI_PTSToByte ( avi_track_t *, mtime_t i_pts );
-static mtime_t AVI_GetDPTS   ( avi_track_t *, int64_t i_count );
-static mtime_t AVI_GetPTS    ( avi_track_t * );
+static int64_t AVI_PTSToChunk( avi_track_t *, vlc_tick_t i_pts );
+static int64_t AVI_PTSToByte ( avi_track_t *, vlc_tick_t i_pts );
+static vlc_tick_t AVI_GetDPTS   ( avi_track_t *, int64_t i_count );
+static vlc_tick_t AVI_GetPTS    ( avi_track_t * );
 
 
 static int AVI_StreamChunkFind( demux_t *, unsigned int i_stream );
@@ -225,14 +225,14 @@ static void AVI_ExtractSubtitle( demux_t *, unsigned int i_stream, avi_chunk_lis
 
 static void AVI_DvHandleAudio( demux_t *, avi_track_t *, block_t * );
 
-static mtime_t  AVI_MovieGetLength( demux_t * );
+static vlc_tick_t  AVI_MovieGetLength( demux_t * );
 
 static void AVI_MetaLoad( demux_t *, avi_chunk_list_t *p_riff, avi_chunk_avih_t *p_avih );
 
 /*****************************************************************************
  * Stream management
  *****************************************************************************/
-static int        AVI_TrackSeek  ( demux_t *, int, mtime_t );
+static int        AVI_TrackSeek  ( demux_t *, int, vlc_tick_t );
 static int        AVI_TrackStopFinishedStreams( demux_t *);
 
 /* Remarks:
@@ -798,8 +798,8 @@ aviindex:
             i_idx_totalframes = __MAX(i_idx_totalframes, tk->idx.i_size);
     }
     if( i_idx_totalframes != p_avih->i_totalframes &&
-        p_sys->i_length < (mtime_t)p_avih->i_totalframes *
-                          (mtime_t)p_avih->i_microsecperframe /
+        p_sys->i_length < (vlc_tick_t)p_avih->i_totalframes *
+                          (vlc_tick_t)p_avih->i_microsecperframe /
                           CLOCK_FREQ )
     {
         msg_Warn( p_demux, "broken or missing index, 'seek' will be "
@@ -872,8 +872,8 @@ aviindex:
             int64_t i_track_length =
                 tk->idx.p_entry[tk->idx.i_size-1].i_length +
                 tk->idx.p_entry[tk->idx.i_size-1].i_lengthtotal;
-            mtime_t i_length = (mtime_t)p_avih->i_totalframes *
-                               (mtime_t)p_avih->i_microsecperframe;
+            vlc_tick_t i_length = (vlc_tick_t)p_avih->i_totalframes *
+                               (vlc_tick_t)p_avih->i_microsecperframe;
 
             if( i_length == 0 )
             {
@@ -1083,7 +1083,7 @@ static int Demux_Seekable( demux_t *p_demux )
             toread[i_track].i_posf = -1;
         }
 
-        mtime_t i_dpts = p_sys->i_time - AVI_GetPTS( tk );
+        vlc_tick_t i_dpts = p_sys->i_time - AVI_GetPTS( tk );
 
         if( tk->i_samplesize )
         {
@@ -1514,7 +1514,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
 /*****************************************************************************
  * Seek: goto to i_date or i_percent
  *****************************************************************************/
-static int Seek( demux_t *p_demux, mtime_t i_date, double f_ratio, bool b_accurate )
+static int Seek( demux_t *p_demux, vlc_tick_t i_date, double f_ratio, bool b_accurate )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     msg_Dbg( p_demux, "seek requested: %"PRId64" seconds %2.2f%%",
@@ -1613,8 +1613,8 @@ static int Seek( demux_t *p_demux, mtime_t i_date, double f_ratio, bool b_accura
         }
 
         /* */
-        mtime_t i_wanted = i_date;
-        mtime_t i_start = i_date;
+        vlc_tick_t i_wanted = i_date;
+        vlc_tick_t i_start = i_date;
         /* Do a 2 pass seek, first with video (can seek ahead due to keyframes),
            so we can seek audio to the same starting time */
         for(int i=0; i<2; i++)
@@ -1673,7 +1673,7 @@ static double ControlGetPosition( demux_t *p_demux )
 
     if( p_sys->i_length > 0 )
     {
-        return (double)p_sys->i_time / (double)( p_sys->i_length * (mtime_t)CLOCK_FREQ );
+        return (double)p_sys->i_time / (double)( p_sys->i_length * (vlc_tick_t)CLOCK_FREQ );
     }
     else if( stream_Size( p_demux->s ) > 0 )
     {
@@ -1710,7 +1710,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             }
             else
             {
-                i64 = (mtime_t)(f * CLOCK_FREQ * p_sys->i_length);
+                i64 = (vlc_tick_t)(f * CLOCK_FREQ * p_sys->i_length);
                 return Seek( p_demux, i64, f, b );
             }
 
@@ -1742,7 +1742,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         }
         case DEMUX_GET_LENGTH:
             pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_length * (mtime_t)CLOCK_FREQ;
+            *pi64 = p_sys->i_length * (vlc_tick_t)CLOCK_FREQ;
             return VLC_SUCCESS;
 
         case DEMUX_GET_FPS:
@@ -1814,7 +1814,7 @@ static int64_t AVI_Rescale( int64_t i_value, uint32_t i_timescale, uint32_t i_ne
     return q * i_newscale + r * i_newscale / i_timescale;
 }
 
-static int64_t AVI_PTSToChunk( avi_track_t *tk, mtime_t i_pts )
+static int64_t AVI_PTSToChunk( avi_track_t *tk, vlc_tick_t i_pts )
 {
     if( !tk->i_scale )
         return 0;
@@ -1823,7 +1823,7 @@ static int64_t AVI_PTSToChunk( avi_track_t *tk, mtime_t i_pts )
     return i_pts / CLOCK_FREQ;
 }
 
-static int64_t AVI_PTSToByte( avi_track_t *tk, mtime_t i_pts )
+static int64_t AVI_PTSToByte( avi_track_t *tk, vlc_tick_t i_pts )
 {
     if( !tk->i_scale || !tk->i_samplesize )
         return 0;
@@ -1832,9 +1832,9 @@ static int64_t AVI_PTSToByte( avi_track_t *tk, mtime_t i_pts )
     return i_pts / CLOCK_FREQ * tk->i_samplesize;
 }
 
-static mtime_t AVI_GetDPTS( avi_track_t *tk, int64_t i_count )
+static vlc_tick_t AVI_GetDPTS( avi_track_t *tk, int64_t i_count )
 {
-    mtime_t i_dpts = 0;
+    vlc_tick_t i_dpts = 0;
 
     if( !tk->i_rate )
         return i_dpts;
@@ -1849,7 +1849,7 @@ static mtime_t AVI_GetDPTS( avi_track_t *tk, int64_t i_count )
     return i_dpts;
 }
 
-static mtime_t AVI_GetPTS( avi_track_t *tk )
+static vlc_tick_t AVI_GetPTS( avi_track_t *tk )
 {
     /* Lookup samples index */
     if( tk->i_samplesize && tk->idx.i_size )
@@ -2044,13 +2044,13 @@ static int AVI_StreamBytesSet( demux_t    *p_demux,
 
 static int AVI_TrackSeek( demux_t *p_demux,
                            int i_stream,
-                           mtime_t i_date )
+                           vlc_tick_t i_date )
 {
     demux_sys_t  *p_sys = p_demux->p_sys;
     avi_track_t  *tk = p_sys->track[i_stream];
 
 #define p_stream    p_sys->track[i_stream]
-    mtime_t i_oldpts;
+    vlc_tick_t i_oldpts;
 
     i_oldpts = AVI_GetPTS( p_stream );
 
@@ -2493,7 +2493,7 @@ static int AVI_IndexLoad_idx1( demux_t *p_demux,
     {
         for( unsigned i = 0; i < p_index[i_index].i_size; i++ )
         {
-            mtime_t i_length;
+            vlc_tick_t i_length;
             if( p_sys->track[i_index]->i_samplesize )
             {
                 i_length = AVI_GetDPTS( p_sys->track[i_index],
@@ -2679,7 +2679,7 @@ static void AVI_IndexCreate( demux_t *p_demux )
     unsigned int i_stream;
     uint32_t i_movi_end;
 
-    mtime_t i_dialog_update;
+    vlc_tick_t i_dialog_update;
     vlc_dialog_id *p_dialog_id = NULL;
 
     p_riff = AVI_ChunkFind( &p_sys->ck_root, AVIFOURCC_RIFF, 0, true );
@@ -3073,16 +3073,16 @@ static int AVI_TrackStopFinishedStreams( demux_t *p_demux )
 /****************************************************************************
  * AVI_MovieGetLength give max streams length in second
  ****************************************************************************/
-static mtime_t  AVI_MovieGetLength( demux_t *p_demux )
+static vlc_tick_t  AVI_MovieGetLength( demux_t *p_demux )
 {
     demux_sys_t  *p_sys = p_demux->p_sys;
-    mtime_t      i_maxlength = 0;
+    vlc_tick_t   i_maxlength = 0;
     unsigned int i;
 
     for( i = 0; i < p_sys->i_track; i++ )
     {
         avi_track_t *tk = p_sys->track[i];
-        mtime_t i_length;
+        vlc_tick_t i_length;
 
         /* fix length for each stream */
         if( tk->idx.i_size < 1 || !tk->idx.p_entry )
diff --git a/modules/demux/caf.c b/modules/demux/caf.c
index 98aa18e5e2..1c5292ad16 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -330,7 +330,7 @@ static int FrameSpanAddDescription( demux_t *p_demux, uint64_t i_desc_offset, fr
 
 /* FrameSpanGetTime returns the time span represented by the frame span. */
 
-static inline mtime_t FrameSpanGetTime( frame_span_t *span, uint32_t i_sample_rate )
+static inline vlc_tick_t FrameSpanGetTime( frame_span_t *span, uint32_t i_sample_rate )
 {
     if( !i_sample_rate )
         return VLC_TS_INVALID;
diff --git a/modules/demux/cdg.c b/modules/demux/cdg.c
index cc6af125fc..c45832c3e5 100644
--- a/modules/demux/cdg.c
+++ b/modules/demux/cdg.c
@@ -117,8 +117,8 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     block_t     *p_block;
-    mtime_t     i_date;
-    mtime_t     i_delta;
+    vlc_tick_t  i_date;
+    vlc_tick_t  i_delta;
 
     i_delta = CLOCK_FREQ / CDG_FRAME_RATE;
 
diff --git a/modules/demux/dash/DASHManager.cpp b/modules/demux/dash/DASHManager.cpp
index 7670e61e57..284890a2e6 100644
--- a/modules/demux/dash/DASHManager.cpp
+++ b/modules/demux/dash/DASHManager.cpp
@@ -66,12 +66,12 @@ void DASHManager::scheduleNextUpdate()
 {
     time_t now = time(NULL);
 
-    mtime_t minbuffer = 0;
+    vlc_tick_t minbuffer = 0;
     std::vector<AbstractStream *>::const_iterator it;
     for(it=streams.begin(); it!=streams.end(); ++it)
     {
         const AbstractStream *st = *it;
-        const mtime_t m = st->getMinAheadTime();
+        const vlc_tick_t m = st->getMinAheadTime();
         if(m > 0 && (m < minbuffer || minbuffer == 0))
             minbuffer = m;
     }
@@ -85,7 +85,7 @@ void DASHManager::scheduleNextUpdate()
 
     nextPlaylistupdate = now + minbuffer / CLOCK_FREQ;
 
-    msg_Dbg(p_demux, "Updated MPD, next update in %" PRId64 "s", (mtime_t) nextPlaylistupdate - now );
+    msg_Dbg(p_demux, "Updated MPD, next update in %" PRId64 "s", (vlc_tick_t) nextPlaylistupdate - now );
 }
 
 bool DASHManager::needsUpdate() const
@@ -122,11 +122,11 @@ bool DASHManager::updatePlaylist()
             return false;
         }
 
-        mtime_t minsegmentTime = 0;
+        vlc_tick_t minsegmentTime = 0;
         std::vector<AbstractStream *>::iterator it;
         for(it=streams.begin(); it!=streams.end(); it++)
         {
-            mtime_t segmentTime = (*it)->getPlaybackTime();
+            vlc_tick_t segmentTime = (*it)->getPlaybackTime();
             if(!minsegmentTime || segmentTime < minsegmentTime)
                 minsegmentTime = segmentTime;
         }
diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index 23d0e5e117..b7ae533be4 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -104,7 +104,7 @@ void    IsoffMainParser::parseMPDAttributes   (MPD *mpd, xml::Node *node)
     it = attr.find("minimumUpdatePeriod");
     if(it != attr.end())
     {
-        mtime_t minupdate = IsoTime(it->second) * CLOCK_FREQ;
+        vlc_tick_t minupdate = IsoTime(it->second) * CLOCK_FREQ;
         if(minupdate > 0)
             mpd->minUpdatePeriod.Set(minupdate);
     }
diff --git a/modules/demux/dash/mpd/Representation.cpp b/modules/demux/dash/mpd/Representation.cpp
index d49af4df28..8e5116b76a 100644
--- a/modules/demux/dash/mpd/Representation.cpp
+++ b/modules/demux/dash/mpd/Representation.cpp
@@ -161,9 +161,9 @@ std::string Representation::contextualize(size_t number, const std::string &comp
     return ret;
 }
 
-mtime_t Representation::getScaledTimeBySegmentNumber(uint64_t index, const MediaSegmentTemplate *templ) const
+vlc_tick_t Representation::getScaledTimeBySegmentNumber(uint64_t index, const MediaSegmentTemplate *templ) const
 {
-    mtime_t time = 0;
+    vlc_tick_t time = 0;
     if(templ->segmentTimeline.Get())
     {
         time = templ->segmentTimeline.Get()->getScaledPlaybackTimeByElementNumber(index);
diff --git a/modules/demux/dash/mpd/Representation.h b/modules/demux/dash/mpd/Representation.h
index 8b7954250a..a1cbaf2199 100644
--- a/modules/demux/dash/mpd/Representation.h
+++ b/modules/demux/dash/mpd/Representation.h
@@ -71,7 +71,7 @@ namespace dash
                 TrickModeType                       *trickModeType;
 
                 /* for contextualize() */
-                mtime_t getScaledTimeBySegmentNumber(uint64_t, const MediaSegmentTemplate *) const;
+                vlc_tick_t getScaledTimeBySegmentNumber(uint64_t, const MediaSegmentTemplate *) const;
         };
     }
 }
diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index 0373e10403..135354422b 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -66,7 +66,7 @@ static int  ParseHeaders( demux_t *, es_format_t * );
 
 typedef struct
 {
-    mtime_t  i_time_offset;
+    vlc_tick_t  i_time_offset;
     uint64_t i_byte_offset;
 } flac_seekpoint_t;
 
@@ -82,7 +82,7 @@ typedef struct
 
     vlc_meta_t *p_meta;
 
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
     struct flac_stream_info stream_info;
     bool b_stream_info;
 
@@ -260,7 +260,7 @@ static void Reset( demux_sys_t *p_sys )
     }
 }
 
-static int RefineSeek( demux_t *p_demux, mtime_t i_time, double i_bytemicrorate,
+static int RefineSeek( demux_t *p_demux, vlc_tick_t i_time, double i_bytemicrorate,
                        uint64_t i_lowpos, uint64_t i_highpos )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
@@ -308,7 +308,7 @@ static int RefineSeek( demux_t *p_demux, mtime_t i_time, double i_bytemicrorate,
         /* If we are further than wanted block */
         if( p_block_out->i_dts >= i_time )
         {
-            mtime_t i_diff = p_block_out->i_dts - i_time;
+            vlc_tick_t i_diff = p_block_out->i_dts - i_time;
             /* Not in acceptable approximation range */
             if( i_diff > CLOCK_FREQ / 10 && i_diff / i_bytemicrorate > i_frame_size )
             {
@@ -320,7 +320,7 @@ static int RefineSeek( demux_t *p_demux, mtime_t i_time, double i_bytemicrorate,
         }
         else if( p_block_out->i_dts < i_time )
         {
-            mtime_t i_diff = i_time - p_block_out->i_dts;
+            vlc_tick_t i_diff = i_time - p_block_out->i_dts;
             /* Not in acceptable NEXT_TIME demux range */
             if( i_diff >= ((b_canfastseek) ? FLAC_MAX_PREROLL : FLAC_MAX_SLOW_PREROLL) &&
                 i_diff / i_bytemicrorate > i_frame_size )
@@ -451,7 +451,7 @@ static int ControlSetTime( demux_t *p_demux, int64_t i_time )
     if( !b_seekable )
         return VLC_EGENERIC;
 
-    const mtime_t i_length = ControlGetLength( p_demux );
+    const vlc_tick_t i_length = ControlGetLength( p_demux );
     if( i_length <= 0 )
         return VLC_EGENERIC;
 
diff --git a/modules/demux/hls/HLSManager.cpp b/modules/demux/hls/HLSManager.cpp
index e8a3510b3f..16deeae5cb 100644
--- a/modules/demux/hls/HLSManager.cpp
+++ b/modules/demux/hls/HLSManager.cpp
@@ -104,7 +104,7 @@ bool HLSManager::isHTTPLiveStreaming(stream_t *s)
     return false;
 }
 
-mtime_t HLSManager::getFirstPlaybackTime() const
+vlc_tick_t HLSManager::getFirstPlaybackTime() const
 {
     return demux.i_firstpcr;
 }
diff --git a/modules/demux/hls/HLSManager.hpp b/modules/demux/hls/HLSManager.hpp
index 07d330f34c..eacfece84c 100644
--- a/modules/demux/hls/HLSManager.hpp
+++ b/modules/demux/hls/HLSManager.hpp
@@ -40,7 +40,7 @@ namespace hls
             static bool isHTTPLiveStreaming(stream_t *);
 
         protected:
-            virtual mtime_t getFirstPlaybackTime() const;
+            virtual vlc_tick_t getFirstPlaybackTime() const;
     };
 
 }
diff --git a/modules/demux/hls/HLSStreams.cpp b/modules/demux/hls/HLSStreams.cpp
index 60029f7a50..45fe456d27 100644
--- a/modules/demux/hls/HLSStreams.cpp
+++ b/modules/demux/hls/HLSStreams.cpp
@@ -47,7 +47,7 @@ HLSStream::~HLSStream()
         vlc_meta_Delete(p_meta);
 }
 
-void HLSStream::setTimeOffset(mtime_t i_offset)
+void HLSStream::setTimeOffset(vlc_tick_t i_offset)
 {
     if(i_offset >= 0)
     {
@@ -74,7 +74,7 @@ int HLSStream::ParseID3PrivTag(const uint8_t *p_payload, size_t i_payload)
     {
         if(!b_id3_timestamps_offset_set)
         {
-            const mtime_t i_aac_offset = GetQWBE(&p_payload[45]) * 100 / 9;
+            const vlc_tick_t i_aac_offset = GetQWBE(&p_payload[45]) * 100 / 9;
             setTimeOffset(i_aac_offset);
             b_id3_timestamps_offset_set = true;
         }
diff --git a/modules/demux/hls/HLSStreams.hpp b/modules/demux/hls/HLSStreams.hpp
index 669c54cdfe..77dff6a434 100644
--- a/modules/demux/hls/HLSStreams.hpp
+++ b/modules/demux/hls/HLSStreams.hpp
@@ -33,7 +33,7 @@ namespace hls
             virtual ~HLSStream();
 
         protected:
-            virtual void setTimeOffset(mtime_t); /* reimpl */
+            virtual void setTimeOffset(vlc_tick_t); /* reimpl */
             virtual block_t *checkBlock(block_t *, bool); /* reimpl */
             virtual AbstractDemuxer * newDemux(demux_t *, const StreamFormat &,
                                                es_out_t *, AbstractSourceStream *) const; /* reimpl */
diff --git a/modules/demux/hls/playlist/HLSSegment.cpp b/modules/demux/hls/playlist/HLSSegment.cpp
index 57b3639052..c43f6a58ad 100644
--- a/modules/demux/hls/playlist/HLSSegment.cpp
+++ b/modules/demux/hls/playlist/HLSSegment.cpp
@@ -129,7 +129,7 @@ void HLSSegment::onChunkDownload(block_t **pp_block, SegmentChunk *chunk, BaseRe
     }
 }
 
-mtime_t HLSSegment::getUTCTime() const
+vlc_tick_t HLSSegment::getUTCTime() const
 {
     return utcTime;
 }
diff --git a/modules/demux/hls/playlist/HLSSegment.hpp b/modules/demux/hls/playlist/HLSSegment.hpp
index 0957d9d41f..b96a558aef 100644
--- a/modules/demux/hls/playlist/HLSSegment.hpp
+++ b/modules/demux/hls/playlist/HLSSegment.hpp
@@ -54,11 +54,11 @@ namespace hls
                 HLSSegment( ICanonicalUrl *parent, uint64_t sequence );
                 virtual ~HLSSegment();
                 void setEncryption(SegmentEncryption &);
-                mtime_t getUTCTime() const;
+                vlc_tick_t getUTCTime() const;
                 virtual int compare(ISegment *) const; /* reimpl */
 
             protected:
-                mtime_t utcTime;
+                vlc_tick_t utcTime;
                 virtual void onChunkDownload(block_t **, SegmentChunk *, BaseRepresentation *); /* reimpl */
 
                 SegmentEncryption encryption;
diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index db70528b80..e892ffc885 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -197,9 +197,9 @@ void M3U8Parser::parseSegments(vlc_object_t *, Representation *rep, const std::l
     rep->setTimescale(100);
     rep->b_loaded = true;
 
-    mtime_t totalduration = 0;
-    mtime_t nzStartTime = 0;
-    mtime_t absReferenceTime = VLC_TS_INVALID;
+    vlc_tick_t totalduration = 0;
+    vlc_tick_t nzStartTime = 0;
+    vlc_tick_t absReferenceTime = VLC_TS_INVALID;
     uint64_t sequenceNumber = 0;
     bool discontinuity = false;
     std::size_t prevbyterangeoffset = 0;
@@ -253,7 +253,7 @@ void M3U8Parser::parseSegments(vlc_object_t *, Representation *rep, const std::l
                         duration = durAttribute->floatingPoint();
                     ctx_extinf = NULL;
                 }
-                const mtime_t nzDuration = CLOCK_FREQ * duration;
+                const vlc_tick_t nzDuration = CLOCK_FREQ * duration;
                 segment->duration.Set(duration * (uint64_t) rep->getTimescale());
                 segment->startTime.Set(rep->getTimescale().ToScaled(nzStartTime));
                 nzStartTime += nzDuration;
diff --git a/modules/demux/hls/playlist/Representation.cpp b/modules/demux/hls/playlist/Representation.cpp
index 94b4c59486..9a685d9216 100644
--- a/modules/demux/hls/playlist/Representation.cpp
+++ b/modules/demux/hls/playlist/Representation.cpp
@@ -105,7 +105,7 @@ void Representation::scheduleNextUpdate(uint64_t number)
     const time_t now = time(NULL);
 
     /* Compute new update time */
-    mtime_t minbuffer = getMinAheadTime(number);
+    vlc_tick_t minbuffer = getMinAheadTime(number);
 
     /* Update frequency must always be at least targetDuration (if any)
      * but we need to update before reaching that last segment, thus -1 */
@@ -127,7 +127,7 @@ void Representation::scheduleNextUpdate(uint64_t number)
     nextUpdateTime = now + minbuffer / CLOCK_FREQ;
 
     msg_Dbg(playlist->getVLCObject(), "Updated playlist ID %s, next update in %" PRId64 "s",
-            getID().str().c_str(), (mtime_t) nextUpdateTime - now);
+            getID().str().c_str(), (vlc_tick_t) nextUpdateTime - now);
 
     debug(playlist->getVLCObject(), 0);
 }
@@ -137,7 +137,7 @@ bool Representation::needsUpdate() const
     return !b_loaded || (isLive() && nextUpdateTime < time(NULL));
 }
 
-bool Representation::runLocalUpdates(mtime_t, uint64_t number, bool prune)
+bool Representation::runLocalUpdates(vlc_tick_t, uint64_t number, bool prune)
 {
     const time_t now = time(NULL);
     AbstractPlaylist *playlist = getPlaylist();
@@ -167,7 +167,7 @@ uint64_t Representation::translateSegmentNumber(uint64_t num, const SegmentInfor
     HLSSegment *fromHlsSeg = dynamic_cast<HLSSegment *>(fromSeg);
     if(!fromHlsSeg)
         return 1;
-    const mtime_t utcTime = fromHlsSeg->getUTCTime();
+    const vlc_tick_t utcTime = fromHlsSeg->getUTCTime();
 
     std::vector<ISegment *> list;
     std::vector<ISegment *>::const_iterator it;
diff --git a/modules/demux/hls/playlist/Representation.hpp b/modules/demux/hls/playlist/Representation.hpp
index 6bdc5f5d65..ed2da0da8e 100644
--- a/modules/demux/hls/playlist/Representation.hpp
+++ b/modules/demux/hls/playlist/Representation.hpp
@@ -50,7 +50,7 @@ namespace hls
                 virtual void scheduleNextUpdate(uint64_t); /* reimpl */
                 virtual bool needsUpdate() const;  /* reimpl */
                 virtual void debug(vlc_object_t *, int) const;  /* reimpl */
-                virtual bool runLocalUpdates(mtime_t, uint64_t, bool); /* reimpl */
+                virtual bool runLocalUpdates(vlc_tick_t, uint64_t, bool); /* reimpl */
                 virtual uint64_t translateSegmentNumber(uint64_t, const SegmentInformation *) const; /* reimpl */
 
             private:
diff --git a/modules/demux/image.c b/modules/demux/image.c
index 0e8586e74f..7c63a19afe 100644
--- a/modules/demux/image.c
+++ b/modules/demux/image.c
@@ -102,10 +102,10 @@ typedef struct
 {
     block_t     *data;
     es_out_id_t *es;
-    mtime_t     duration;
+    vlc_tick_t  duration;
     bool        is_realtime;
     int64_t     pts_offset;
-    mtime_t     pts_next;
+    vlc_tick_t  pts_next;
     date_t        pts;
 } demux_sys_t;
 
@@ -190,13 +190,13 @@ static int Demux(demux_t *demux)
     if (!sys->data)
         return VLC_DEMUXER_EOF;
 
-    mtime_t deadline;
-    const mtime_t pts_first = sys->pts_offset + date_Get(&sys->pts);
+    vlc_tick_t deadline;
+    const vlc_tick_t pts_first = sys->pts_offset + date_Get(&sys->pts);
     if (sys->pts_next != VLC_TS_INVALID) {
         deadline = sys->pts_next;
     } else if (sys->is_realtime) {
         deadline = mdate();
-        const mtime_t max_wait = CLOCK_FREQ / 50;
+        const vlc_tick_t max_wait = CLOCK_FREQ / 50;
         if (deadline + max_wait < pts_first) {
             es_out_SetPCR(demux->out, deadline);
             /* That's ugly, but not yet easily fixable */
@@ -208,7 +208,7 @@ static int Demux(demux_t *demux)
     }
 
     for (;;) {
-        const mtime_t pts = sys->pts_offset + date_Get(&sys->pts);
+        const vlc_tick_t pts = sys->pts_offset + date_Get(&sys->pts);
         if (sys->duration >= 0 && pts >= VLC_TS_0 + sys->pts_offset + sys->duration)
             return VLC_DEMUXER_EOF;
 
@@ -267,7 +267,7 @@ static int Control(demux_t *demux, int query, va_list args)
         return VLC_SUCCESS;
     }
     case DEMUX_SET_NEXT_DEMUX_TIME: {
-        mtime_t pts_next = VLC_TS_0 + va_arg(args, mtime_t);
+        vlc_tick_t pts_next = VLC_TS_0 + va_arg(args, vlc_tick_t);
         if (sys->pts_next == VLC_TS_INVALID)
             sys->pts_offset = pts_next - VLC_TS_0;
         sys->pts_next = pts_next;
diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index d0355f35ea..0726649c78 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -70,9 +70,9 @@ typedef struct
     es_out_id_t     *p_es;
 
     bool            b_still;
-    mtime_t         i_still_end;
-    mtime_t         i_time;
-    mtime_t         i_frame_length;
+    vlc_tick_t      i_still_end;
+    vlc_tick_t      i_time;
+    vlc_tick_t      i_frame_length;
     char            *psz_separator;
     int             i_frame_size_estimate;
     const uint8_t   *p_peek;
diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index 014e0b108e..2d55eebe56 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -729,7 +729,7 @@ void demux_sys_t::FreeUnused()
     }
 }
 
-bool demux_sys_t::PreparePlayback( virtual_segment_c & new_vsegment, mtime_t i_mk_date )
+bool demux_sys_t::PreparePlayback( virtual_segment_c & new_vsegment, vlc_tick_t i_mk_date )
 {
     if ( p_current_vsegment != &new_vsegment )
     {
diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index c9cfe557c9..451039628f 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -357,10 +357,10 @@ public:
     bool                    b_seekable;
     bool                    b_fastseekable;
 
-    mtime_t                 i_pts;
-    mtime_t                 i_pcr;
-    mtime_t                 i_start_pts;
-    mtime_t                 i_mk_chapter_time;
+    vlc_tick_t              i_pts;
+    vlc_tick_t              i_pcr;
+    vlc_tick_t              i_start_pts;
+    vlc_tick_t              i_mk_chapter_time;
 
     vlc_meta_t              *meta;
 
@@ -391,7 +391,7 @@ public:
     void PreloadFamily( const matroska_segment_c & of_segment );
     bool PreloadLinked();
     void FreeUnused();
-    bool PreparePlayback( virtual_segment_c & new_vsegment, mtime_t i_mk_date );
+    bool PreparePlayback( virtual_segment_c & new_vsegment, vlc_tick_t i_mk_date );
     bool AnalyseAllSegmentsFound( demux_t *p_demux, matroska_stream_c * );
     void JumpTo( virtual_segment_c & vsegment, virtual_chapter_c & vchapter );
 
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 457fdbc641..148e66ee8f 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -106,7 +106,7 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
         if( MKV_IS_ID( el, KaxCuePoint ) )
         {
             uint64_t cue_position = -1;
-            mtime_t  cue_mk_time = -1;
+            vlc_tick_t  cue_mk_time = -1;
 
             unsigned int track_id = 0;
             bool b_invalid_cue = false;
@@ -779,13 +779,13 @@ bool matroska_segment_c::LoadSeekHeadItem( const EbmlCallbacks & ClassInfos, int
     return true;
 }
 
-bool matroska_segment_c::Seek( demux_t &demuxer, mtime_t i_absolute_mk_date, mtime_t i_mk_time_offset, bool b_accurate )
+bool matroska_segment_c::Seek( demux_t &demuxer, vlc_tick_t i_absolute_mk_date, vlc_tick_t i_mk_time_offset, bool b_accurate )
 {
     SegmentSeeker::tracks_seekpoint_t seekpoints;
 
     SegmentSeeker::fptr_t i_seek_position = std::numeric_limits<SegmentSeeker::fptr_t>::max();
-    mtime_t i_mk_seek_time = -1;
-    mtime_t i_mk_date = i_absolute_mk_date - i_mk_time_offset;
+    vlc_tick_t i_mk_seek_time = -1;
+    vlc_tick_t i_mk_date = i_absolute_mk_date - i_mk_time_offset;
     SegmentSeeker::track_ids_t selected_tracks;
     SegmentSeeker::track_ids_t priority;
 
diff --git a/modules/demux/mkv/matroska_segment.hpp b/modules/demux/mkv/matroska_segment.hpp
index dd3ac52723..397466f4be 100644
--- a/modules/demux/mkv/matroska_segment.hpp
+++ b/modules/demux/mkv/matroska_segment.hpp
@@ -91,8 +91,8 @@ public:
     uint64_t                i_timescale;
 
     /* duration of the segment */
-    mtime_t                 i_duration;
-    mtime_t                 i_mk_start_time;
+    vlc_tick_t              i_duration;
+    vlc_tick_t              i_mk_start_time;
 
     /* all tracks */
     tracks_map_t tracks;
@@ -142,7 +142,7 @@ public:
     bool PreloadClusters( uint64 i_cluster_position );
     void InformationCreate();
 
-    bool Seek( demux_t &, mtime_t i_mk_date, mtime_t i_mk_time_offset, bool b_accurate );
+    bool Seek( demux_t &, vlc_tick_t i_mk_date, vlc_tick_t i_mk_time_offset, bool b_accurate );
 
     int BlockGet( KaxBlock * &, KaxSimpleBlock * &, bool *, bool *, int64_t *);
 
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index c4754723ec..c8d9065faa 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1007,7 +1007,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
         }
         E_CASE( KaxDuration, dur )
         {
-            vars.obj->i_duration = mtime_t( static_cast<double>( dur ) );
+            vars.obj->i_duration = vlc_tick_t( static_cast<double>( dur ) );
             debug( vars, "Duration=%" PRId64, vars.obj->i_duration );
         }
         E_CASE( KaxMuxingApp, mapp )
@@ -1104,7 +1104,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
     InfoHandlers::Dispatcher().iterate( m->begin(), m->end(), &captures );
 
     if( i_duration != -1 )
-        i_duration = mtime_t( static_cast<double>( i_duration * i_timescale ) / 10e5 );
+        i_duration = vlc_tick_t( static_cast<double>( i_duration * i_timescale ) / 10e5 );
 }
 
 
diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp
index 8feecb902f..1d1b18a88f 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -66,8 +66,8 @@ SegmentSeeker::add_cluster( KaxCluster * const p_cluster )
 {
     Cluster cinfo = {
         /* fpos     */ p_cluster->GetElementPosition(),
-        /* pts      */ mtime_t( p_cluster->GlobalTimecode() / INT64_C( 1000 ) ),
-        /* duration */ mtime_t( -1 ),
+        /* pts      */ vlc_tick_t( p_cluster->GlobalTimecode() / INT64_C( 1000 ) ),
+        /* duration */ vlc_tick_t( -1 ),
         /* size     */ p_cluster->IsFiniteSize()
             ? p_cluster->GetEndPosition() - p_cluster->GetElementPosition()
             : UINT64_MAX
@@ -131,7 +131,7 @@ SegmentSeeker::add_seekpoint( track_id_t track_id, Seekpoint sp )
 }
 
 SegmentSeeker::tracks_seekpoint_t
-SegmentSeeker::find_greatest_seekpoints_in_range( fptr_t start_fpos, mtime_t end_pts, track_ids_t const& filter_tracks )
+SegmentSeeker::find_greatest_seekpoints_in_range( fptr_t start_fpos, vlc_tick_t end_pts, track_ids_t const& filter_tracks )
 {
     tracks_seekpoint_t tpoints;
 
@@ -172,7 +172,7 @@ SegmentSeeker::find_greatest_seekpoints_in_range( fptr_t start_fpos, mtime_t end
 }
 
 SegmentSeeker::Seekpoint
-SegmentSeeker::get_first_seekpoint_around( mtime_t pts, seekpoints_t const& seekpoints,
+SegmentSeeker::get_first_seekpoint_around( vlc_tick_t pts, seekpoints_t const& seekpoints,
                                            Seekpoint::TrustLevel trust_level )
 {
     if( seekpoints.empty() )
@@ -200,7 +200,7 @@ SegmentSeeker::get_first_seekpoint_around( mtime_t pts, seekpoints_t const& seek
 }
 
 SegmentSeeker::seekpoint_pair_t
-SegmentSeeker::get_seekpoints_around( mtime_t pts, seekpoints_t const& seekpoints )
+SegmentSeeker::get_seekpoints_around( vlc_tick_t pts, seekpoints_t const& seekpoints )
 {
     if( seekpoints.empty() )
     {
@@ -228,7 +228,7 @@ SegmentSeeker::get_seekpoints_around( mtime_t pts, seekpoints_t const& seekpoint
 }
 
 SegmentSeeker::seekpoint_pair_t
-SegmentSeeker::get_seekpoints_around( mtime_t target_pts, track_ids_t const& priority_tracks )
+SegmentSeeker::get_seekpoints_around( vlc_tick_t target_pts, track_ids_t const& priority_tracks )
 {
     seekpoint_pair_t points;
 
@@ -285,7 +285,7 @@ SegmentSeeker::get_seekpoints_around( mtime_t target_pts, track_ids_t const& pri
 }
 
 SegmentSeeker::tracks_seekpoint_t
-SegmentSeeker::get_seekpoints( matroska_segment_c& ms, mtime_t target_pts,
+SegmentSeeker::get_seekpoints( matroska_segment_c& ms, vlc_tick_t target_pts,
                                track_ids_t const& priority_tracks, track_ids_t const& filter_tracks )
 {
     struct contains_all_of_t {
@@ -300,7 +300,7 @@ SegmentSeeker::get_seekpoints( matroska_segment_c& ms, mtime_t target_pts,
         }
     };
 
-    for( mtime_t needle_pts = target_pts; ; )
+    for( vlc_tick_t needle_pts = target_pts; ; )
     {
         seekpoint_pair_t seekpoints = get_seekpoints_around( needle_pts, priority_tracks );
 
@@ -326,7 +326,7 @@ SegmentSeeker::get_seekpoints( matroska_segment_c& ms, mtime_t target_pts,
 }
 
 void
-SegmentSeeker::index_range( matroska_segment_c& ms, Range search_area, mtime_t max_pts )
+SegmentSeeker::index_range( matroska_segment_c& ms, Range search_area, vlc_tick_t max_pts )
 {
     ranges_t areas_to_search = get_search_areas( search_area.start, search_area.end );
 
@@ -335,14 +335,14 @@ SegmentSeeker::index_range( matroska_segment_c& ms, Range search_area, mtime_t m
 }
 
 void
-SegmentSeeker::index_unsearched_range( matroska_segment_c& ms, Range search_area, mtime_t max_pts )
+SegmentSeeker::index_unsearched_range( matroska_segment_c& ms, Range search_area, vlc_tick_t max_pts )
 {
     mkv_jump_to( ms, search_area.start );
 
     search_area.start = ms.es.I_O().getFilePointer();
 
     fptr_t  block_pos = search_area.start;
-    mtime_t block_pts;
+    vlc_tick_t block_pts;
 
     while( block_pos < search_area.end )
     {
diff --git a/modules/demux/mkv/matroska_segment_seeker.hpp b/modules/demux/mkv/matroska_segment_seeker.hpp
index e2e1579354..ada76dca0d 100644
--- a/modules/demux/mkv/matroska_segment_seeker.hpp
+++ b/modules/demux/mkv/matroska_segment_seeker.hpp
@@ -61,7 +61,7 @@ class SegmentSeeker
                 DISABLED = -1,
             };
 
-            Seekpoint( fptr_t fpos, mtime_t pts, TrustLevel trust_level = TRUSTED )
+            Seekpoint( fptr_t fpos, vlc_tick_t pts, TrustLevel trust_level = TRUSTED )
                 : fpos( fpos ), pts( pts ), trust_level( trust_level )
             { }
 
@@ -75,14 +75,14 @@ class SegmentSeeker
             }
 
             fptr_t fpos;
-            mtime_t pts;
+            vlc_tick_t pts;
             TrustLevel trust_level;
         };
 
         struct Cluster {
             fptr_t  fpos;
-            mtime_t pts;
-            mtime_t duration;
+            vlc_tick_t pts;
+            vlc_tick_t duration;
             fptr_t  size;
         };
 
@@ -94,26 +94,26 @@ class SegmentSeeker
 
         typedef std::map<track_id_t, Seekpoint> tracks_seekpoint_t;
         typedef std::map<track_id_t, seekpoints_t> tracks_seekpoints_t;
-        typedef std::map<mtime_t, Cluster> cluster_map_t;
+        typedef std::map<vlc_tick_t, Cluster> cluster_map_t;
 
         typedef std::pair<Seekpoint, Seekpoint> seekpoint_pair_t;
 
         void add_seekpoint( track_id_t, Seekpoint );
 
-        seekpoint_pair_t get_seekpoints_around( mtime_t, seekpoints_t const& );
-        Seekpoint get_first_seekpoint_around( mtime_t, seekpoints_t const&, Seekpoint::TrustLevel = Seekpoint::TRUSTED );
-        seekpoint_pair_t get_seekpoints_around( mtime_t, track_ids_t const& );
+        seekpoint_pair_t get_seekpoints_around( vlc_tick_t, seekpoints_t const& );
+        Seekpoint get_first_seekpoint_around( vlc_tick_t, seekpoints_t const&, Seekpoint::TrustLevel = Seekpoint::TRUSTED );
+        seekpoint_pair_t get_seekpoints_around( vlc_tick_t, track_ids_t const& );
 
-        tracks_seekpoint_t get_seekpoints( matroska_segment_c&, mtime_t, track_ids_t const&, track_ids_t const& );
-        tracks_seekpoint_t find_greatest_seekpoints_in_range( fptr_t , mtime_t, track_ids_t const& filter_tracks );
+        tracks_seekpoint_t get_seekpoints( matroska_segment_c&, vlc_tick_t, track_ids_t const&, track_ids_t const& );
+        tracks_seekpoint_t find_greatest_seekpoints_in_range( fptr_t , vlc_tick_t, track_ids_t const& filter_tracks );
 
         cluster_positions_t::iterator add_cluster_position( fptr_t pos );
         cluster_map_t      ::iterator add_cluster( KaxCluster * const );
 
         void mkv_jump_to( matroska_segment_c&, fptr_t );
 
-        void index_range( matroska_segment_c& matroska_segment, Range search_area, mtime_t max_pts );
-        void index_unsearched_range( matroska_segment_c& matroska_segment, Range search_area, mtime_t max_pts );
+        void index_range( matroska_segment_c& matroska_segment, Range search_area, vlc_tick_t max_pts );
+        void index_unsearched_range( matroska_segment_c& matroska_segment, Range search_area, vlc_tick_t max_pts );
 
         void mark_range_as_searched( Range );
         ranges_t get_search_areas( fptr_t start, fptr_t end ) const;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index f5ed6ba97d..a0e7e2bac2 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -81,7 +81,7 @@ struct demux_sys_t;
 
 static int  Demux  ( demux_t * );
 static int  Control( demux_t *, int, va_list );
-static int  Seek   ( demux_t *, mtime_t i_mk_date, double f_percent, virtual_chapter_c *p_vchapter, bool b_precise = true );
+static int  Seek   ( demux_t *, vlc_tick_t i_mk_date, double f_percent, virtual_chapter_c *p_vchapter, bool b_precise = true );
 
 /*****************************************************************************
  * Open: initializes matroska demux structures
@@ -466,7 +466,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 }
 
 /* Seek */
-static int Seek( demux_t *p_demux, mtime_t i_mk_date, double f_percent, virtual_chapter_c *p_vchapter, bool b_precise )
+static int Seek( demux_t *p_demux, vlc_tick_t i_mk_date, double f_percent, virtual_chapter_c *p_vchapter, bool b_precise )
 {
     demux_sys_t *p_sys = (demux_sys_t *)p_demux->p_sys;
     virtual_segment_c  *p_vsegment = p_sys->p_current_vsegment;
@@ -506,7 +506,7 @@ static int Seek( demux_t *p_demux, mtime_t i_mk_date, double f_percent, virtual_
 
 /* Needed by matroska_segment::Seek() and Seek */
 void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock,
-                  mtime_t i_pts, mtime_t i_duration, bool b_key_picture,
+                  vlc_tick_t i_pts, vlc_tick_t i_duration, bool b_key_picture,
                   bool b_discardable_picture )
 {
     demux_sys_t *p_sys = (demux_sys_t *)p_demux->p_sys;
@@ -618,7 +618,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
             handle_real_audio(p_demux, &track, p_block, i_pts);
             block_Release(p_block);
             i_pts = ( track.i_default_duration )?
-                i_pts + ( mtime_t )track.i_default_duration:
+                i_pts + ( vlc_tick_t )track.i_default_duration:
                 VLC_TS_INVALID;
             continue;
          }
@@ -636,7 +636,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
             break;
 
          case VLC_CODEC_OPUS:
-            mtime_t i_length = i_duration * track. f_timecodescale *
+            vlc_tick_t i_length = i_duration * track. f_timecodescale *
                     (double) p_segment->i_timescale / 1000.0;
             if ( i_length < 0 ) i_length = 0;
             p_block->i_nb_samples = i_length * track.fmt.audio.i_rate
@@ -677,7 +677,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
                 else if ( track.i_last_dts == VLC_TS_INVALID )
                     p_block->i_dts = i_pts;
                 else
-                    p_block->i_dts = std::min( i_pts, track.i_last_dts + ( mtime_t )track.i_default_duration );
+                    p_block->i_dts = std::min( i_pts, track.i_last_dts + ( vlc_tick_t )track.i_default_duration );
             }
         }
 
@@ -685,7 +685,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
 
         /* use time stamp only for first block */
         i_pts = ( track.i_default_duration )?
-                 i_pts + ( mtime_t )track.i_default_duration:
+                 i_pts + ( vlc_tick_t )track.i_default_duration:
                  ( track.fmt.b_packetized ) ? VLC_TS_INVALID : i_pts + 1;
     }
 }
@@ -771,7 +771,7 @@ static int Demux( demux_t *p_demux)
 
     /* update pcr */
     {
-        mtime_t i_pcr = VLC_TS_INVALID;
+        vlc_tick_t i_pcr = VLC_TS_INVALID;
 
         typedef matroska_segment_c::tracks_map_t tracks_map_t;
 
diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
index 90be75902f..7841873215 100644
--- a/modules/demux/mkv/mkv.hpp
+++ b/modules/demux/mkv/mkv.hpp
@@ -118,7 +118,7 @@ enum
 using namespace LIBMATROSKA_NAMESPACE;
 
 void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock,
-                  mtime_t i_pts, mtime_t i_duration, bool b_key_picture,
+                  vlc_tick_t i_pts, vlc_tick_t i_duration, bool b_key_picture,
                   bool b_discardable_picture );
 
 class attachment_c
@@ -199,7 +199,7 @@ class mkv_track_t
         bool         b_no_duration;
         uint64_t     i_default_duration;
         float        f_timecodescale;
-        mtime_t      i_last_dts;
+        vlc_tick_t   i_last_dts;
         uint64_t     i_skip_until_fpos; /*< any block before this fpos should be ignored */
 
         /* video */
@@ -227,8 +227,8 @@ class mkv_track_t
         KaxContentCompSettings *p_compression_data;
 
         /* Matroska 4 new elements used by Opus */
-        mtime_t i_seek_preroll;
-        mtime_t i_codec_delay;
+        vlc_tick_t i_seek_preroll;
+        vlc_tick_t i_codec_delay;
 };
 
 
diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index b6a5bed820..850ff13432 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -162,7 +162,7 @@ block_t *MemToBlock( uint8_t *p_mem, size_t i_mem, size_t offset)
 }
 
 
-void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, mtime_t i_pts)
+void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, vlc_tick_t i_pts)
 {
     uint8_t * p_frame = p_blk->p_buffer;
     Cook_PrivateTrackData * p_sys = (Cook_PrivateTrackData *) p_tk->p_sys;
@@ -237,7 +237,7 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, m
     }
 }
 
-void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsigned int i_number_frames, mtime_t i_duration )
+void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsigned int i_number_frames, vlc_tick_t i_duration )
 {
     demux_sys_t *p_sys = (demux_sys_t *)p_demux->p_sys;
     matroska_segment_c *p_segment = p_sys->p_current_vsegment->CurrentSegment();
diff --git a/modules/demux/mkv/util.hpp b/modules/demux/mkv/util.hpp
index 780acaaf60..6e5e74f8f4 100644
--- a/modules/demux/mkv/util.hpp
+++ b/modules/demux/mkv/util.hpp
@@ -31,8 +31,8 @@ block_t *block_zlib_decompress( vlc_object_t *p_this, block_t *p_in_block );
 #endif
 
 block_t *MemToBlock( uint8_t *p_mem, size_t i_mem, size_t offset);
-void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, mtime_t i_pts);
-void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsigned int i_number_frames, mtime_t i_duration );
+void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, vlc_tick_t i_pts);
+void send_Block( demux_t * p_demux, mkv_track_t * p_tk, block_t * p_block, unsigned int i_number_frames, vlc_tick_t i_duration );
 
 
 struct real_audio_private
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index c9987bb3e8..3216853d13 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -221,7 +221,7 @@ virtual_edition_c::~virtual_edition_c()
 
 void virtual_edition_c::retimeSubChapters( virtual_chapter_c * p_vchap )
 {
-    mtime_t i_mk_stop_time = p_vchap->i_mk_virtual_stop_time;
+    vlc_tick_t i_mk_stop_time = p_vchap->i_mk_virtual_stop_time;
     for( size_t i = p_vchap->sub_vchapters.size(); i-- > 0; )
     {
         virtual_chapter_c * p_vsubchap = p_vchap->sub_vchapters[i];
@@ -509,7 +509,7 @@ bool virtual_chapter_c::EnterAndLeave( virtual_chapter_c *p_leaving_vchapter, bo
     return p_chapter->EnterAndLeave( p_leaving_vchapter->p_chapter, b_enter );
 }
 
-bool virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
+bool virtual_segment_c::Seek( demux_t & demuxer, vlc_tick_t i_mk_date,
                               virtual_chapter_c *p_vchapter, bool b_precise )
 {
     demux_sys_t *p_sys = (demux_sys_t *)demuxer.p_sys;
@@ -522,7 +522,7 @@ bool virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
 
     if ( p_vchapter != NULL )
     {
-        mtime_t i_mk_time_offset = p_vchapter->i_mk_virtual_start_time - ( ( p_vchapter->p_chapter )? p_vchapter->p_chapter->i_start_time : 0 );
+        vlc_tick_t i_mk_time_offset = p_vchapter->i_mk_virtual_start_time - ( ( p_vchapter->p_chapter )? p_vchapter->p_chapter->i_start_time : 0 );
         if (CurrentEdition()->b_ordered)
             p_sys->i_mk_chapter_time = p_vchapter->i_mk_virtual_start_time - p_vchapter->segment.i_mk_start_time - ( ( p_vchapter->p_chapter )? p_vchapter->p_chapter->i_start_time : 0 ) /* + VLC_TS_0 */;
         if ( p_vchapter->p_chapter && p_vchapter->i_seekpoint_num > 0 )
diff --git a/modules/demux/mkv/virtual_segment.hpp b/modules/demux/mkv/virtual_segment.hpp
index 53d297f2cb..c9a37cbf87 100644
--- a/modules/demux/mkv/virtual_segment.hpp
+++ b/modules/demux/mkv/virtual_segment.hpp
@@ -68,12 +68,12 @@ public:
         return ( itemA->i_mk_virtual_start_time < itemB->i_mk_virtual_start_time );
     }
 
-    bool ContainsTimestamp( mtime_t i_pts );
+    bool ContainsTimestamp( vlc_tick_t i_pts );
 
     matroska_segment_c  &segment;
     chapter_item_c      *p_chapter;
-    mtime_t             i_mk_virtual_start_time;
-    mtime_t             i_mk_virtual_stop_time;
+    vlc_tick_t          i_mk_virtual_start_time;
+    vlc_tick_t          i_mk_virtual_stop_time;
     int                 i_seekpoint_num;
     std::vector<virtual_chapter_c *> sub_vchapters;
 #ifdef MKV_DEBUG
@@ -98,7 +98,7 @@ public:
                                              const void *p_cookie, size_t i_cookie_size );
 
     bool                b_ordered;
-    mtime_t             i_duration;
+    vlc_tick_t          i_duration;
     chapter_edition_c   *p_edition;
     int                 i_seekpoint_num;
 
@@ -160,7 +160,7 @@ public:
     virtual_chapter_c * FindChapter( int64_t i_find_uid );
 
     bool UpdateCurrentToChapter( demux_t & demux );
-    bool Seek( demux_t & demuxer, mtime_t i_mk_date, virtual_chapter_c *p_vchapter, bool b_precise = true );
+    bool Seek( demux_t & demuxer, vlc_tick_t i_mk_date, virtual_chapter_c *p_vchapter, bool b_precise = true );
 private:
     void KeepTrackSelection( matroska_segment_c & old, matroska_segment_c & next );
 };
diff --git a/modules/demux/mp4/heif.c b/modules/demux/mp4/heif.c
index e7c415e3af..5de5415874 100644
--- a/modules/demux/mp4/heif.c
+++ b/modules/demux/mp4/heif.c
@@ -38,9 +38,9 @@ struct heif_private_t
 {
     MP4_Box_t *p_root;
     es_out_id_t *id;
-    mtime_t i_pcr;
-    mtime_t i_end_display_time;
-    mtime_t i_image_duration;
+    vlc_tick_t i_pcr;
+    vlc_tick_t i_end_display_time;
+    vlc_tick_t i_image_duration;
     bool b_seekpoint_changed;
     uint32_t i_seekpoint;
     input_title_t *p_title;
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 5982605c0a..b2c6ab353b 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -92,7 +92,7 @@ typedef struct
 {
     MP4_Box_t    *p_root;      /* container for the whole file */
 
-    mtime_t      i_pcr;
+    vlc_tick_t   i_pcr;
 
     uint64_t     i_moov_duration;
     uint64_t     i_duration;           /* Declared fragmented duration (movie time scale) */
@@ -133,7 +133,7 @@ typedef struct
     /* ASF in MP4 */
     asf_packet_sys_t asfpacketsys;
     uint64_t i_preroll;         /* foobar */
-    mtime_t i_preroll_start;
+    vlc_tick_t i_preroll_start;
 
     struct
     {
@@ -168,7 +168,7 @@ static void MP4_TrackClean( es_out_t *, mp4_track_t * );
 static void MP4_Block_Send( demux_t *, mp4_track_t *, block_t * );
 
 static void MP4_TrackSelect  ( demux_t *, mp4_track_t *, bool );
-static int  MP4_TrackSeek   ( demux_t *, mp4_track_t *, mtime_t );
+static int  MP4_TrackSeek   ( demux_t *, mp4_track_t *, vlc_tick_t );
 
 static uint64_t MP4_TrackGetPos    ( mp4_track_t * );
 static uint32_t MP4_TrackGetReadSize( mp4_track_t *, uint32_t * );
@@ -190,10 +190,10 @@ static int  ProbeIndex( demux_t *p_demux );
 
 static int FragCreateTrunIndex( demux_t *, MP4_Box_t *, MP4_Box_t *, stime_t );
 
-static int FragGetMoofBySidxIndex( demux_t *p_demux, mtime_t i_target_time,
-                                   uint64_t *pi_moof_pos, mtime_t *pi_sampletime );
-static int FragGetMoofByTfraIndex( demux_t *p_demux, const mtime_t i_target_time, unsigned i_track_ID,
-                                   uint64_t *pi_moof_pos, mtime_t *pi_sampletime );
+static int FragGetMoofBySidxIndex( demux_t *p_demux, vlc_tick_t i_target_time,
+                                   uint64_t *pi_moof_pos, vlc_tick_t *pi_sampletime );
+static int FragGetMoofByTfraIndex( demux_t *p_demux, const vlc_tick_t i_target_time, unsigned i_track_ID,
+                                   uint64_t *pi_moof_pos, vlc_tick_t *pi_sampletime );
 static void FragResetContext( demux_sys_t * );
 
 /* ASF Handlers */
@@ -389,7 +389,7 @@ static inline bool MP4_TrackGetPTSDelta( demux_t *p_demux, mp4_track_t *p_track,
     return false;
 }
 
-static inline mtime_t MP4_GetSamplesDuration( demux_t *p_demux, mp4_track_t *p_track,
+static inline vlc_tick_t MP4_GetSamplesDuration( demux_t *p_demux, mp4_track_t *p_track,
                                               unsigned i_nb_samples )
 {
     VLC_UNUSED( p_demux );
@@ -1260,8 +1260,8 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
         return VLC_DEMUXER_SUCCESS;
 
     uint32_t i_run_seq = MP4_TrackGetRunSeq( tk );
-    mtime_t i_current_nzdts = MP4_TrackGetDTS( p_demux, tk );
-    const mtime_t i_demux_max_nzdts =(i_max_preload < UINT_MAX)
+    vlc_tick_t i_current_nzdts = MP4_TrackGetDTS( p_demux, tk );
+    const vlc_tick_t i_demux_max_nzdts =(i_max_preload < UINT_MAX)
                                     ? i_current_nzdts + i_max_preload
                                     : INT64_MAX;
 
@@ -1374,7 +1374,7 @@ static int DemuxMoov( demux_t *p_demux )
         }
     }
 
-    const mtime_t i_nztime = MP4_GetMoviePTS( p_sys );
+    const vlc_tick_t i_nztime = MP4_GetMoviePTS( p_sys );
 
     /* We demux/set pcr, even without selected tracks, (empty edits, ...) */
     if( p_sys->i_pcr != VLC_TS_INVALID /* not after a seek */ )
@@ -1433,7 +1433,7 @@ static int DemuxMoov( demux_t *p_demux )
                     tk_tmp->i_sample >= tk_tmp->i_sample_count )
                     continue;
 
-                mtime_t i_nzdts = MP4_TrackGetDTS( p_demux, tk_tmp );
+                vlc_tick_t i_nzdts = MP4_TrackGetDTS( p_demux, tk_tmp );
                 if ( i_nzdts <= i_nztime + DEMUX_TRACK_MAX_PRELOAD )
                 {
                     /* Found a better candidate to avoid seeking */
@@ -1503,13 +1503,13 @@ static void MP4_UpdateSeekpoint( demux_t *p_demux, int64_t i_time )
 /*****************************************************************************
  * Seek: Go to i_date
 ******************************************************************************/
-static int Seek( demux_t *p_demux, mtime_t i_date, bool b_accurate )
+static int Seek( demux_t *p_demux, vlc_tick_t i_date, bool b_accurate )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     unsigned int i_track;
 
     /* Now for each stream try to go to this time */
-    mtime_t i_start = i_date;
+    vlc_tick_t i_start = i_date;
     for( i_track = 0; i_track < p_sys->i_tracks; i_track++ )
     {
         mp4_track_t *tk = &p_sys->track[i_track];
@@ -1519,7 +1519,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, bool b_accurate )
             continue;
         if( MP4_TrackSeek( p_demux, tk, i_date ) == VLC_SUCCESS )
         {
-            mtime_t i_seeked = MP4_TrackGetDTS( p_demux, tk );
+            vlc_tick_t i_seeked = MP4_TrackGetDTS( p_demux, tk );
             if( i_seeked < i_start )
                 i_start = i_seeked;
         }
@@ -1578,14 +1578,14 @@ static int FragPrepareChunk( demux_t *p_demux, MP4_Box_t *p_moof,
     return VLC_EGENERIC;
 }
 
-static mtime_t FragGetDemuxTimeFromTracksTime( demux_sys_t *p_sys )
+static vlc_tick_t FragGetDemuxTimeFromTracksTime( demux_sys_t *p_sys )
 {
-    mtime_t i_time = INT64_MAX;
+    vlc_tick_t i_time = INT64_MAX;
     for( unsigned int i = 0; i < p_sys->i_tracks; i++ )
     {
         if( p_sys->track[i].context.runs.i_count == 0 )
             continue;
-        mtime_t i_ttime = MP4_rescale( p_sys->track[i].i_time,
+        vlc_tick_t i_ttime = MP4_rescale( p_sys->track[i].i_time,
                                        p_sys->track[i].i_timescale, CLOCK_FREQ );
         i_time = __MIN( i_time, i_ttime );
     }
@@ -1709,13 +1709,13 @@ static void FragTrunSeekToTime( mp4_track_t *p_track, stime_t i_target_time )
     p_track->context.runs.i_current = i_run;
 }
 
-static int FragSeekToTime( demux_t *p_demux, mtime_t i_nztime, bool b_accurate )
+static int FragSeekToTime( demux_t *p_demux, vlc_tick_t i_nztime, bool b_accurate )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     uint64_t i64 = UINT64_MAX;
     uint32_t i_segment_type = ATOM_moof;
     stime_t  i_segment_time = INT64_MAX;
-    mtime_t i_sync_time = i_nztime;
+    vlc_tick_t i_sync_time = i_nztime;
     bool b_iframesync = false;
 
     const uint64_t i_duration = __MAX(p_sys->i_duration, p_sys->i_cumulated_duration);
@@ -1857,7 +1857,7 @@ static int FragSeekToPos( demux_t *p_demux, double f, bool b_accurate )
     if ( !p_sys->b_seekable || !p_sys->i_timescale || !i_duration )
         return VLC_EGENERIC;
 
-    return FragSeekToTime( p_demux, (mtime_t)( f *
+    return FragSeekToTime( p_demux, (vlc_tick_t)( f *
                            MP4_rescale( i_duration, p_sys->i_timescale, CLOCK_FREQ ) ), b_accurate );
 }
 
@@ -2611,7 +2611,7 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
      /* FIXME: refactor STTS & CTTS, STTS having now only few extra lines and
       *        differing in 2/2 fields and 1 signedness */
 
-    mtime_t i_next_dts = 0;
+    vlc_tick_t i_next_dts = 0;
     /* Find stts
      *  Gives mapping between sample and decoding time
      */
@@ -3255,7 +3255,7 @@ static void MP4_TrackRestart( demux_t *p_demux, mp4_track_t *p_track,
 
     /* Save previous fragmented pos */
     uint32_t i_sample_pos_backup = p_track->i_sample;
-    mtime_t time_backup = p_track->i_time;
+    vlc_tick_t time_backup = p_track->i_time;
     uint32_t timescale_backup = p_track->i_timescale;
 
     /* Save previous format and ES */
@@ -3653,7 +3653,7 @@ static void MP4_TrackSelect( demux_t *p_demux, mp4_track_t *p_track, bool b_sele
 }
 
 static int MP4_TrackSeek( demux_t *p_demux, mp4_track_t *p_track,
-                          mtime_t i_start )
+                          vlc_tick_t i_start )
 {
     uint32_t i_chunk;
     uint32_t i_sample;
@@ -4002,7 +4002,7 @@ static void MP4_TrackSetELST( demux_t *p_demux, mp4_track_t *tk,
 
         for( tk->i_elst = 0; (unsigned int)tk->i_elst < elst->i_entry_count; tk->i_elst++ )
         {
-            mtime_t i_dur = elst->i_segment_duration[tk->i_elst];
+            vlc_tick_t i_dur = elst->i_segment_duration[tk->i_elst];
 
             if( tk->i_elst_time <= i_mvt && i_mvt < tk->i_elst_time + i_dur )
             {
@@ -4460,7 +4460,7 @@ static int DemuxMoof( demux_t *p_demux )
 
     const unsigned i_max_preload = ( p_sys->b_fastseekable ) ? 0 : ( p_sys->b_seekable ) ? DEMUX_TRACK_MAX_PRELOAD : UINT_MAX;
 
-    const mtime_t i_nztime = MP4_GetMoviePTS( p_sys );
+    const vlc_tick_t i_nztime = MP4_GetMoviePTS( p_sys );
 
     /* !important! Ensure clock is set before sending data */
     if( p_sys->i_pcr == VLC_TS_INVALID )
@@ -4506,7 +4506,7 @@ static int DemuxMoof( demux_t *p_demux )
                     tk_tmp->context.runs.i_current >= tk_tmp->context.runs.i_count )
                     continue;
 
-                mtime_t i_nzdts = MP4_rescale( tk_tmp->i_time, tk_tmp->i_timescale, CLOCK_FREQ );
+                vlc_tick_t i_nzdts = MP4_rescale( tk_tmp->i_time, tk_tmp->i_timescale, CLOCK_FREQ );
                 if ( i_nzdts <= i_nztime + DEMUX_TRACK_MAX_PRELOAD )
                 {
                     /* Found a better candidate to avoid seeking */
@@ -4536,14 +4536,14 @@ static int DemuxMoof( demux_t *p_demux )
     }
     else
     {
-        mtime_t i_segment_end = INT64_MAX;
+        vlc_tick_t i_segment_end = INT64_MAX;
         for( unsigned i = 0; i < p_sys->i_tracks; i++ )
         {
             mp4_track_t *tk = &p_sys->track[i];
             if( tk->b_ok || tk->b_chapters_source ||
                (!tk->b_selected && !p_sys->b_seekable) )
                 continue;
-            mtime_t i_track_end = MP4_rescale( tk->i_time, tk->i_timescale, CLOCK_FREQ );
+            vlc_tick_t i_track_end = MP4_rescale( tk->i_time, tk->i_timescale, CLOCK_FREQ );
             if( i_track_end < i_segment_end  )
                 i_segment_end = i_track_end;
         }
@@ -4788,8 +4788,8 @@ static int FragCreateTrunIndex( demux_t *p_demux, MP4_Box_t *p_moof,
     return VLC_SUCCESS;
 }
 
-static int FragGetMoofBySidxIndex( demux_t *p_demux, mtime_t i_target_time,
-                                   uint64_t *pi_moof_pos, mtime_t *pi_sampletime )
+static int FragGetMoofBySidxIndex( demux_t *p_demux, vlc_tick_t i_target_time,
+                                   uint64_t *pi_moof_pos, vlc_tick_t *pi_sampletime )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     const MP4_Box_t *p_sidx = MP4_BoxGet( p_sys->p_root, "sidx" );
@@ -4817,8 +4817,8 @@ static int FragGetMoofBySidxIndex( demux_t *p_demux, mtime_t i_target_time,
     return VLC_EGENERIC;
 }
 
-static int FragGetMoofByTfraIndex( demux_t *p_demux, const mtime_t i_target_time, unsigned i_track_ID,
-                                   uint64_t *pi_moof_pos, mtime_t *pi_sampletime )
+static int FragGetMoofByTfraIndex( demux_t *p_demux, const vlc_tick_t i_target_time, unsigned i_track_ID,
+                                   uint64_t *pi_moof_pos, vlc_tick_t *pi_sampletime )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     MP4_Box_t *p_tfra = MP4_BoxGet( p_sys->p_root, "mfra/tfra" );
@@ -5068,11 +5068,11 @@ static int DemuxFrag( demux_t *p_demux )
 end:
     if( i_status == VLC_DEMUXER_EOF )
     {
-        mtime_t i_demux_end = INT64_MIN;
+        vlc_tick_t i_demux_end = INT64_MIN;
         for( unsigned i = 0; i < p_sys->i_tracks; i++ )
         {
             const mp4_track_t *tk = &p_sys->track[i];
-            mtime_t i_track_end = MP4_rescale( tk->i_time, tk->i_timescale, CLOCK_FREQ );
+            vlc_tick_t i_track_end = MP4_rescale( tk->i_time, tk->i_timescale, CLOCK_FREQ );
             if( i_track_end > i_demux_end  )
                 i_demux_end = i_track_end;
         }
diff --git a/modules/demux/mp4/mp4.h b/modules/demux/mp4/mp4.h
index d73b5a00bc..97f46dc801 100644
--- a/modules/demux/mp4/mp4.h
+++ b/modules/demux/mp4/mp4.h
@@ -169,8 +169,8 @@ typedef struct
 
     /* ASF packets handling */
     const MP4_Box_t *p_asf;
-    mtime_t          i_dts_backup;
-    mtime_t          i_pts_backup;
+    vlc_tick_t       i_dts_backup;
+    vlc_tick_t       i_pts_backup;
     asf_track_info_t asfinfo;
 } mp4_track_t;
 
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index 7d2e01ed65..9d7948c9a3 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -102,7 +102,7 @@ typedef struct
 
 typedef struct
 {
-    mtime_t i_time;
+    vlc_tick_t i_time;
     uint64_t i_pos;
     bs_t br;
 } sync_table_ctx_t;
@@ -130,8 +130,8 @@ typedef struct
     decoder_t   *p_packetizer;
     block_t     *p_packetized_data;
 
-    mtime_t     i_pts;
-    mtime_t     i_time_offset;
+    vlc_tick_t  i_pts;
+    vlc_tick_t  i_time_offset;
     int64_t     i_bytes;
 
     bool        b_big_endian;
@@ -181,7 +181,7 @@ static int ThdProbe( demux_t *p_demux, int64_t *pi_offset );
 static int MlpInit( demux_t *p_demux );
 
 static bool Parse( demux_t *p_demux, block_t **pp_output );
-static uint64_t SeekByMlltTable( demux_t *p_demux, mtime_t *pi_time );
+static uint64_t SeekByMlltTable( demux_t *p_demux, vlc_tick_t *pi_time );
 
 static const codec_t p_codecs[] = {
     { VLC_CODEC_MP4A, false, "mp4 audio",  AacProbe,  AacInit },
@@ -859,7 +859,7 @@ static double MpgaXingLameConvertPeak( uint32_t x )
     return x / 8388608.0; /* pow(2, 23) */
 }
 
-static uint64_t SeekByMlltTable( demux_t *p_demux, mtime_t *pi_time )
+static uint64_t SeekByMlltTable( demux_t *p_demux, vlc_tick_t *pi_time )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     sync_table_ctx_t *p_cur = &p_sys->mllt.current;
@@ -876,7 +876,7 @@ static uint64_t SeekByMlltTable( demux_t *p_demux, mtime_t *pi_time )
     {
         const uint32_t i_bytesdev = bs_read(&p_cur->br, p_sys->mllt.i_bits_per_bytes_dev);
         const uint32_t i_msdev = bs_read(&p_cur->br, p_sys->mllt.i_bits_per_ms_dev);
-        const mtime_t i_deltatime = (p_sys->mllt.i_ms_btw_refs + i_msdev) * INT64_C(1000);
+        const vlc_tick_t i_deltatime = (p_sys->mllt.i_ms_btw_refs + i_msdev) * INT64_C(1000);
         if( p_cur->i_time + i_deltatime > *pi_time )
             break;
         p_cur->i_time += i_deltatime;
diff --git a/modules/demux/mpeg/h26x.c b/modules/demux/mpeg/h26x.c
index 6c1c45951c..51fd365fc2 100644
--- a/modules/demux/mpeg/h26x.c
+++ b/modules/demux/mpeg/h26x.c
@@ -450,8 +450,8 @@ static int Demux( demux_t *p_demux)
 
             /* h264 packetizer does merge multiple NAL into AU, but slice flag persists */
             bool frame = p_block_out->i_flags & BLOCK_FLAG_TYPE_MASK;
-            const mtime_t i_frame_dts = p_block_out->i_dts;
-            const mtime_t i_frame_length = p_block_out->i_length;
+            const vlc_tick_t i_frame_dts = p_block_out->i_dts;
+            const vlc_tick_t i_frame_length = p_block_out->i_length;
             es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
             if( frame )
             {
diff --git a/modules/demux/mpeg/mpeg4_iod.c b/modules/demux/mpeg/mpeg4_iod.c
index a7a57d54fc..cc24218ed0 100644
--- a/modules/demux/mpeg/mpeg4_iod.c
+++ b/modules/demux/mpeg/mpeg4_iod.c
@@ -563,7 +563,7 @@ sl_header_data DecodeSLHeader( unsigned i_data, const uint8_t *p_data,
         struct
         {
             bool *p_b;
-            mtime_t *p_t;
+            vlc_tick_t *p_t;
         } const timestamps[2] = { { &b_has_dts, &ret.i_dts }, { &b_has_cts, &ret.i_pts } };
 
         bs_read( &s, sl->i_packet_seqnum_length );
diff --git a/modules/demux/mpeg/mpeg4_iod.h b/modules/demux/mpeg/mpeg4_iod.h
index 2ae91fd14e..9b57a51a83 100644
--- a/modules/demux/mpeg/mpeg4_iod.h
+++ b/modules/demux/mpeg/mpeg4_iod.h
@@ -59,8 +59,8 @@ typedef struct
     unsigned i_size;
     bool b_au_start;
     bool b_au_end;
-    mtime_t i_dts;
-    mtime_t i_pts;
+    vlc_tick_t i_dts;
+    vlc_tick_t i_pts;
 } sl_header_data;
 
 typedef struct es_mpeg4_descriptor_t es_mpeg4_descriptor_t;
diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index f254102e5d..07e3ea4417 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -216,7 +216,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_force )
     p_sys->i_scr = -1;
     p_sys->i_scr_track_id = 0;
     p_sys->i_length   = i_length;
-    p_sys->i_current_pts = (mtime_t) 0;
+    p_sys->i_current_pts = (vlc_tick_t) 0;
     p_sys->i_time_track_index = -1;
     p_sys->i_aob_mlp_count = 0;
     p_sys->i_start_byte = i_skip;
@@ -399,7 +399,7 @@ static void NotifyDiscontinuity( ps_track_t *p_tk, es_out_t *out )
     }
 }
 
-static void CheckPCR( demux_sys_t *p_sys, es_out_t *out, mtime_t i_scr )
+static void CheckPCR( demux_sys_t *p_sys, es_out_t *out, vlc_tick_t i_scr )
 {
     if( p_sys->i_scr != VLC_TS_INVALID &&
         llabs( p_sys->i_scr - i_scr ) > CLOCK_FREQ )
diff --git a/modules/demux/mpeg/ps.h b/modules/demux/mpeg/ps.h
index d0e7c5f9ab..5e0a9babeb 100644
--- a/modules/demux/mpeg/ps.h
+++ b/modules/demux/mpeg/ps.h
@@ -61,8 +61,8 @@ typedef struct
     int         i_next_block_flags;
     es_out_id_t *es;
     es_format_t fmt;
-    mtime_t     i_first_pts;
-    mtime_t     i_last_pts;
+    vlc_tick_t  i_first_pts;
+    vlc_tick_t  i_last_pts;
 
 } ps_track_t;
 
@@ -493,8 +493,8 @@ static inline int ps_pkt_parse_system( block_t *p_pkt, ps_psm_t *p_psm,
 static inline int ps_pkt_parse_pes( vlc_object_t *p_object, block_t *p_pes, int i_skip_extra )
 {
     unsigned int i_skip  = 0;
-    mtime_t i_pts = -1;
-    mtime_t i_dts = -1;
+    vlc_tick_t i_pts = -1;
+    vlc_tick_t i_dts = -1;
     uint8_t i_stream_id = 0;
     bool b_pes_scrambling = false;
 
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index a3b2188c64..70e724cc28 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -1461,7 +1461,7 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
     unsigned i_skip = 0;
     stime_t i_dts = -1;
     stime_t i_pts = -1;
-    mtime_t i_length = 0;
+    vlc_tick_t i_length = 0;
     uint8_t i_stream_id;
     bool b_pes_scrambling = false;
     const es_mpeg4_descriptor_t *p_mpeg4desc = NULL;
@@ -2171,7 +2171,7 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, stime_t i_pcr )
        PCR barrier, and then adapt pcr so they have valid PCR when dequeuing */
     if( p_pmt->pcr.i_current == -1 && p_pmt->pcr.b_fix_done )
     {
-        mtime_t i_mindts = VLC_TS_INVALID;
+        vlc_tick_t i_mindts = VLC_TS_INVALID;
 
         ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
         for( int i=0; i< p_pat->programs.i_size; i++ )
diff --git a/modules/demux/mpeg/ts_scte.c b/modules/demux/mpeg/ts_scte.c
index ed854bde5c..3a07787c22 100644
--- a/modules/demux/mpeg/ts_scte.c
+++ b/modules/demux/mpeg/ts_scte.c
@@ -81,7 +81,7 @@ void SCTE27_Section_Callback( demux_t *p_demux,
     ts_stream_t *p_pes = (ts_stream_t *) p_pes_cb_data;
     assert( p_pes->p_es->fmt.i_codec == VLC_CODEC_SCTE_27 );
     ts_pmt_t *p_pmt = p_pes->p_es->p_program;
-    mtime_t i_date = p_pmt->pcr.i_current;
+    vlc_tick_t i_date = p_pmt->pcr.i_current;
 
     block_t *p_content = block_Alloc( i_sectiondata );
     if( unlikely(!p_content) || unlikely(!p_pes->p_es->id) )
@@ -102,7 +102,7 @@ void SCTE27_Section_Callback( demux_t *p_demux,
         bool is_immediate = p_content->p_buffer[i_offset + 3] & 0x40;
         if( !is_immediate )
         {
-            mtime_t i_display_in = GetDWBE( &p_content->p_buffer[i_offset + 4] );
+            vlc_tick_t i_display_in = GetDWBE( &p_content->p_buffer[i_offset + 4] );
             if( i_display_in < i_date )
                 i_date = i_display_in + (1ll << 32);
             else
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 181cc78ef9..07ec79bfb6 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -277,11 +277,11 @@ static void Close( vlc_object_t *p_this )
     free( p_sys );
 }
 
-static mtime_t Ogg_GetLastDTS( demux_t * p_demux )
+static vlc_tick_t Ogg_GetLastDTS( demux_t * p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    mtime_t i_dts = VLC_TS_INVALID;
+    vlc_tick_t i_dts = VLC_TS_INVALID;
     for( int i_stream = 0; i_stream < p_sys->i_streams; i_stream++ )
     {
         logical_stream_t *p_stream = p_sys->pp_stream[i_stream];
@@ -294,13 +294,13 @@ static mtime_t Ogg_GetLastDTS( demux_t * p_demux )
     return i_dts;
 }
 
-static mtime_t Ogg_GeneratePCR( demux_t * p_demux, bool b_drain )
+static vlc_tick_t Ogg_GeneratePCR( demux_t * p_demux, bool b_drain )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     /* We will consider the lowest PCR among tracks, because the audio core badly
      * handles PCR rewind (mute)
      */
-    mtime_t i_pcr_candidate = VLC_TS_INVALID;
+    vlc_tick_t i_pcr_candidate = VLC_TS_INVALID;
     for( int i_stream = 0; i_stream < p_sys->i_streams; i_stream++ )
     {
         logical_stream_t *p_stream = p_sys->pp_stream[i_stream];
@@ -325,7 +325,7 @@ static mtime_t Ogg_GeneratePCR( demux_t * p_demux, bool b_drain )
 static void Ogg_OutputQueues( demux_t *p_demux, bool b_drain )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    mtime_t i_pcr;
+    vlc_tick_t i_pcr;
 
     /* Generate First PCR */
     if( p_sys->i_pcr == VLC_TS_INVALID )
@@ -393,7 +393,7 @@ static int Demux( demux_t * p_demux )
 
             Ogg_OutputQueues( p_demux, true );
 
-            mtime_t i_lastdts = Ogg_GetLastDTS( p_demux );
+            vlc_tick_t i_lastdts = Ogg_GetLastDTS( p_demux );
 
             /* We keep the ES to try reusing it in Ogg_BeginningOfStream
              * only 1 ES is supported (common case for ogg web radio) */
@@ -925,7 +925,7 @@ static void Ogg_SetNextFrame( demux_t *p_demux, logical_stream_t *p_stream,
 
     if( Ogg_GranuleIsValid( p_stream, i_granule ) )
     {
-        mtime_t i_endtime = Ogg_GranuleToTime( p_stream, i_granule, false, false );
+        vlc_tick_t i_endtime = Ogg_GranuleToTime( p_stream, i_granule, false, false );
         assert( !p_stream->b_contiguous || i_endtime != VLC_TS_INVALID );
         if( i_endtime != VLC_TS_INVALID )
         {
@@ -982,9 +982,9 @@ static void Ogg_SetNextFrame( demux_t *p_demux, logical_stream_t *p_stream,
     }
 }
 
-static mtime_t Ogg_FixupOutputQueue( demux_t *p_demux, logical_stream_t *p_stream )
+static vlc_tick_t Ogg_FixupOutputQueue( demux_t *p_demux, logical_stream_t *p_stream )
 {
-    mtime_t i_enddts = VLC_TS_INVALID;
+    vlc_tick_t i_enddts = VLC_TS_INVALID;
 
 #ifdef HAVE_LIBVORBIS
     long i_prev_blocksize = 0;
@@ -1337,8 +1337,8 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         p_stream->b_initializing = false;
     }
 
-    mtime_t i_dts = Ogg_GranuleToTime( p_stream, p_oggpacket->granulepos, true, false );
-    mtime_t i_expected_dts = date_Get( &p_stream->dts ); /* Interpolated or previous end time */
+    vlc_tick_t i_dts = Ogg_GranuleToTime( p_stream, p_oggpacket->granulepos, true, false );
+    vlc_tick_t i_expected_dts = date_Get( &p_stream->dts ); /* Interpolated or previous end time */
     if( i_dts == VLC_TS_INVALID )
         i_dts = i_expected_dts;
     else
@@ -1355,7 +1355,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
          * but we did need to store its pcr as it might be selected later on */
         if( !b_header && !p_stream->b_initializing )
         {
-            mtime_t i_pcr = date_Get( &p_stream->dts );
+            vlc_tick_t i_pcr = date_Get( &p_stream->dts );
             if( i_pcr != VLC_TS_INVALID )
                 p_stream->i_pcr = p_sys->i_nzpcr_offset + i_pcr;
         }
@@ -1372,7 +1372,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
     /* Vorbis and Opus can trim the end of a stream using granule positions. */
     if( p_oggpacket->e_o_s )
     {
-        mtime_t i_endtime = Ogg_GranuleToTime( p_stream, p_oggpacket->granulepos, false, false );
+        vlc_tick_t i_endtime = Ogg_GranuleToTime( p_stream, p_oggpacket->granulepos, false, false );
         if( i_endtime != VLC_TS_INVALID && i_expected_dts != VLC_TS_INVALID )
         {
                 p_block->i_length = i_endtime - i_expected_dts;
@@ -1453,7 +1453,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
                   p_oggpacket->packet[i_header_len + 1] != '\n' &&
                   p_oggpacket->packet[i_header_len + 1] != '\r' ) )
             {
-                p_block->i_length = (mtime_t)lenbytes * 1000;
+                p_block->i_length = (vlc_tick_t)lenbytes * 1000;
             }
         }
 
@@ -3245,7 +3245,7 @@ static void Ogg_ApplySkeleton( logical_stream_t *p_stream )
 }
 
 /* Return true if there's a skeleton exact match */
-bool Ogg_GetBoundsUsingSkeletonIndex( logical_stream_t *p_stream, mtime_t i_time,
+bool Ogg_GetBoundsUsingSkeletonIndex( logical_stream_t *p_stream, vlc_tick_t i_time,
                                       int64_t *pi_lower, int64_t *pi_upper )
 {
     if ( !p_stream || !p_stream->p_skel || !p_stream->p_skel->p_index ||
diff --git a/modules/demux/ogg.h b/modules/demux/ogg.h
index 4517eabb17..b9c95c3afe 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -48,7 +48,7 @@ typedef struct ogg_skeleton_t ogg_skeleton_t;
 typedef struct backup_queue
 {
     block_t *p_block;
-    mtime_t i_duration;
+    vlc_tick_t i_duration;
 } backup_queue_t;
 
 typedef struct logical_stream_s
@@ -75,7 +75,7 @@ typedef struct logical_stream_s
 
     /* program clock reference (in units of 90kHz) derived from the previous
      * granulepos */
-    mtime_t          i_pcr;
+    vlc_tick_t       i_pcr;
 
     /* Misc */
     bool b_initializing;
@@ -171,8 +171,8 @@ typedef struct
 
     /* program clock reference (in units of 90kHz) derived from the pcr of
      * the sub-streams */
-    mtime_t i_pcr;
-    mtime_t i_nzpcr_offset;
+    vlc_tick_t i_pcr;
+    vlc_tick_t i_nzpcr_offset;
 
     /* new stream or starting from a chain */
     bool b_chained_boundary;
@@ -229,5 +229,5 @@ typedef struct
 unsigned const char * Read7BitsVariableLE( unsigned const char *,
                                            unsigned const char *,
                                            uint64_t * );
-bool Ogg_GetBoundsUsingSkeletonIndex( logical_stream_t *p_stream, mtime_t i_time,
+bool Ogg_GetBoundsUsingSkeletonIndex( logical_stream_t *p_stream, vlc_tick_t i_time,
                                       int64_t *pi_lower, int64_t *pi_upper );
diff --git a/modules/demux/ogg_granule.c b/modules/demux/ogg_granule.c
index e29dcfed42..19dd9ac303 100644
--- a/modules/demux/ogg_granule.c
+++ b/modules/demux/ogg_granule.c
@@ -162,7 +162,7 @@ static int64_t Ogg_ShiftPacketSample( const logical_stream_t *p_stream,
     return i_sample;
 }
 
-mtime_t Ogg_SampleToTime( const logical_stream_t *p_stream, int64_t i_sample, bool b_start )
+vlc_tick_t Ogg_SampleToTime( const logical_stream_t *p_stream, int64_t i_sample, bool b_start )
 {
     i_sample = Ogg_ShiftPacketSample( p_stream, i_sample, b_start );
     if( i_sample < 0 )
@@ -179,7 +179,7 @@ bool Ogg_GranuleIsValid( const logical_stream_t *p_stream, int64_t i_granule )
     return !( i_granule < 1 - !!p_stream->b_oggds );
 }
 
-mtime_t Ogg_GranuleToTime( const logical_stream_t *p_stream, int64_t i_granule,
+vlc_tick_t Ogg_GranuleToTime( const logical_stream_t *p_stream, int64_t i_granule,
                            bool b_start, bool b_pts )
 {
     if( !Ogg_GranuleIsValid( p_stream, i_granule ) )
diff --git a/modules/demux/ogg_granule.h b/modules/demux/ogg_granule.h
index 2bdf409e29..5d4f0e1dd3 100644
--- a/modules/demux/ogg_granule.h
+++ b/modules/demux/ogg_granule.h
@@ -20,8 +20,8 @@
 
 int64_t Ogg_GetKeyframeGranule ( const logical_stream_t *, int64_t i_granule );
 bool    Ogg_IsKeyFrame ( const logical_stream_t *, const ogg_packet * );
-mtime_t Ogg_GranuleToTime( const logical_stream_t *, int64_t i_granule,
+vlc_tick_t Ogg_GranuleToTime( const logical_stream_t *, int64_t i_granule,
                            bool b_packetstart, bool b_pts );
-mtime_t Ogg_SampleToTime( const logical_stream_t *, int64_t i_sample,
+vlc_tick_t Ogg_SampleToTime( const logical_stream_t *, int64_t i_sample,
                           bool b_packetstart );
 bool    Ogg_GranuleIsValid( const logical_stream_t *, int64_t i_granule );
diff --git a/modules/demux/oggseek.c b/modules/demux/oggseek.c
index 3e774c79ea..f84e843c84 100644
--- a/modules/demux/oggseek.c
+++ b/modules/demux/oggseek.c
@@ -89,7 +89,7 @@ static demux_index_entry_t *index_entry_new( void )
 /* We insert into index, sorting by pagepos (as a page can match multiple
    time stamps) */
 const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *p_stream,
-                                             mtime_t i_timestamp,
+                                             vlc_tick_t i_timestamp,
                                              int64_t i_pagepos )
 {
     demux_index_entry_t *idx;
@@ -144,7 +144,7 @@ const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *p_stream,
     return idx;
 }
 
-static bool OggSeekIndexFind ( logical_stream_t *p_stream, mtime_t i_timestamp,
+static bool OggSeekIndexFind ( logical_stream_t *p_stream, vlc_tick_t i_timestamp,
                                int64_t *pi_pos_lower, int64_t *pi_pos_upper )
 {
     demux_index_entry_t *idx = p_stream->idx;
@@ -627,7 +627,7 @@ restart:
 
 /* returns pos */
 static int64_t OggBisectSearchByTime( demux_t *p_demux, logical_stream_t *p_stream,
-            mtime_t i_targettime, int64_t i_pos_lower, int64_t i_pos_upper)
+            vlc_tick_t i_targettime, int64_t i_pos_lower, int64_t i_pos_upper)
 {
     int64_t i_start_pos;
     int64_t i_end_pos;
@@ -636,7 +636,7 @@ static int64_t OggBisectSearchByTime( demux_t *p_demux, logical_stream_t *p_stre
     struct
     {
         int64_t i_pos;
-        mtime_t i_timestamp;
+        vlc_tick_t i_timestamp;
         int64_t i_granule;
     } bestlower = { p_stream->i_data_start, VLC_TS_INVALID, -1 },
       current = { -1, VLC_TS_INVALID, -1 },
@@ -772,7 +772,7 @@ static int64_t OggBisectSearchByTime( demux_t *p_demux, logical_stream_t *p_stre
  *************************************************************************/
 
 int Oggseek_BlindSeektoAbsoluteTime( demux_t *p_demux, logical_stream_t *p_stream,
-                                     mtime_t i_time, bool b_fastseek )
+                                     vlc_tick_t i_time, bool b_fastseek )
 {
     demux_sys_t *p_sys  = p_demux->p_sys;
     int64_t i_lowerpos = -1;
@@ -868,7 +868,7 @@ int Oggseek_BlindSeektoPosition( demux_t *p_demux, logical_stream_t *p_stream,
 }
 
 int Oggseek_SeektoAbsolutetime( demux_t *p_demux, logical_stream_t *p_stream,
-                                mtime_t i_time )
+                                vlc_tick_t i_time )
 {
     demux_sys_t *p_sys  = p_demux->p_sys;
 
diff --git a/modules/demux/oggseek.h b/modules/demux/oggseek.h
index 93755555ee..a9cd1b0eff 100644
--- a/modules/demux/oggseek.h
+++ b/modules/demux/oggseek.h
@@ -51,17 +51,17 @@ struct oggseek_index_entry
     demux_index_entry_t *p_prev;
 
     /* value is highest granulepos for theora, sync frame for dirac */
-    mtime_t i_value;
+    vlc_tick_t i_value;
     int64_t i_pagepos;
 
     /* not used for theora because the granulepos tells us this */
     int64_t i_pagepos_end;
 };
 
-int     Oggseek_BlindSeektoAbsoluteTime ( demux_t *, logical_stream_t *, mtime_t, bool );
+int     Oggseek_BlindSeektoAbsoluteTime ( demux_t *, logical_stream_t *, vlc_tick_t, bool );
 int     Oggseek_BlindSeektoPosition ( demux_t *, logical_stream_t *, double f, bool );
-int     Oggseek_SeektoAbsolutetime ( demux_t *, logical_stream_t *, mtime_t );
-const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *, mtime_t, int64_t );
+int     Oggseek_SeektoAbsolutetime ( demux_t *, logical_stream_t *, vlc_tick_t );
+const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *, vlc_tick_t, int64_t );
 void    Oggseek_ProbeEnd( demux_t * );
 
 void oggseek_index_entries_free ( demux_index_entry_t * );
diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index 9c351773d1..7e30438882 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -50,7 +50,7 @@
  *****************************************************************************/
 static int ReadDir( stream_t *, input_item_node_t * );
 
-static bool ParseTime(xml_reader_t *p_xml_reader, mtime_t* pi_result )
+static bool ParseTime(xml_reader_t *p_xml_reader, vlc_tick_t* pi_result )
 {
     assert( pi_result );
     char *psz_value = NULL;
@@ -62,7 +62,7 @@ static bool ParseTime(xml_reader_t *p_xml_reader, mtime_t* pi_result )
     int i_subfractions = -1;
 
     int i_subresult = 0;
-    mtime_t i_result = 0;
+    vlc_tick_t i_result = 0;
 
     do
     {
@@ -202,8 +202,8 @@ static void ProcessEntry( int *pi_n_entry, xml_reader_t *p_xml_reader,
     input_item_t *p_entry = NULL;
 
     int i_options;
-    mtime_t i_start = 0;
-    mtime_t i_duration = 0;
+    vlc_tick_t i_start = 0;
+    vlc_tick_t i_duration = 0;
     char *ppsz_options[2];
 
     do
diff --git a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
index 30c94f1b14..449876f2d0 100644
--- a/modules/demux/playlist/itml.c
+++ b/modules/demux/playlist/itml.c
@@ -389,7 +389,7 @@ static bool save_data( track_elem_t *p_track, const char *psz_name,
     else if( !strcmp( psz_name, "Total Time" ) )
     {
         long i_num = atol( psz_value );
-        p_track->duration = (mtime_t) i_num*1000;
+        p_track->duration = (vlc_tick_t) i_num*1000;
     }
 #undef SAVE_INFO
     return true;
diff --git a/modules/demux/playlist/itml.h b/modules/demux/playlist/itml.h
index e09c8e4288..38ef1d3d56 100644
--- a/modules/demux/playlist/itml.h
+++ b/modules/demux/playlist/itml.h
@@ -45,7 +45,7 @@
 typedef struct
 {
     char *name, *artist, *album, *genre, *trackNum, *location;
-    mtime_t duration;
+    vlc_tick_t duration;
 } track_elem_t;
 
 struct xml_elem_hnd
diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index 4e8b954d06..d89bd657ce 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -218,7 +218,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
     char       *psz_artist = NULL;
     char       *psz_album_art = NULL;
     int        i_parsed_duration = 0;
-    mtime_t    i_duration = -1;
+    vlc_tick_t  i_duration = -1;
     const char**ppsz_options = NULL;
     char *    (*pf_dup) (const char *) = p_demux->p_sys;
     int        i_options = 0;
diff --git a/modules/demux/playlist/podcast.c b/modules/demux/playlist/podcast.c
index a4b9c29999..8dc47c3721 100644
--- a/modules/demux/playlist/podcast.c
+++ b/modules/demux/playlist/podcast.c
@@ -39,7 +39,7 @@
  * Local prototypes
  *****************************************************************************/
 static int ReadDir( stream_t *, input_item_node_t * );
-static mtime_t strTimeToMTime( const char *psz );
+static vlc_tick_t strTimeToMTime( const char *psz );
 
 /*****************************************************************************
  * Import_podcast: main import function
@@ -375,15 +375,15 @@ error:
     return VLC_EGENERIC;
 }
 
-static mtime_t strTimeToMTime( const char *psz )
+static vlc_tick_t strTimeToMTime( const char *psz )
 {
     int h, m, s;
     switch( sscanf( psz, "%u:%u:%u", &h, &m, &s ) )
     {
     case 3:
-        return (mtime_t)( ( h*60 + m )*60 + s ) * CLOCK_FREQ;
+        return (vlc_tick_t)( ( h*60 + m )*60 + s ) * CLOCK_FREQ;
     case 2:
-        return (mtime_t)( h*60 + m ) * CLOCK_FREQ;
+        return (vlc_tick_t)( h*60 + m ) * CLOCK_FREQ;
     default:
         return -1;
     }
diff --git a/modules/demux/playlist/ram.c b/modules/demux/playlist/ram.c
index 1204d3f3ba..8f80715016 100644
--- a/modules/demux/playlist/ram.c
+++ b/modules/demux/playlist/ram.c
@@ -202,7 +202,7 @@ static int ReadDir( stream_t *p_demux, input_item_node_t *p_subitems )
     char       *psz_line;
     char       *psz_artist = NULL, *psz_album = NULL, *psz_genre = NULL, *psz_year = NULL;
     char       *psz_author = NULL, *psz_title = NULL, *psz_copyright = NULL, *psz_cdnum = NULL, *psz_comments = NULL;
-    mtime_t    i_duration = -1;
+    vlc_tick_t  i_duration = -1;
     const char **ppsz_options = NULL;
     int        i_options = 0, i_start = 0, i_stop = 0;
     bool b_cleanup = false;
diff --git a/modules/demux/playlist/sgimb.c b/modules/demux/playlist/sgimb.c
index 4153f41944..06a1ef1d4c 100644
--- a/modules/demux/playlist/sgimb.c
+++ b/modules/demux/playlist/sgimb.c
@@ -122,7 +122,7 @@ typedef struct
     char        *psz_mcast_ip;  /* sgiMulticastAddress= */
     int         i_mcast_port;   /* sgiMulticastPort= */
     int         i_packet_size;  /* sgiPacketSize= */
-    mtime_t     i_duration;     /* sgiDuration= */
+    vlc_tick_t  i_duration;     /* sgiDuration= */
     int         i_port;         /* sgiRtspPort= */
     int         i_sid;          /* sgiSid= */
     bool  b_concert;      /* DeliveryService=cds */
@@ -294,7 +294,7 @@ static int ParseLine ( stream_t *p_demux, char *psz_line )
     else if( !strncasecmp( psz_bol, "sgiDuration=", sizeof("sgiDuration=") - 1 ) )
     {
         psz_bol += sizeof("sgiDuration=") - 1;
-        p_sys->i_duration = (mtime_t) strtol( psz_bol, NULL, 0 );
+        p_sys->i_duration = (vlc_tick_t) strtol( psz_bol, NULL, 0 );
     }
     else if( !strncasecmp( psz_bol, "sgiRtspPort=", sizeof("sgiRtspPort=") - 1 ) )
     {
diff --git a/modules/demux/pva.c b/modules/demux/pva.c
index fac8ff4dfd..fd1c4fe068 100644
--- a/modules/demux/pva.c
+++ b/modules/demux/pva.c
@@ -398,8 +398,8 @@ static void ParsePES( demux_t *p_demux )
     uint8_t     hdr[30];
 
     unsigned    i_skip;
-    mtime_t     i_dts = -1;
-    mtime_t     i_pts = -1;
+    vlc_tick_t  i_dts = -1;
+    vlc_tick_t  i_pts = -1;
 
     p_sys->p_pes = NULL;
 
@@ -421,19 +421,19 @@ static void ParsePES( demux_t *p_demux )
     i_skip = hdr[8] + 9;
     if( hdr[7]&0x80 )    /* has pts */
     {
-        i_pts = ((mtime_t)(hdr[ 9]&0x0e ) << 29)|
-                 (mtime_t)(hdr[10] << 22)|
-                ((mtime_t)(hdr[11]&0xfe) << 14)|
-                 (mtime_t)(hdr[12] << 7)|
-                 (mtime_t)(hdr[12] >> 1);
+        i_pts = ((vlc_tick_t)(hdr[ 9]&0x0e ) << 29)|
+                 (vlc_tick_t)(hdr[10] << 22)|
+                ((vlc_tick_t)(hdr[11]&0xfe) << 14)|
+                 (vlc_tick_t)(hdr[12] << 7)|
+                 (vlc_tick_t)(hdr[12] >> 1);
 
         if( hdr[7]&0x40 )    /* has dts */
         {
-             i_dts = ((mtime_t)(hdr[14]&0x0e ) << 29)|
-                     (mtime_t)(hdr[15] << 22)|
-                    ((mtime_t)(hdr[16]&0xfe) << 14)|
-                     (mtime_t)(hdr[17] << 7)|
-                     (mtime_t)(hdr[18] >> 1);
+             i_dts = ((vlc_tick_t)(hdr[14]&0x0e ) << 29)|
+                     (vlc_tick_t)(hdr[15] << 22)|
+                    ((vlc_tick_t)(hdr[16]&0xfe) << 14)|
+                     (vlc_tick_t)(hdr[17] << 7)|
+                     (vlc_tick_t)(hdr[18] >> 1);
         }
     }
 
diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c
index ab482e702e..d91311f47e 100644
--- a/modules/demux/rawdv.c
+++ b/modules/demux/rawdv.c
@@ -108,7 +108,7 @@ typedef struct
     int    i_bitrate;
 
     /* program clock reference (in units of 90kHz) */
-    mtime_t i_pcr;
+    vlc_tick_t i_pcr;
     bool b_hurry_up;
 } demux_sys_t;
 
diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c
index be49f680de..9dfa9b0d23 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -392,7 +392,7 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys  = p_demux->p_sys;
     block_t     *p_block;
-    mtime_t i_pcr = date_Get( &p_sys->pcr );
+    vlc_tick_t i_pcr = date_Get( &p_sys->pcr );
 
     /* Call the pace control */
     es_out_SetPCR( p_demux->out, i_pcr );
diff --git a/modules/demux/real.c b/modules/demux/real.c
index 3544cabe8b..9280c3c855 100644
--- a/modules/demux/real.c
+++ b/modules/demux/real.c
@@ -102,12 +102,12 @@ typedef struct
     int         i_subpacket;
     int         i_subpackets;
     block_t     **p_subpackets;
-    mtime_t     *p_subpackets_timecode;
+    vlc_tick_t  *p_subpackets_timecode;
     int         i_out_subpacket;
 
     block_t     *p_sipr_packet;
     int         i_sipr_subpacket_count;
-    mtime_t     i_last_dts;
+    vlc_tick_t  i_last_dts;
 } real_track_t;
 
 typedef struct
@@ -153,11 +153,11 @@ static int Demux( demux_t * );
 static int Control( demux_t *, int i_query, va_list args );
 
 
-static void DemuxVideo( demux_t *, real_track_t *tk, mtime_t i_dts, unsigned i_flags );
-static void DemuxAudio( demux_t *, real_track_t *tk, mtime_t i_pts, unsigned i_flags );
+static void DemuxVideo( demux_t *, real_track_t *tk, vlc_tick_t i_dts, unsigned i_flags );
+static void DemuxAudio( demux_t *, real_track_t *tk, vlc_tick_t i_pts, unsigned i_flags );
 
 static int ControlSeekByte( demux_t *, int64_t i_bytes );
-static int ControlSeekTime( demux_t *, mtime_t i_time );
+static int ControlSeekTime( demux_t *, vlc_tick_t i_time );
 
 static int HeaderRead( demux_t *p_demux );
 static int CodecParse( demux_t *p_demux, int i_len, int i_num );
@@ -343,7 +343,7 @@ static int Demux( demux_t *p_demux )
     }
 
     /* Update PCR */
-    mtime_t i_pcr = VLC_TS_INVALID;
+    vlc_tick_t i_pcr = VLC_TS_INVALID;
     for( int i = 0; i < p_sys->i_track; i++ )
     {
         tk = p_sys->track[i];
@@ -502,7 +502,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 /*****************************************************************************
  * Helpers: demux
  *****************************************************************************/
-static void CheckPcr( demux_t *p_demux, real_track_t *tk, mtime_t i_dts )
+static void CheckPcr( demux_t *p_demux, real_track_t *tk, vlc_tick_t i_dts )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
@@ -516,7 +516,7 @@ static void CheckPcr( demux_t *p_demux, real_track_t *tk, mtime_t i_dts )
     es_out_SetPCR( p_demux->out, p_sys->i_pcr );
 }
 
-static void DemuxVideo( demux_t *p_demux, real_track_t *tk, mtime_t i_dts, unsigned i_flags )
+static void DemuxVideo( demux_t *p_demux, real_track_t *tk, vlc_tick_t i_dts, unsigned i_flags )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
@@ -636,7 +636,7 @@ static void DemuxVideo( demux_t *p_demux, real_track_t *tk, mtime_t i_dts, unsig
     }
 }
 
-static void DemuxAudioMethod1( demux_t *p_demux, real_track_t *tk, mtime_t i_pts, unsigned int i_flags )
+static void DemuxAudioMethod1( demux_t *p_demux, real_track_t *tk, vlc_tick_t i_pts, unsigned int i_flags )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     uint8_t *p_buf = p_sys->buffer;
@@ -753,7 +753,7 @@ static void DemuxAudioMethod1( demux_t *p_demux, real_track_t *tk, mtime_t i_pts
     }
 }
 
-static void DemuxAudioMethod2( demux_t *p_demux, real_track_t *tk, mtime_t i_pts )
+static void DemuxAudioMethod2( demux_t *p_demux, real_track_t *tk, vlc_tick_t i_pts )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
@@ -786,7 +786,7 @@ static void DemuxAudioMethod2( demux_t *p_demux, real_track_t *tk, mtime_t i_pts
         es_out_Send( p_demux->out, tk->p_es, p_block );
     }
 }
-static void DemuxAudioMethod3( demux_t *p_demux, real_track_t *tk, mtime_t i_pts )
+static void DemuxAudioMethod3( demux_t *p_demux, real_track_t *tk, vlc_tick_t i_pts )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
@@ -859,7 +859,7 @@ static void SiprPacketReorder(uint8_t *buf, int sub_packet_h, int framesize)
     }
 }
 
-static void DemuxAudioSipr( demux_t *p_demux, real_track_t *tk, mtime_t i_pts )
+static void DemuxAudioSipr( demux_t *p_demux, real_track_t *tk, vlc_tick_t i_pts )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     block_t *p_block = tk->p_sipr_packet;
@@ -893,7 +893,7 @@ static void DemuxAudioSipr( demux_t *p_demux, real_track_t *tk, mtime_t i_pts )
     tk->p_sipr_packet = NULL;
 }
 
-static void DemuxAudio( demux_t *p_demux, real_track_t *tk, mtime_t i_pts, unsigned i_flags )
+static void DemuxAudio( demux_t *p_demux, real_track_t *tk, vlc_tick_t i_pts, unsigned i_flags )
 {
     switch( tk->fmt.i_codec )
     {
@@ -927,7 +927,7 @@ static int ControlGoToIndex( demux_t *p_demux, real_index_t *p_index )
         p_sys->track[i]->i_last_dts = 0;
     return vlc_stream_Seek( p_demux->s, p_index->i_file_offset );
 }
-static int ControlSeekTime( demux_t *p_demux, mtime_t i_time )
+static int ControlSeekTime( demux_t *p_demux, vlc_tick_t i_time )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     real_index_t *p_index = p_sys->p_index;
diff --git a/modules/demux/smf.c b/modules/demux/smf.c
index 7c8ac03b39..c3a1918228 100644
--- a/modules/demux/smf.c
+++ b/modules/demux/smf.c
@@ -96,9 +96,9 @@ typedef struct
     es_out_id_t *es;
     date_t       pts; /*< Play timestamp */
     uint64_t     pulse; /*< Pulses counter */
-    mtime_t      tick; /*< Last tick timestamp */
+    vlc_tick_t   tick; /*< Last tick timestamp */
 
-    mtime_t      duration; /*< Total duration */
+    vlc_tick_t   duration; /*< Total duration */
     unsigned     ppqn;   /*< Pulses Per Quarter Note */
     /* by the way, "quarter note" is "noire" in French */
 
@@ -472,7 +472,7 @@ static int Demux (demux_t *demux)
     return VLC_DEMUXER_SUCCESS;
 }
 
-static int Seek (demux_t *demux, mtime_t pts)
+static int Seek (demux_t *demux, vlc_tick_t pts)
 {
     demux_sys_t *sys = demux->p_sys;
 
diff --git a/modules/demux/smooth/SmoothManager.cpp b/modules/demux/smooth/SmoothManager.cpp
index 6510405727..365c4cd6eb 100644
--- a/modules/demux/smooth/SmoothManager.cpp
+++ b/modules/demux/smooth/SmoothManager.cpp
@@ -100,7 +100,7 @@ bool SmoothManager::updatePlaylist()
     for(it=streams.begin(); it!=streams.end(); ++it)
     {
         const AbstractStream *st = *it;
-        const mtime_t m = st->getMinAheadTime();
+        const vlc_tick_t m = st->getMinAheadTime();
         if(st->isDisabled() || !st->isSelected())
         {
             continue;
@@ -118,14 +118,14 @@ void SmoothManager::scheduleNextUpdate()
 {
     time_t now = time(NULL);
 
-    mtime_t minbuffer = 0;
+    vlc_tick_t minbuffer = 0;
     std::vector<AbstractStream *>::const_iterator it;
     for(it=streams.begin(); it!=streams.end(); ++it)
     {
         const AbstractStream *st = *it;
         if(st->isDisabled() || !st->isSelected())
             continue;
-        const mtime_t m = st->getMinAheadTime();
+        const vlc_tick_t m = st->getMinAheadTime();
         if(m > 0 && (m < minbuffer || minbuffer == 0))
             minbuffer = m;
     }
@@ -140,7 +140,7 @@ void SmoothManager::scheduleNextUpdate()
 
     nextPlaylistupdate = now + minbuffer / CLOCK_FREQ;
 
-    msg_Dbg(p_demux, "Updated playlist, next update in %" PRId64 "s", (mtime_t) nextPlaylistupdate - now );
+    msg_Dbg(p_demux, "Updated playlist, next update in %" PRId64 "s", (vlc_tick_t) nextPlaylistupdate - now );
 }
 
 bool SmoothManager::needsUpdate() const
diff --git a/modules/demux/stl.c b/modules/demux/stl.c
index 6d46bd38fc..a8d5377cd8 100644
--- a/modules/demux/stl.c
+++ b/modules/demux/stl.c
@@ -52,8 +52,8 @@ vlc_module_end()
  * Local definitions/prototypes
  *****************************************************************************/
 typedef struct {
-    mtime_t start;
-    mtime_t stop;
+    vlc_tick_t start;
+    vlc_tick_t stop;
     size_t  blocknumber;
     size_t  count;
 } stl_entry_t;
@@ -66,7 +66,7 @@ typedef struct
     es_out_id_t *es;
 
     size_t      current;
-    mtime_t     next_date;
+    vlc_tick_t  next_date;
     bool        b_slave;
     bool        b_first_time;
 } demux_sys_t;
@@ -115,7 +115,7 @@ static int Control(demux_t *demux, int query, va_list args)
     }
     case DEMUX_SET_NEXT_DEMUX_TIME: {
         sys->b_slave = true;
-        sys->next_date = va_arg(args, mtime_t);
+        sys->next_date = va_arg(args, vlc_tick_t);
         return VLC_SUCCESS;
     }
     case DEMUX_SET_TIME: {
@@ -179,7 +179,7 @@ static int Demux(demux_t *demux)
 {
     demux_sys_t *sys = demux->p_sys;
 
-    mtime_t i_barrier = sys->next_date - var_GetInteger(demux->obj.parent, "spu-delay");
+    vlc_tick_t i_barrier = sys->next_date - var_GetInteger(demux->obj.parent, "spu-delay");
     if(i_barrier < 0)
         i_barrier = sys->next_date;
 
@@ -247,7 +247,7 @@ static int Open(vlc_object_t *object)
         return VLC_EGENERIC;
     }
     const int cct = ParseInteger(&header[12], 2);
-    const mtime_t program_start = ParseTextTimeCode(&header[256], fps);
+    const vlc_tick_t program_start = ParseTextTimeCode(&header[256], fps);
     const size_t tti_count = ParseInteger(&header[238], 5);
     if (!tti_count)
         return VLC_EGENERIC;
diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index ff206a981e..1d0c692106 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -172,7 +172,7 @@ typedef struct
     bool        b_slave;
     bool        b_first_time;
 
-    mtime_t     i_next_demux_date;
+    vlc_tick_t  i_next_demux_date;
 
     struct
     {
@@ -822,7 +822,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_SET_NEXT_DEMUX_TIME:
             p_sys->b_slave = true;
-            p_sys->i_next_demux_date = va_arg( args, mtime_t ) - VLC_TS_0;
+            p_sys->i_next_demux_date = va_arg( args, vlc_tick_t ) - VLC_TS_0;
             return VLC_SUCCESS;
 
         case DEMUX_CAN_PAUSE:
@@ -851,7 +851,7 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    mtime_t i_barrier = p_sys->i_next_demux_date - var_GetInteger( p_demux->obj.parent, "spu-delay" );
+    vlc_tick_t i_barrier = p_sys->i_next_demux_date - var_GetInteger( p_demux->obj.parent, "spu-delay" );
     if( i_barrier < 0 )
         i_barrier = p_sys->i_next_demux_date;
 
@@ -2424,7 +2424,7 @@ static int ParseSCC( vlc_object_t *p_obj, subs_properties_t *p_props,
             continue;
 
         /* convert everything to seconds */
-        mtime_t i_frames = h * 3600 + m * 60 + s;
+        vlc_tick_t i_frames = h * 3600 + m * 60 + s;
 
         if( c == ';' && p_rate->b_drop_allowed ) /* dropframe */
         {
diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index b04936342e..557db4e1e1 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -46,7 +46,7 @@ typedef struct
     xml_t*          p_xml;
     xml_reader_t*   p_reader;
     es_out_id_t*    p_es;
-    mtime_t         i_next_demux_time;
+    vlc_tick_t      i_next_demux_time;
     bool            b_slave;
     bool            b_first_time;
 
@@ -233,7 +233,7 @@ static int Control( demux_t* p_demux, int i_query, va_list args )
             }
             break;
         case DEMUX_SET_NEXT_DEMUX_TIME:
-            p_sys->i_next_demux_time = va_arg( args, mtime_t );
+            p_sys->i_next_demux_time = va_arg( args, vlc_tick_t );
             p_sys->b_slave = true;
             return VLC_SUCCESS;
         case DEMUX_GET_LENGTH:
@@ -348,9 +348,9 @@ static int Demux( demux_t* p_demux )
     while( p_sys->times.i_current + 1 < p_sys->times.i_count &&
            tt_time_Convert( &p_sys->times.p_array[p_sys->times.i_current] ) <= p_sys->i_next_demux_time )
     {
-        const mtime_t i_playbacktime =
+        const vlc_tick_t i_playbacktime =
                 tt_time_Convert( &p_sys->times.p_array[p_sys->times.i_current] );
-        const mtime_t i_playbackendtime =
+        const vlc_tick_t i_playbackendtime =
                 tt_time_Convert( &p_sys->times.p_array[p_sys->times.i_current + 1] ) - 1;
 
         if ( !p_sys->b_slave && p_sys->b_first_time )
diff --git a/modules/demux/ty.c b/modules/demux/ty.c
index 700e412bd2..fffdcc01b6 100644
--- a/modules/demux/ty.c
+++ b/modules/demux/ty.c
@@ -237,15 +237,15 @@ typedef struct
   int             i_pes_buf_cnt;      /* how many bytes in our buffer */
   size_t          l_ac3_pkt_size;     /* len of ac3 pkt we've seen so far */
   uint64_t        l_last_ty_pts;      /* last TY timestamp we've seen */
-  //mtime_t         l_last_ty_pts_sync; /* audio PTS at time of last TY PTS */
+  //vlc_tick_t      l_last_ty_pts_sync; /* audio PTS at time of last TY PTS */
   uint64_t        l_first_ty_pts;     /* first TY PTS in this master chunk */
   uint64_t        l_final_ty_pts;     /* final TY PTS in this master chunk */
   unsigned        i_seq_table_size;   /* number of entries in SEQ table */
   unsigned        i_bits_per_seq_entry; /* # of bits in SEQ table bitmask */
 
-  mtime_t         firstAudioPTS;
-  mtime_t         lastAudioPTS;
-  mtime_t         lastVideoPTS;
+  vlc_tick_t      firstAudioPTS;
+  vlc_tick_t      lastAudioPTS;
+  vlc_tick_t      lastVideoPTS;
 
   ty_rec_hdr_t    *rec_hdrs;          /* record headers array */
   int             i_cur_rec;          /* current record in this chunk */
@@ -257,7 +257,7 @@ typedef struct
 } demux_sys_t;
 
 static int get_chunk_header(demux_t *);
-static mtime_t get_pts( const uint8_t *buf );
+static vlc_tick_t get_pts( const uint8_t *buf );
 static int find_es_header( const uint8_t *header,
                            const uint8_t *buffer, int i_search_len );
 static int ty_stream_seek_pct(demux_t *p_demux, double seek_pct);
@@ -561,15 +561,15 @@ static void Close( vlc_object_t *p_this )
 /* =========================================================================== */
 /* Compute Presentation Time Stamp (PTS)
  * Assume buf points to beginning of PTS */
-static mtime_t get_pts( const uint8_t *buf )
+static vlc_tick_t get_pts( const uint8_t *buf )
 {
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 
-    i_pts = ((mtime_t)(buf[0]&0x0e ) << 29)|
-             (mtime_t)(buf[1] << 22)|
-            ((mtime_t)(buf[2]&0xfe) << 14)|
-             (mtime_t)(buf[3] << 7)|
-             (mtime_t)(buf[4] >> 1);
+    i_pts = ((vlc_tick_t)(buf[0]&0x0e ) << 29)|
+             (vlc_tick_t)(buf[1] << 22)|
+            ((vlc_tick_t)(buf[2]&0xfe) << 14)|
+             (vlc_tick_t)(buf[3] << 7)|
+             (vlc_tick_t)(buf[4] >> 1);
     i_pts *= 100 / 9;   /* convert PTS (90Khz clock) to microseconds */
     return i_pts;
 }
diff --git a/modules/demux/vc1.c b/modules/demux/vc1.c
index 08be4ebf38..c2bce58fab 100644
--- a/modules/demux/vc1.c
+++ b/modules/demux/vc1.c
@@ -59,7 +59,7 @@ vlc_module_end ()
  *****************************************************************************/
 typedef struct
 {
-    mtime_t     i_dts;
+    vlc_tick_t  i_dts;
     es_out_id_t *p_es;
 
     float       f_fps;
diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index 75034014b5..f3a93d4328 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -71,7 +71,7 @@ typedef struct
 
 typedef struct
 {
-    mtime_t i_start;
+    vlc_tick_t i_start;
     int     i_vobsub_location;
 } subtitle_t;
 
@@ -89,8 +89,8 @@ typedef struct
 
 typedef struct
 {
-    mtime_t        i_next_demux_date;
-    mtime_t        i_length;
+    vlc_tick_t     i_next_demux_date;
+    vlc_tick_t     i_length;
 
     text_t         txt;
     stream_t       *p_vobsub_stream;
@@ -327,7 +327,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_SET_NEXT_DEMUX_TIME:
-            p_sys->i_next_demux_date = va_arg( args, mtime_t );
+            p_sys->i_next_demux_date = va_arg( args, vlc_tick_t );
             return VLC_SUCCESS;
 
         case DEMUX_CAN_PAUSE:
@@ -356,7 +356,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    mtime_t i_maxdate;
+    vlc_tick_t i_maxdate;
     int i_read;
 
     for( int i = 0; i < p_sys->i_tracks; i++ )
diff --git a/modules/demux/webvtt.c b/modules/demux/webvtt.c
index c11a060640..e865ced54e 100644
--- a/modules/demux/webvtt.c
+++ b/modules/demux/webvtt.c
@@ -48,8 +48,8 @@ typedef struct
     bool         b_slave;
     bool         b_first_time;
     int          i_next_block_flags;
-    mtime_t      i_next_demux_time;
-    mtime_t      i_length;
+    vlc_tick_t   i_next_demux_time;
+    vlc_tick_t   i_length;
     struct
     {
         void    *p_data;
@@ -305,7 +305,7 @@ static int index_Compare( const void *a_, const void *b_ )
     else return a->time < b->time ? -1 : 1;
 }
 
-static size_t getIndexByTime( demux_sys_t *p_sys, mtime_t i_time )
+static size_t getIndexByTime( demux_sys_t *p_sys, vlc_tick_t i_time )
 {
     for( size_t i=0; i<p_sys->index.i_count; i++ )
     {
@@ -340,7 +340,7 @@ static void BuildIndex( demux_t *p_demux )
     }
 }
 
-static block_t *demux_From( demux_t *p_demux, mtime_t i_start )
+static block_t *demux_From( demux_t *p_demux, vlc_tick_t i_start )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
@@ -483,7 +483,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_SET_NEXT_DEMUX_TIME:
             p_sys->b_slave = true;
-            p_sys->i_next_demux_time = va_arg( args, mtime_t ) - VLC_TS_0;
+            p_sys->i_next_demux_time = va_arg( args, vlc_tick_t ) - VLC_TS_0;
             return VLC_SUCCESS;
 
         case DEMUX_CAN_PAUSE:
@@ -533,14 +533,14 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    mtime_t i_barrier = p_sys->i_next_demux_time;
+    vlc_tick_t i_barrier = p_sys->i_next_demux_time;
 
     while( p_sys->index.i_current < p_sys->index.i_count &&
            p_sys->index.p_array[p_sys->index.i_current].time <= i_barrier )
     {
         /* Find start and end of our interval */
-        mtime_t i_start_time = p_sys->index.p_array[p_sys->index.i_current].time;
-        mtime_t i_end_time = i_start_time;
+        vlc_tick_t i_start_time = p_sys->index.p_array[p_sys->index.i_current].time;
+        vlc_tick_t i_end_time = i_start_time;
         /* use next interval time as end time */
         while( ++p_sys->index.i_current < p_sys->index.i_count )
         {
diff --git a/modules/gui/macosx/VLCBookmarksWindowController.m b/modules/gui/macosx/VLCBookmarksWindowController.m
index 5606361c63..19c831bb29 100644
--- a/modules/gui/macosx/VLCBookmarksWindowController.m
+++ b/modules/gui/macosx/VLCBookmarksWindowController.m
@@ -303,7 +303,7 @@ clear:
 {
     assert(bookmark != NULL);
 
-    mtime_t total = bookmark->i_time_offset;
+    vlc_tick_t total = bookmark->i_time_offset;
     uint64_t hour = ( total / ( CLOCK_FREQ * 3600 ) );
     uint64_t min = ( total % ( CLOCK_FREQ * 3600 ) ) / ( CLOCK_FREQ * 60 );
     float    sec = ( total % ( CLOCK_FREQ * 60 ) ) / ( CLOCK_FREQ * 1. );
diff --git a/modules/gui/macosx/VLCControlsBarCommon.m b/modules/gui/macosx/VLCControlsBarCommon.m
index 567bcbfb15..01dbb3cb2d 100644
--- a/modules/gui/macosx/VLCControlsBarCommon.m
+++ b/modules/gui/macosx/VLCControlsBarCommon.m
@@ -302,7 +302,7 @@
     var_Get(p_input, "position", &pos);
     [self.timeSlider setFloatValue:(10000. * pos.f_float)];
 
-    mtime_t dur = input_item_GetDuration(input_GetItem(p_input));
+    vlc_tick_t dur = input_item_GetDuration(input_GetItem(p_input));
     if (dur == -1) {
         // No duration, disable slider
         [self.timeSlider setEnabled:NO];
diff --git a/modules/gui/macosx/VLCCoreInteraction.h b/modules/gui/macosx/VLCCoreInteraction.h
index 58cdbf16de..9f26f3c118 100644
--- a/modules/gui/macosx/VLCCoreInteraction.h
+++ b/modules/gui/macosx/VLCCoreInteraction.h
@@ -56,7 +56,7 @@
 - (void)backwardMedium;
 - (void)forwardLong;
 - (void)backwardLong;
-- (void)jumpToTime:(mtime_t)time;
+- (void)jumpToTime:(vlc_tick_t)time;
 
 - (void)repeatOne;
 - (void)repeatAll;
diff --git a/modules/gui/macosx/VLCCoreInteraction.m b/modules/gui/macosx/VLCCoreInteraction.m
index a5247385e1..3b329a1d49 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -60,7 +60,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 @interface VLCCoreInteraction ()
 {
     int i_currentPlaybackRate;
-    mtime_t timeA, timeB;
+    vlc_tick_t timeA, timeB;
 
     float f_maxVolume;
 
@@ -359,7 +359,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 
     int64_t i_interval = var_InheritInteger( p_input, p_value );
     if (i_interval > 0) {
-        mtime_t val = CLOCK_FREQ * i_interval;
+        vlc_tick_t val = CLOCK_FREQ * i_interval;
         if (!b_value)
             val = val * -1;
         var_SetInteger( p_input, "time-offset", val );
@@ -531,7 +531,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     if (timeB) {
         input_thread_t * p_input = pl_CurrentInput(getIntf());
         if (p_input) {
-            mtime_t currentTime = var_GetInteger(p_input, "time");
+            vlc_tick_t currentTime = var_GetInteger(p_input, "time");
             if ( currentTime >= timeB || currentTime < timeA)
                 var_SetInteger(p_input, "time", timeA);
             vlc_object_release(p_input);
@@ -539,7 +539,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     }
 }
 
-- (void)jumpToTime:(mtime_t)time
+- (void)jumpToTime:(vlc_tick_t)time
 {
     input_thread_t * p_input = pl_CurrentInput(getIntf());
     if (p_input) {
diff --git a/modules/gui/macosx/VLCFSPanelController.m b/modules/gui/macosx/VLCFSPanelController.m
index d4d6bc7734..d3e08509ab 100644
--- a/modules/gui/macosx/VLCFSPanelController.m
+++ b/modules/gui/macosx/VLCFSPanelController.m
@@ -254,7 +254,7 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
 
 
     int64_t t = var_GetInteger(p_input, "time");
-    mtime_t dur = input_item_GetDuration(input_GetItem(p_input));
+    vlc_tick_t dur = input_item_GetDuration(input_GetItem(p_input));
 
     /* Update total duration (right field) */
     if (dur <= 0) {
@@ -265,7 +265,7 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
         NSString *totalTime;
 
         if ([_remainingOrTotalTime timeRemaining]) {
-            mtime_t remaining = 0;
+            vlc_tick_t remaining = 0;
             if (dur > t)
                 remaining = dur - t;
             totalTime = [NSString stringWithFormat:@"-%s", secstotimestr(psz_time, (int)(remaining / CLOCK_FREQ))];
diff --git a/modules/gui/macosx/VLCInputManager.m b/modules/gui/macosx/VLCInputManager.m
index c47648fef8..e99b40b0a3 100644
--- a/modules/gui/macosx/VLCInputManager.m
+++ b/modules/gui/macosx/VLCInputManager.m
@@ -670,7 +670,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
         if (result == RESUME_RESTART)
             return;
 
-        mtime_t lastPos = (mtime_t)lastPosition.intValue * CLOCK_FREQ;
+        vlc_tick_t lastPos = (vlc_tick_t)lastPosition.intValue * CLOCK_FREQ;
         msg_Dbg(getIntf(), "continuing playback at %lld", lastPos);
         var_SetInteger(p_input_thread, "time", lastPos);
     };
@@ -708,8 +708,8 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
     NSMutableDictionary *mutDict = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:@"recentlyPlayedMedia"]];
 
     float relativePos = var_GetFloat(p_input_thread, "position");
-    mtime_t pos = var_GetInteger(p_input_thread, "time") / CLOCK_FREQ;
-    mtime_t dur = input_item_GetDuration(p_item) / CLOCK_FREQ;
+    vlc_tick_t pos = var_GetInteger(p_input_thread, "time") / CLOCK_FREQ;
+    vlc_tick_t dur = input_item_GetDuration(p_item) / CLOCK_FREQ;
 
     NSMutableArray *mediaList = [[defaults objectForKey:@"recentlyPlayedMediaList"] mutableCopy];
 
diff --git a/modules/gui/macosx/VLCMainWindow.m b/modules/gui/macosx/VLCMainWindow.m
index 32f330c181..b68dab5c27 100644
--- a/modules/gui/macosx/VLCMainWindow.m
+++ b/modules/gui/macosx/VLCMainWindow.m
@@ -837,7 +837,7 @@ static const float f_min_window_height = 307.;
     playlist_t * p_playlist = pl_Get(getIntf());
     PL_ASSERT_LOCKED;
 
-    mtime_t mt_duration = playlist_GetNodeDuration( node );
+    vlc_tick_t mt_duration = playlist_GetNodeDuration( node );
 
     if (mt_duration < 1)
         return @"";
diff --git a/modules/gui/macosx/VLCPLModel.m b/modules/gui/macosx/VLCPLModel.m
index 79c53ef672..10875248b0 100644
--- a/modules/gui/macosx/VLCPLModel.m
+++ b/modules/gui/macosx/VLCPLModel.m
@@ -525,7 +525,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
 
     } else if ([o_identifier isEqualToString:DURATION_COLUMN]) {
         char psz_duration[MSTRTIME_MAX_SIZE];
-        mtime_t dur = input_item_GetDuration(p_input);
+        vlc_tick_t dur = input_item_GetDuration(p_input);
         if (dur != -1) {
             secstotimestr(psz_duration, (int)(dur/1000000));
             o_value = toNSStr(psz_duration);
diff --git a/modules/gui/macosx/VLCStatusBarIcon.m b/modules/gui/macosx/VLCStatusBarIcon.m
index 72201064ef..53951c65de 100644
--- a/modules/gui/macosx/VLCStatusBarIcon.m
+++ b/modules/gui/macosx/VLCStatusBarIcon.m
@@ -250,7 +250,7 @@
         remainingTime = [[VLCStringUtility sharedInstance] getCurrentTimeAsString:input negative:YES];
 
         /* Check item duration */
-        mtime_t dur = input_item_GetDuration(input_GetItem(input));
+        vlc_tick_t dur = input_item_GetDuration(input_GetItem(input));
 
         if (dur == -1) {
             /* Unknown duration, possibly due to buffering */
diff --git a/modules/gui/macosx/VLCStringUtility.m b/modules/gui/macosx/VLCStringUtility.m
index 103fd8a48a..3cb41e8938 100644
--- a/modules/gui/macosx/VLCStringUtility.m
+++ b/modules/gui/macosx/VLCStringUtility.m
@@ -113,9 +113,9 @@ NSString *const kVLCMediaUnknown = @"Unknown";
     char psz_time[MSTRTIME_MAX_SIZE];
     int64_t t = var_GetInteger(p_input, "time");
 
-    mtime_t dur = input_item_GetDuration(input_GetItem(p_input));
+    vlc_tick_t dur = input_item_GetDuration(input_GetItem(p_input));
     if (b_negative && dur > 0) {
-        mtime_t remaining = 0;
+        vlc_tick_t remaining = 0;
         if (dur > t)
             remaining = dur - t;
         return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (int)(remaining / 1000000))];
diff --git a/modules/gui/qt/adapters/chromaprint.cpp b/modules/gui/qt/adapters/chromaprint.cpp
index 940c69cac4..1f24006698 100644
--- a/modules/gui/qt/adapters/chromaprint.cpp
+++ b/modules/gui/qt/adapters/chromaprint.cpp
@@ -56,7 +56,7 @@ bool Chromaprint::enqueue( input_item_t *p_item )
     if ( ! p_fingerprinter ) return false;
     fingerprint_request_t *p_r = fingerprint_request_New( p_item );
     if ( ! p_r ) return false;
-    mtime_t t = input_item_GetDuration( p_item );
+    vlc_tick_t t = input_item_GetDuration( p_item );
     if ( t ) p_r->i_duration = (unsigned int) ( t / CLOCK_FREQ );
     if( p_fingerprinter->pf_enqueue( p_fingerprinter, p_r ) != 0 )
     {
diff --git a/modules/gui/qt/components/playlist/selector.cpp b/modules/gui/qt/components/playlist/selector.cpp
index 7c95e6c640..c77acdc2cf 100644
--- a/modules/gui/qt/components/playlist/selector.cpp
+++ b/modules/gui/qt/components/playlist/selector.cpp
@@ -200,7 +200,7 @@ void PLSelector::updateTotalDuration( PLSelItem* item, const char* prefix )
 
     /* Get the duration of the playlist item */
     playlist_Lock( THEPL );
-    mtime_t mt_duration = playlist_GetNodeDuration( node );
+    vlc_tick_t mt_duration = playlist_GetNodeDuration( node );
     playlist_Unlock( THEPL );
 
     /* Formatting time */
diff --git a/modules/gui/qt/dialogs/bookmarks.cpp b/modules/gui/qt/dialogs/bookmarks.cpp
index 740c44bd3d..329eddac6e 100644
--- a/modules/gui/qt/dialogs/bookmarks.cpp
+++ b/modules/gui/qt/dialogs/bookmarks.cpp
@@ -138,7 +138,7 @@ void BookmarksDialog::update()
 
     for( int i = 0; i < i_bookmarks; i++ )
     {
-        mtime_t total = pp_bookmarks[i]->i_time_offset;
+        vlc_tick_t total = pp_bookmarks[i]->i_time_offset;
         unsigned hours   = ( total / ( CLOCK_FREQ * 3600 ) );
         unsigned minutes = ( total % ( CLOCK_FREQ * 3600 ) ) / ( CLOCK_FREQ * 60 );
         float    seconds = ( total % ( CLOCK_FREQ * 60 ) ) / ( CLOCK_FREQ * 1. );
diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index d433bed227..4c28933395 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -927,7 +927,7 @@ void InputManager::jumpFwd()
     int i_interval = var_InheritInteger( p_input, "short-jump-size" );
     if( i_interval > 0 && hasInput() )
     {
-        mtime_t val = CLOCK_FREQ * i_interval;
+        vlc_tick_t val = CLOCK_FREQ * i_interval;
         var_SetInteger( p_input, "time-offset", val );
     }
 }
@@ -937,7 +937,7 @@ void InputManager::jumpBwd()
     int i_interval = var_InheritInteger( p_input, "short-jump-size" );
     if( i_interval > 0 && hasInput() )
     {
-        mtime_t val = -CLOCK_FREQ * i_interval;
+        vlc_tick_t val = -CLOCK_FREQ * i_interval;
         var_SetInteger( p_input, "time-offset", val );
     }
 }
diff --git a/modules/gui/qt/input_manager.hpp b/modules/gui/qt/input_manager.hpp
index 2e2116b82b..bd4b3d9b97 100644
--- a/modules/gui/qt/input_manager.hpp
+++ b/modules/gui/qt/input_manager.hpp
@@ -156,7 +156,7 @@ private:
     float           f_rate;
     float           f_cache;
     bool            b_video;
-    mtime_t         timeA, timeB;
+    vlc_tick_t      timeA, timeB;
 
     void customEvent( QEvent * );
 
diff --git a/modules/gui/qt/styles/seekstyle.cpp b/modules/gui/qt/styles/seekstyle.cpp
index cfdf9cc93f..e5a30dd4e8 100644
--- a/modules/gui/qt/styles/seekstyle.cpp
+++ b/modules/gui/qt/styles/seekstyle.cpp
@@ -177,7 +177,7 @@ void SeekStyle::drawComplexControl( ComplexControl cc, const QStyleOptionComplex
                                         ( background.value() + foreground.value() ) / 2 );
                         if ( slideroptions->orientation == Qt::Horizontal ) /* TODO: vertical */
                         {
-                            foreach( mtime_t time, slideroptions->points )
+                            foreach( vlc_tick_t time, slideroptions->points )
                             {
                                 int x = groove.x() + time / (double)CLOCK_FREQ / slideroptions->length * groove.width();
                                 painter->setPen( foreground );
diff --git a/modules/gui/skins2/os2/os2_timer.hpp b/modules/gui/skins2/os2/os2_timer.hpp
index 67a63d7d05..09842efe95 100644
--- a/modules/gui/skins2/os2/os2_timer.hpp
+++ b/modules/gui/skins2/os2/os2_timer.hpp
@@ -51,7 +51,7 @@ private:
     CmdGeneric &m_rCommand;
 
     /// Delay between two execute
-    mtime_t m_interval;
+    vlc_tick_t m_interval;
 
     /// Flag to tell whether the timer must be stopped after the
     /// first execution
diff --git a/modules/gui/skins2/vars/time.cpp b/modules/gui/skins2/vars/time.cpp
index 0089a6e036..8ca8c4a213 100644
--- a/modules/gui/skins2/vars/time.cpp
+++ b/modules/gui/skins2/vars/time.cpp
@@ -77,7 +77,7 @@ std::string StreamTime::getAsStringCurrTime( bool bShortFormat ) const
     if( !havePosition() )
         return "-:--:--";
 
-    mtime_t time = var_GetInteger( getIntf()->p_sys->p_input, "time" );
+    vlc_tick_t time = var_GetInteger( getIntf()->p_sys->p_input, "time" );
     return formatTime( time / CLOCK_FREQ, bShortFormat );
 }
 
@@ -87,7 +87,7 @@ std::string StreamTime::getAsStringTimeLeft( bool bShortFormat ) const
     if( !havePosition() )
         return "-:--:--";
 
-    mtime_t time = var_GetInteger( getIntf()->p_sys->p_input, "time" ),
+    vlc_tick_t time = var_GetInteger( getIntf()->p_sys->p_input, "time" ),
         duration = var_GetInteger( getIntf()->p_sys->p_input, "length" );
 
     return formatTime( (duration - time) / CLOCK_FREQ, bShortFormat );
@@ -99,6 +99,6 @@ std::string StreamTime::getAsStringDuration( bool bShortFormat ) const
     if( !havePosition() )
         return "-:--:--";
 
-    mtime_t time = var_GetInteger( getIntf()->p_sys->p_input, "length" );
+    vlc_tick_t time = var_GetInteger( getIntf()->p_sys->p_input, "length" );
     return formatTime( time / CLOCK_FREQ, bShortFormat );
 }
diff --git a/modules/gui/skins2/x11/x11_loop.cpp b/modules/gui/skins2/x11/x11_loop.cpp
index 54e4102aa2..e2bc306866 100644
--- a/modules/gui/skins2/x11/x11_loop.cpp
+++ b/modules/gui/skins2/x11/x11_loop.cpp
@@ -254,7 +254,7 @@ void X11Loop::handleX11Event()
             if( event.type == ButtonPress &&
                 event.xbutton.button == 1 )
             {
-                mtime_t time = mdate();
+                vlc_tick_t time = mdate();
                 int x, y;
                 pFactory->getMousePos( x, y );
                 if( time - m_lastClickTime < m_dblClickDelay &&
diff --git a/modules/gui/skins2/x11/x11_loop.hpp b/modules/gui/skins2/x11/x11_loop.hpp
index ad17704eca..a858a33d22 100644
--- a/modules/gui/skins2/x11/x11_loop.hpp
+++ b/modules/gui/skins2/x11/x11_loop.hpp
@@ -55,7 +55,7 @@ private:
     /// Flag set on exit
     bool m_exit;
     /// Date and position of the last left-click
-    mtime_t m_lastClickTime;
+    vlc_tick_t m_lastClickTime;
     int m_lastClickPosX, m_lastClickPosY;
     /// Maximum interval between clicks for a double-click (in microsec)
     static int m_dblClickDelay;
diff --git a/modules/gui/skins2/x11/x11_timer.cpp b/modules/gui/skins2/x11/x11_timer.cpp
index f281b7a289..258e607311 100644
--- a/modules/gui/skins2/x11/x11_timer.cpp
+++ b/modules/gui/skins2/x11/x11_timer.cpp
@@ -49,7 +49,7 @@ X11Timer::~X11Timer()
 
 void X11Timer::start( int delay, bool oneShot )
 {
-    m_interval = 1000LL * (mtime_t)delay;
+    m_interval = 1000LL * (vlc_tick_t)delay;
     m_oneShot = oneShot;
     m_nextDate = mdate() + m_interval;
     m_pTimerLoop->addTimer( *this );
@@ -62,7 +62,7 @@ void X11Timer::stop()
 }
 
 
-mtime_t X11Timer::getNextDate() const
+vlc_tick_t X11Timer::getNextDate() const
 {
     return m_nextDate;
 }
@@ -103,8 +103,8 @@ void X11TimerLoop::removeTimer( X11Timer &rTimer )
 
 void X11TimerLoop::waitNextTimer()
 {
-    mtime_t curDate = mdate();
-    mtime_t nextDate = INT64_MAX;
+    vlc_tick_t curDate = mdate();
+    vlc_tick_t nextDate = INT64_MAX;
 
     X11Timer *nextTimer = NULL;
 
@@ -112,7 +112,7 @@ void X11TimerLoop::waitNextTimer()
     std::list<X11Timer*>::const_iterator timer;
     for( timer = m_timers.begin(); timer != m_timers.end(); ++timer )
     {
-        mtime_t timerDate = (*timer)->getNextDate();
+        vlc_tick_t timerDate = (*timer)->getNextDate();
         if( timerDate < nextDate )
         {
             nextTimer = *timer;
diff --git a/modules/gui/skins2/x11/x11_timer.hpp b/modules/gui/skins2/x11/x11_timer.hpp
index 40d4e8bfc1..a81b86866e 100644
--- a/modules/gui/skins2/x11/x11_timer.hpp
+++ b/modules/gui/skins2/x11/x11_timer.hpp
@@ -48,7 +48,7 @@ public:
     /// Stop the timer
     virtual void stop();
 
-    mtime_t getNextDate() const;
+    vlc_tick_t getNextDate() const;
 
     /// Execute the callback.
     /// Returns false if the timer must be removed after
@@ -60,9 +60,9 @@ private:
     /// Timer loop
     X11TimerLoop *m_pTimerLoop;
     /// Delay between two execute
-    mtime_t m_interval;
+    vlc_tick_t m_interval;
     /// Next date at which the timer must be executed
-    mtime_t m_nextDate;
+    vlc_tick_t m_nextDate;
     /// Flag to tell if the timer must be stopped after the first execution
     bool m_oneShot;
 };
diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 2765b7e9f1..ce0682b481 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -543,7 +543,7 @@ out:
 }
 
 static void vd_prepare(vout_display_t *vd, picture_t *picture,
-                       subpicture_t *subpicture, mtime_t date)
+                       subpicture_t *subpicture, vlc_tick_t date)
 {
     vd_manage(vd);
     VLC_UNUSED(date);
diff --git a/modules/hw/vaapi/filters.c b/modules/hw/vaapi/filters.c
index 028b253dee..9522a51411 100644
--- a/modules/hw/vaapi/filters.c
+++ b/modules/hw/vaapi/filters.c
@@ -253,7 +253,7 @@ struct  deint_data
 
     struct
     {
-        mtime_t date;
+        vlc_tick_t date;
         int     i_nb_fields;
     } meta[METADATA_SIZE];
 
@@ -912,7 +912,7 @@ DeinterlaceX2(filter_t * filter, picture_t * src)
     if (p_deint_data->history.num_pics < p_deint_data->history.sz)
         return NULL;
 
-    mtime_t i_field_dur = 0;
+    vlc_tick_t i_field_dur = 0;
     unsigned int i = 0;
     for ( ; i < METADATA_SIZE-1; i ++)
         if (p_deint_data->meta[i].date != VLC_TS_INVALID)
diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
index ad8f6e79c6..009595da80 100644
--- a/modules/hw/vdpau/chroma.c
+++ b/modules/hw/vdpau/chroma.c
@@ -47,7 +47,7 @@ typedef struct
     struct
     {
         vlc_vdp_video_field_t *field;
-        mtime_t date;
+        vlc_tick_t date;
         bool force;
     } history[MAX_PAST + 1 + MAX_FUTURE];
 
diff --git a/modules/hw/vdpau/deinterlace.c b/modules/hw/vdpau/deinterlace.c
index 1013b8206a..7d4fc45cb0 100644
--- a/modules/hw/vdpau/deinterlace.c
+++ b/modules/hw/vdpau/deinterlace.c
@@ -33,13 +33,13 @@
 
 typedef struct
 {
-    mtime_t last_pts;
+    vlc_tick_t last_pts;
 } filter_sys_t;
 
 static picture_t *Deinterlace(filter_t *filter, picture_t *src)
 {
     filter_sys_t *sys = filter->p_sys;
-    mtime_t last_pts = sys->last_pts;
+    vlc_tick_t last_pts = sys->last_pts;
 
     sys->last_pts = src->date;
 
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 291e164e19..e6508fe764 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -240,7 +240,7 @@ out:/* Destroy GPU surface */
 }
 
 static void Queue(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
-                  mtime_t date)
+                  vlc_tick_t date)
 {
     vout_display_sys_t *sys = vd->sys;
     picture_sys_t *p_sys = pic->p_sys;
@@ -260,7 +260,7 @@ static void Queue(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
             RenderRegion(vd, surface, subpic, r);
 
     /* Compute picture presentation time */
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
     VdpTime pts;
 
     err = vdp_presentation_queue_get_time(sys->vdp, sys->queue, &pts);
@@ -273,7 +273,7 @@ static void Queue(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
         return;
     }
 
-    mtime_t delay = date - now;
+    vlc_tick_t delay = date - now;
     if (delay < 0)
         delay = 0; /* core bug: date is not updated during pause */
     if (unlikely(delay > CLOCK_FREQ))
diff --git a/modules/lua/libs/input.c b/modules/lua/libs/input.c
index 6436cb2b36..112bde23af 100644
--- a/modules/lua/libs/input.c
+++ b/modules/lua/libs/input.c
@@ -338,7 +338,7 @@ static int vlclua_input_item_name( lua_State *L )
 
 static int vlclua_input_item_duration( lua_State *L )
 {
-    mtime_t duration = input_item_GetDuration( vlclua_input_item_get_internal( L ) );
+    vlc_tick_t duration = input_item_GetDuration( vlclua_input_item_get_internal( L ) );
     lua_pushnumber( L, ((double)duration)/(double)CLOCK_FREQ );
     return 1;
 }
diff --git a/modules/lua/libs/osd.c b/modules/lua/libs/osd.c
index 0ad9ca26b8..dec851b368 100644
--- a/modules/lua/libs/osd.c
+++ b/modules/lua/libs/osd.c
@@ -116,7 +116,7 @@ static int vlclua_osd_message( lua_State *L )
     const char *psz_message = luaL_checkstring( L, 1 );
     int i_chan = (int)luaL_optinteger( L, 2, VOUT_SPU_CHANNEL_OSD );
     const char *psz_position = luaL_optstring( L, 3, "top-right" );
-    mtime_t duration = (mtime_t)luaL_optinteger( L, 4, 1*CLOCK_FREQ );
+    vlc_tick_t duration = (vlc_tick_t)luaL_optinteger( L, 4, 1*CLOCK_FREQ );
 
     input_thread_t *p_input = vlclua_get_input_internal( L );
     if( p_input )
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index c3bb742044..65631558e6 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -484,11 +484,11 @@ input_item_t *vlclua_read_input_item(vlc_object_t *obj, lua_State *L)
         msg_Warn(obj, "Playlist item name should be a string" );
 
     /* Read duration */
-    mtime_t duration = -1;
+    vlc_tick_t duration = -1;
 
     lua_getfield( L, -3, "duration" );
     if (lua_isnumber(L, -1))
-        duration = (mtime_t)(lua_tonumber(L, -1) * (CLOCK_FREQ * 1.));
+        duration = (vlc_tick_t)(lua_tonumber(L, -1) * (CLOCK_FREQ * 1.));
     else if (!lua_isnil(L, -1))
         msg_Warn(obj, "Playlist item duration should be a number (seconds)");
     lua_pop( L, 1 ); /* pop "duration" */
diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index 4b95d44718..f55725f6e7 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -70,7 +70,7 @@ typedef struct audioscrobbler_song_t
     int         i_l;                /**< track length     */
     char        *psz_m;             /**< musicbrainz id   */
     time_t      date;               /**< date since epoch */
-    mtime_t     i_start;            /**< playing start    */
+    vlc_tick_t  i_start;            /**< playing start    */
 } audioscrobbler_song_t;
 
 struct intf_sys_t
@@ -94,8 +94,8 @@ struct intf_sys_t
     /* data about song currently playing */
     audioscrobbler_song_t   p_current_song;     /**< song being played      */
 
-    mtime_t                 time_pause;         /**< time when vlc paused   */
-    mtime_t                 time_total_pauses;  /**< total time in pause    */
+    vlc_tick_t              time_pause;         /**< time when vlc paused   */
+    vlc_tick_t              time_total_pauses;  /**< total time in pause    */
 
     bool                    b_submit_nowp;      /**< do we have to submit ? */
 
@@ -646,7 +646,7 @@ proto:
     return VLC_EGENERIC;
 }
 
-static void HandleInterval(mtime_t *next, unsigned int *i_interval)
+static void HandleInterval(vlc_tick_t *next, unsigned int *i_interval)
 {
     if (*i_interval == 0)
     {
@@ -675,7 +675,7 @@ static void *Run(void *data)
     bool                    b_nowp_submission_ongoing = false;
 
     /* data about audioscrobbler session */
-    mtime_t                 next_exchange = 0; /**< when can we send data  */
+    vlc_tick_t              next_exchange = 0; /**< when can we send data  */
     unsigned int            i_interval = 0;     /**< waiting interval (secs)*/
 
     intf_sys_t *p_sys = p_intf->p_sys;
diff --git a/modules/misc/inhibit/xdg.c b/modules/misc/inhibit/xdg.c
index 4b9463368f..b2fe26947e 100644
--- a/modules/misc/inhibit/xdg.c
+++ b/modules/misc/inhibit/xdg.c
@@ -76,7 +76,7 @@ static void Inhibit (vlc_inhibit_t *ih, unsigned mask)
 {
     vlc_inhibit_sys_t *sys = ih->p_sys;
     bool suspend = (mask & VLC_INHIBIT_DISPLAY) != 0;
-    mtime_t delay = suspend ? 30 * CLOCK_FREQ : INT64_C(0);
+    vlc_tick_t delay = suspend ? 30 * CLOCK_FREQ : INT64_C(0);
 
     vlc_timer_schedule (sys->timer, false, delay, delay);
 }
diff --git a/modules/misc/playlist/html.c b/modules/misc/playlist/html.c
index 8f3ed3c5dd..dd25656abd 100644
--- a/modules/misc/playlist/html.c
+++ b/modules/misc/playlist/html.c
@@ -70,7 +70,7 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root )
                 psz_artist = vlc_xml_encode( psz_tmp );
             free( psz_tmp );
 
-            mtime_t i_duration = input_item_GetDuration( p_current->p_input );
+            vlc_tick_t i_duration = input_item_GetDuration( p_current->p_input );
             int min = ( i_duration / CLOCK_FREQ ) / 60;
             int sec = ( i_duration / CLOCK_FREQ ) - min * 60;
 
diff --git a/modules/misc/playlist/m3u.c b/modules/misc/playlist/m3u.c
index 6a31f1463d..f74045c81e 100644
--- a/modules/misc/playlist/m3u.c
+++ b/modules/misc/playlist/m3u.c
@@ -84,7 +84,7 @@ static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root,
         {
             char *psz_artist = input_item_GetArtist( p_current->p_input );
             if( psz_artist == NULL ) psz_artist = strdup( "" );
-            mtime_t i_duration = input_item_GetDuration( p_current->p_input );
+            vlc_tick_t i_duration = input_item_GetDuration( p_current->p_input );
             if( psz_artist && *psz_artist )
             {
                 /* write EXTINF with artist */
diff --git a/modules/misc/playlist/xspf.c b/modules/misc/playlist/xspf.c
index 885563a5e9..d115e4ce66 100644
--- a/modules/misc/playlist/xspf.c
+++ b/modules/misc/playlist/xspf.c
@@ -75,7 +75,7 @@ static void xspf_export_item( playlist_item_t *p_item, FILE *p_file,
 
     input_item_t *p_input = p_item->p_input;
     char *psz;
-    mtime_t i_duration;
+    vlc_tick_t i_duration;
 
     /* leaves can be written directly */
     fputs( "\t\t<track>\n", p_file );
diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c
index 427867e5d3..f3f5ad8545 100644
--- a/modules/misc/rtsp.c
+++ b/modules/misc/rtsp.c
@@ -159,7 +159,7 @@ struct vod_media_t
     rtsp_client_t **rtsp;
 
     /* Infos */
-    mtime_t i_length;
+    vlc_tick_t i_length;
 };
 
 typedef struct
diff --git a/modules/misc/stats.c b/modules/misc/stats.c
index f60a153ca0..fc9e0e0262 100644
--- a/modules/misc/stats.c
+++ b/modules/misc/stats.c
@@ -55,15 +55,15 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
     if( p_block->i_buffer == kBufferSize )
     {
         msg_Dbg( p_dec, "got %"PRIu64" ms",
-                 *(mtime_t *)p_block->p_buffer  / 1000 );
+                 *(vlc_tick_t *)p_block->p_buffer  / 1000 );
         msg_Dbg( p_dec, "got %"PRIu64" ms offset",
-                 (mdate() - *(mtime_t *)p_block->p_buffer) / 1000 );
-        *(mtime_t *)(p_pic->p->p_pixels) = *(mtime_t *)p_block->p_buffer;
+                 (mdate() - *(vlc_tick_t *)p_block->p_buffer) / 1000 );
+        *(vlc_tick_t *)(p_pic->p->p_pixels) = *(vlc_tick_t *)p_block->p_buffer;
     }
     else
     {
         msg_Dbg( p_dec, "got a packet not from stats demuxer" );
-        *(mtime_t *)(p_pic->p->p_pixels) = mdate();
+        *(vlc_tick_t *)(p_pic->p->p_pixels) = mdate();
     }
 
     p_pic->date = p_block->i_pts != VLC_TS_INVALID ?
@@ -102,13 +102,13 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
     (void)p_pict;
     block_t * p_block = block_Alloc( kBufferSize );
 
-    *(mtime_t*)p_block->p_buffer = mdate();
+    *(vlc_tick_t*)p_block->p_buffer = mdate();
     p_block->i_buffer = kBufferSize;
     p_block->i_length = kBufferSize;
     p_block->i_dts = p_pict->date;
 
     msg_Dbg( p_enc, "putting %"PRIu64"ms",
-             *(mtime_t*)p_block->p_buffer / 1000 );
+             *(vlc_tick_t*)p_block->p_buffer / 1000 );
     return p_block;
 }
 
@@ -152,7 +152,7 @@ static int Demux( demux_t *p_demux )
     p_block->i_dts = p_block->i_pts = date_Increment( &p_sys->pts, kBufferSize );
 
     msg_Dbg( p_demux, "demux got %"PRId64" ms offset",
-             (mdate() - *(mtime_t *)p_block->p_buffer) / 1000 );
+             (mdate() - *(vlc_tick_t *)p_block->p_buffer) / 1000 );
 
     //es_out_SetPCR( p_demux->out, p_block->i_pts );
 
diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index fc7c5a80cd..551c812779 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -135,8 +135,8 @@ typedef struct
     guid_t          fid;    /* file id */
     int             i_packet_size;
     int64_t         i_packet_count;
-    mtime_t         i_dts_first;
-    mtime_t         i_dts_last;
+    vlc_tick_t      i_dts_first;
+    vlc_tick_t      i_dts_last;
     int64_t         i_preroll_time; /* in milliseconds */
     int64_t         i_bitrate;
     int64_t         i_bitrate_override;
@@ -148,7 +148,7 @@ typedef struct
     block_t         *pk;
     int             i_pk_used;
     int             i_pk_frame;
-    mtime_t         i_pk_dts;
+    vlc_tick_t      i_pk_dts;
 
     bool      b_asf_http;
     int             i_seq;
@@ -693,7 +693,7 @@ static int Mux( sout_mux_t *p_mux )
     {
         sout_input_t  *p_input;
         asf_track_t   *tk;
-        mtime_t       i_dts;
+        vlc_tick_t    i_dts;
         block_t *data;
         block_t *pk;
 
@@ -845,7 +845,7 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     asf_track_t    *tk;
-    mtime_t i_duration = 0;
+    vlc_tick_t i_duration = 0;
     int i_size, i_header_ext_size;
     int i_ci_size, i_cm_size = 0, i_cd_size = 0;
     block_t *out;
diff --git a/modules/mux/avi.c b/modules/mux/avi.c
index a212773e3f..5b910be774 100644
--- a/modules/mux/avi.c
+++ b/modules/mux/avi.c
@@ -93,7 +93,7 @@ typedef struct avi_stream_s
 
     char fcc[4];
 
-    mtime_t i_duration;       // in µs
+    vlc_tick_t i_duration;       // in µs
 
     int     i_frames;        // total frame count
     int64_t i_totalsize;    // total stream size
diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index 5b54d50528..9ed5feaca3 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -1160,10 +1160,10 @@ static bo_t *GetTextBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
 }
 
 static int64_t GetScaledEntryDuration( const mp4mux_entry_t *p_entry, uint32_t i_timescale,
-                                       mtime_t *pi_total_mtime, int64_t *pi_total_scaled )
+                                       vlc_tick_t *pi_total_mtime, int64_t *pi_total_scaled )
 {
-    const mtime_t i_totalscaledtototalmtime = *pi_total_scaled * CLOCK_FREQ / i_timescale;
-    const mtime_t i_diff = *pi_total_mtime - i_totalscaledtototalmtime;
+    const vlc_tick_t i_totalscaledtototalmtime = *pi_total_scaled * CLOCK_FREQ / i_timescale;
+    const vlc_tick_t i_diff = *pi_total_mtime - i_totalscaledtototalmtime;
 
     /* Ensure to compensate the drift due to loss from time, and from scale, conversions */
     int64_t i_scaled = (p_entry->i_length + i_diff) * i_timescale / CLOCK_FREQ;
@@ -1261,7 +1261,7 @@ static bo_t *GetStblBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
     }
     bo_add_32be(stts, 0);     // entry-count (fixed latter)
 
-    mtime_t i_total_mtime = 0;
+    vlc_tick_t i_total_mtime = 0;
     int64_t i_total_scaled = 0;
     unsigned i_index = 0;
     for (unsigned i = 0; i < p_track->i_entry_count; i_index++) {
@@ -1271,7 +1271,7 @@ static bo_t *GetStblBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
                                                   &i_total_mtime, &i_total_scaled);
         for (unsigned j=i+1; j < p_track->i_entry_count; j++)
         {
-            mtime_t i_total_mtime_next = i_total_mtime;
+            vlc_tick_t i_total_mtime_next = i_total_mtime;
             int64_t i_total_scaled_next = i_total_scaled;
             int64_t i_scalednext = GetScaledEntryDuration(&p_track->entry[j], p_track->i_timescale,
                                                           &i_total_mtime_next, &i_total_scaled_next);
@@ -1300,7 +1300,7 @@ static bo_t *GetStblBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
         for (unsigned i = 0; i < p_track->i_entry_count; i_index++)
         {
             int     i_first = i;
-            mtime_t i_offset = p_track->entry[i].i_pts_dts;
+            vlc_tick_t i_offset = p_track->entry[i].i_pts_dts;
 
             for (; i < p_track->i_entry_count; ++i)
                 if (i == p_track->i_entry_count || p_track->entry[i].i_pts_dts != i_offset)
@@ -1344,7 +1344,7 @@ static bo_t *GetStblBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
     i_index = 0;
     if ( p_track->fmt.i_cat == VIDEO_ES || p_track->fmt.i_cat == AUDIO_ES )
     {
-        mtime_t i_interval = -1;
+        vlc_tick_t i_interval = -1;
         for (unsigned i = 0; i < p_track->i_entry_count; i++)
         {
             if ( i_interval != -1 )
@@ -1398,7 +1398,7 @@ static bo_t *GetStblBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
 }
 
 bo_t * mp4mux_GetMoovBox(vlc_object_t *p_obj, mp4mux_trackinfo_t **pp_tracks, unsigned int i_tracks,
-                         mtime_t i_duration,
+                         vlc_tick_t i_duration,
                          bool b_fragmented, bool b_mov, bool b_64_ext, bool b_stco64 )
 {
     bo_t            *moov, *mvhd;
@@ -1471,7 +1471,7 @@ bo_t * mp4mux_GetMoovBox(vlc_object_t *p_obj, mp4mux_trackinfo_t **pp_tracks, un
     for (unsigned int i_trak = 0; i_trak < i_tracks; i_trak++) {
         mp4mux_trackinfo_t *p_stream = pp_tracks[i_trak];
 
-        mtime_t i_stream_duration;
+        vlc_tick_t i_stream_duration;
         if ( !b_fragmented )
             i_stream_duration = p_stream->i_read_duration * i_movie_timescale / CLOCK_FREQ;
         else
diff --git a/modules/mux/mp4/libmp4mux.h b/modules/mux/mp4/libmp4mux.h
index 36f8052f9a..0a5d0ab452 100644
--- a/modules/mux/mp4/libmp4mux.h
+++ b/modules/mux/mp4/libmp4mux.h
@@ -29,16 +29,16 @@ typedef struct
     uint64_t i_pos;
     int      i_size;
 
-    mtime_t  i_pts_dts;
-    mtime_t  i_length;
+    vlc_tick_t  i_pts_dts;
+    vlc_tick_t  i_length;
     unsigned int i_flags;
 } mp4mux_entry_t;
 
 typedef struct
 {
-    mtime_t i_duration;
-    mtime_t i_start_time;
-    mtime_t i_start_offset;
+    vlc_tick_t i_duration;
+    vlc_tick_t i_start_time;
+    vlc_tick_t i_start_offset;
 } mp4mux_edit_t;
 
 typedef struct
@@ -55,9 +55,9 @@ typedef struct
     block_t      *a52_frame;
 
     /* stats */
-    mtime_t      i_read_duration;
+    vlc_tick_t   i_read_duration;
     uint32_t     i_timescale;
-    mtime_t      i_firstdts; /* the really first packet */
+    vlc_tick_t   i_firstdts; /* the really first packet */
     bool         b_hasbframes;
 
     /* temp stuff */
@@ -65,7 +65,7 @@ typedef struct
     uint64_t     i_stco_pos;
 
     /* frags */
-    mtime_t      i_trex_default_length;
+    vlc_tick_t   i_trex_default_length;
     uint32_t     i_trex_default_size;
 
     /* edit list */
@@ -85,5 +85,5 @@ void  box_gather  (bo_t *box, bo_t *box2);
 bool mp4mux_CanMux(vlc_object_t *, const es_format_t *, vlc_fourcc_t, bool);
 bo_t *mp4mux_GetFtyp(vlc_fourcc_t, uint32_t, vlc_fourcc_t[], size_t i_fourcc);
 bo_t *mp4mux_GetMoovBox(vlc_object_t *, mp4mux_trackinfo_t **pp_tracks, unsigned int i_tracks,
-                        mtime_t i_movie_duration,
+                        vlc_tick_t i_movie_duration,
                         bool b_fragmented, bool b_mov, bool b_64ext, bool b_stco64);
diff --git a/modules/mux/mp4/mp4.c b/modules/mux/mp4/mp4.c
index 3f29c31d61..3165d8bced 100644
--- a/modules/mux/mp4/mp4.c
+++ b/modules/mux/mp4/mp4.c
@@ -112,7 +112,7 @@ struct mp4_fragentry_t
 typedef struct mp4_fragindex_t
 {
     uint64_t i_moofoffset;
-    mtime_t  i_time;
+    vlc_tick_t  i_time;
     uint8_t  i_traf;
     uint8_t  i_trun;
     uint32_t i_sample;
@@ -129,7 +129,7 @@ typedef struct
     mp4mux_trackinfo_t mux;
 
     /* index */
-    mtime_t      i_length_neg;
+    vlc_tick_t   i_length_neg;
 
     /* applies to current segment only */
     int64_t      i_first_dts;
@@ -143,8 +143,8 @@ typedef struct
     mp4_fragentry_t *p_held_entry;
     mp4_fragqueue_t  read;
     mp4_fragqueue_t  towrite;
-    mtime_t          i_last_iframe_time;
-    mtime_t          i_written_duration;
+    vlc_tick_t       i_last_iframe_time;
+    vlc_tick_t       i_written_duration;
     mp4_fragindex_t *p_indexentries;
     uint32_t         i_indexentriesmax;
     uint32_t         i_indexentries;
@@ -162,8 +162,8 @@ typedef struct
 
     uint64_t i_mdat_pos;
     uint64_t i_pos;
-    mtime_t  i_read_duration;
-    mtime_t  i_start_dts;
+    vlc_tick_t  i_read_duration;
+    vlc_tick_t  i_start_dts;
 
     unsigned int   i_nb_streams;
     mp4_stream_t **pp_streams;
@@ -171,7 +171,7 @@ typedef struct
 
     /* mp4frag */
     bool           b_fragmented;
-    mtime_t        i_written_duration;
+    vlc_tick_t     i_written_duration;
     uint32_t       i_mfhd_sequence;
 } sout_mux_sys_t;
 
@@ -179,7 +179,7 @@ static void box_send(sout_mux_t *p_mux,  bo_t *box);
 static bo_t *BuildMoov(sout_mux_t *p_mux);
 
 static block_t *ConvertSUBT(block_t *);
-static bool CreateCurrentEdit(mp4_stream_t *, mtime_t, bool);
+static bool CreateCurrentEdit(mp4_stream_t *, vlc_tick_t, bool);
 static void DebugEdits(sout_mux_t *, const mp4_stream_t *);
 static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_stream);
 
@@ -521,7 +521,7 @@ static void DebugEdits(sout_mux_t *p_mux, const mp4_stream_t *p_stream)
     }
 }
 
-static bool CreateCurrentEdit(mp4_stream_t *p_stream, mtime_t i_mux_start_dts,
+static bool CreateCurrentEdit(mp4_stream_t *p_stream, vlc_tick_t i_mux_start_dts,
                               bool b_fragmented)
 {
     /* Never more than first empty edit for fragmented */
@@ -593,7 +593,7 @@ static block_t * BlockDequeue(sout_input_t *p_input, mp4_stream_t *p_stream)
     return p_block;
 }
 
-static inline mtime_t dts_fb_pts( const block_t *p_data )
+static inline vlc_tick_t dts_fb_pts( const block_t *p_data )
 {
     return p_data->i_dts != VLC_TS_INVALID ? p_data->i_dts: p_data->i_pts;
 }
@@ -675,7 +675,7 @@ static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_s
             }
             else
             {
-                mtime_t i_diff  = dts_fb_pts( p_next ) - dts_fb_pts( p_data );
+                vlc_tick_t i_diff  = dts_fb_pts( p_next ) - dts_fb_pts( p_data );
                 if (i_diff < CLOCK_FREQ) /* protection */
                     p_data->i_length = i_diff;
             }
@@ -871,7 +871,7 @@ static void box_send(sout_mux_t *p_mux,  bo_t *box)
 /* Creates mfra/traf index entries */
 static void AddKeyframeEntry(mp4_stream_t *p_stream, const uint64_t i_moof_pos,
                              const uint8_t i_traf, const uint32_t i_sample,
-                             const mtime_t i_time)
+                             const vlc_tick_t i_time)
 {
     /* alloc or realloc */
     mp4_fragindex_t *p_entries = p_stream->p_indexentries;
@@ -884,7 +884,7 @@ static void AddKeyframeEntry(mp4_stream_t *p_stream, const uint64_t i_moof_pos,
             p_stream->p_indexentries = p_entries;
     }
 
-    mtime_t i_last_entry_time;
+    vlc_tick_t i_last_entry_time;
     if (p_stream->i_indexentries)
         i_last_entry_time = p_stream->p_indexentries[p_stream->i_indexentries - 1].i_time;
     else
@@ -908,7 +908,7 @@ static void AddKeyframeEntry(mp4_stream_t *p_stream, const uint64_t i_moof_pos,
  * requires base_offset_is_moof and then comply to late iso brand spec which
  * breaks clients. */
 static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
-                        mtime_t i_barrier_time, const uint64_t i_write_pos)
+                        vlc_tick_t i_barrier_time, const uint64_t i_write_pos)
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
 
@@ -942,7 +942,7 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
         if(!traf)
             continue;
         uint32_t i_sample = 0;
-        mtime_t i_time = p_stream->i_written_duration;
+        vlc_tick_t i_time = p_stream->i_written_duration;
         bool b_allsamesize = true;
         bool b_allsamelength = true;
         if ( p_stream->read.p_first )
@@ -1038,7 +1038,7 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
 
             /* count entries */
             uint32_t i_entry_count = 0;
-            mtime_t i_run_time = p_stream->i_written_duration;
+            vlc_tick_t i_run_time = p_stream->i_written_duration;
             mp4_fragentry_t *p_entry = p_stream->read.p_first;
             while(p_entry)
             {
@@ -1071,7 +1071,7 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
 
                 if (i_trun_flags & MP4_TRUN_SAMPLE_TIME_OFFSET)
                 {
-                    mtime_t i_diff = 0;
+                    vlc_tick_t i_diff = 0;
                     if ( p_entry->p_block->i_dts  != VLC_TS_INVALID &&
                          p_entry->p_block->i_pts > p_entry->p_block->i_dts )
                     {
@@ -1244,7 +1244,7 @@ static void WriteFragments(sout_mux_t *p_mux, bool b_flush)
 {
     sout_mux_sys_t *p_sys = (sout_mux_sys_t*) p_mux->p_sys;
     bo_t *moof = NULL;
-    mtime_t i_barrier_time = p_sys->i_written_duration + FRAGMENT_LENGTH;
+    vlc_tick_t i_barrier_time = p_sys->i_written_duration + FRAGMENT_LENGTH;
     size_t i_mdat_size = 0;
     bool b_has_samples = false;
 
@@ -1489,8 +1489,8 @@ static int MuxFrag(sout_mux_t *p_mux)
     }
 
     /* Update the global fragment/media duration */
-    mtime_t i_min_read_duration = p_stream->mux.i_read_duration;
-    mtime_t i_min_written_duration = p_stream->i_written_duration;
+    vlc_tick_t i_min_read_duration = p_stream->mux.i_read_duration;
+    vlc_tick_t i_min_written_duration = p_stream->i_written_duration;
     for (unsigned int i=0; i<p_sys->i_nb_streams; i++)
     {
         const mp4_stream_t *p_s = p_sys->pp_streams[i];
diff --git a/modules/mux/mpeg/pes.c b/modules/mux/mpeg/pes.c
index f294ca4e83..c14a2ddd73 100644
--- a/modules/mux/mpeg/pes.c
+++ b/modules/mux/mpeg/pes.c
@@ -50,7 +50,7 @@
  * \param i_header_size length of padding data to insert into PES packet
  *                      header in bytes.
  */
-static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
+static inline int PESHeader( uint8_t *p_hdr, vlc_tick_t i_pts, vlc_tick_t i_dts,
                              int i_es_size, const es_format_t *p_fmt,
                              int i_stream_id, bool b_mpeg2,
                              bool b_data_alignment, int i_header_size )
@@ -319,7 +319,7 @@ static inline int PESHeader( uint8_t *p_hdr, mtime_t i_pts, mtime_t i_dts,
 void EStoPES ( block_t **pp_pes,
                    const es_format_t *p_fmt, int i_stream_id,
                    int b_mpeg2, int b_data_alignment, int i_header_size,
-                   int i_max_pes_size, mtime_t ts_offset )
+                   int i_max_pes_size, vlc_tick_t ts_offset )
 {
     block_t *p_es = *pp_pes;
     block_t *p_pes = NULL;
@@ -382,8 +382,8 @@ void EStoPES ( block_t **pp_pes,
 
     }
 
-    mtime_t i_dts = 0;
-    mtime_t i_pts = 0;
+    vlc_tick_t i_dts = 0;
+    vlc_tick_t i_pts = 0;
     if (p_es->i_pts != VLC_TS_INVALID)
         i_pts = (p_es->i_pts - ts_offset) * 9 / 100;
     if (p_es->i_dts != VLC_TS_INVALID)
@@ -438,7 +438,7 @@ void EStoPES ( block_t **pp_pes,
     /* Now redate all pes */
     p_pes = *pp_pes;
     i_dts    = p_pes->i_dts;
-    mtime_t i_length = p_pes->i_length / i_pes_count;
+    vlc_tick_t i_length = p_pes->i_length / i_pes_count;
     while( p_pes )
     {
         p_pes->i_dts = i_dts;
diff --git a/modules/mux/mpeg/pes.h b/modules/mux/mpeg/pes.h
index 0ddaecb175..297bc82352 100644
--- a/modules/mux/mpeg/pes.h
+++ b/modules/mux/mpeg/pes.h
@@ -38,4 +38,4 @@
 void EStoPES ( block_t **pp_pes,
                    const es_format_t *p_fmt, int i_stream_id,
                    int b_mpeg2, int b_data_alignment, int i_header_size,
-                   int i_max_pes_size, mtime_t ts_offset );
+                   int i_max_pes_size, vlc_tick_t ts_offset );
diff --git a/modules/mux/mpeg/ps.c b/modules/mux/mpeg/ps.c
index fe89ad06bf..adb83f5243 100644
--- a/modules/mux/mpeg/ps.c
+++ b/modules/mux/mpeg/ps.c
@@ -87,9 +87,9 @@ static int Mux      ( sout_mux_t * );
  * Local prototypes
  *****************************************************************************/
 
-static void MuxWritePackHeader  ( sout_mux_t *, block_t **, mtime_t );
-static void MuxWriteSystemHeader( sout_mux_t *, block_t **, mtime_t );
-static void MuxWritePSM         ( sout_mux_t *, block_t **, mtime_t );
+static void MuxWritePackHeader  ( sout_mux_t *, block_t **, vlc_tick_t );
+static void MuxWriteSystemHeader( sout_mux_t *, block_t **, vlc_tick_t );
+static void MuxWritePSM         ( sout_mux_t *, block_t **, vlc_tick_t );
 
 static void StreamIdInit        ( bool *id, int i_range );
 static int  StreamIdGet         ( bool *id, int i_id_min, int i_id_max );
@@ -103,7 +103,7 @@ typedef struct ps_stream_s
 
     /* Language is iso639-2T */
     uint8_t lang[3];
-    mtime_t i_dts;
+    vlc_tick_t i_dts;
 
 } ps_stream_t;
 
@@ -121,12 +121,12 @@ typedef struct
     int i_video_bound;
     int i_pes_count;
     int i_system_header;
-    mtime_t i_dts_delay;
+    vlc_tick_t i_dts_delay;
     int i_rate_bound; /* units of 50 bytes/second */
  
     int64_t i_instant_bitrate;
     int64_t i_instant_size;
-    mtime_t i_instant_dts;
+    vlc_tick_t i_instant_dts;
 
     bool b_mpeg2;
 
@@ -460,7 +460,7 @@ static int Mux( sout_mux_t *p_mux )
 
         block_t *p_ps, *p_data;
 
-        mtime_t        i_dts;
+        vlc_tick_t     i_dts;
 
         /* Choose which stream to mux */
         int i_stream = sout_MuxGetStream( p_mux, 1, &i_dts );
@@ -478,7 +478,7 @@ static int Mux( sout_mux_t *p_mux )
         /* Write regulary PackHeader */
         if( p_sys->i_pes_count % 30 == 0)
         {
-            mtime_t i_mindts = INT64_MAX;
+            vlc_tick_t i_mindts = INT64_MAX;
             for( size_t i=0; i<p_mux->i_nb_inputs; i++ )
             {
                 ps_stream_t *p_s = (ps_stream_t*)p_input->p_sys;
@@ -587,12 +587,12 @@ static void StreamIdRelease( bool *id, int i_id_min, int i_id )
 }
 
 static void MuxWritePackHeader( sout_mux_t *p_mux, block_t **p_buf,
-                                mtime_t i_dts )
+                                vlc_tick_t i_dts )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     bits_buffer_t bits;
     block_t *p_hdr;
-    mtime_t i_scr;
+    vlc_tick_t i_scr;
     int i_mux_rate;
 
     i_scr = (i_dts - p_sys->i_dts_delay) * 9 / 100;
@@ -645,7 +645,7 @@ static void MuxWritePackHeader( sout_mux_t *p_mux, block_t **p_buf,
 }
 
 static void MuxWriteSystemHeader( sout_mux_t *p_mux, block_t **p_buf,
-                                  mtime_t i_dts )
+                                  vlc_tick_t i_dts )
 {
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
     block_t   *p_hdr;
@@ -747,7 +747,7 @@ static void MuxWriteSystemHeader( sout_mux_t *p_mux, block_t **p_buf,
     block_ChainAppend( p_buf, p_hdr );
 }
 
-static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, mtime_t i_dts )
+static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, vlc_tick_t i_dts )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     block_t *p_hdr;
diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index 65f28bedc3..8535fc4a35 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -326,8 +326,8 @@ static inline void BufferChainClean( sout_buffer_chain_t *c )
 typedef struct
 {
     sout_buffer_chain_t chain_pes;
-    mtime_t             i_pes_dts;
-    mtime_t             i_pes_length;
+    vlc_tick_t          i_pes_dts;
+    vlc_tick_t          i_pes_length;
     int                 i_pes_used;
     bool                b_key_frame;
 
@@ -374,12 +374,12 @@ typedef struct
     int64_t         i_shaping_delay;
     int64_t         i_pcr_delay;
 
-    mtime_t         i_dts_delay;
-    mtime_t         first_dts;
+    vlc_tick_t      i_dts_delay;
+    vlc_tick_t      first_dts;
 
     bool            b_use_key_frames;
 
-    mtime_t         i_pcr;  /* last PCR emited */
+    vlc_tick_t      i_pcr;  /* last PCR emited */
 
     csa_t           *csa;
     int             i_csa_pkt_size;
@@ -474,14 +474,14 @@ static int Mux      ( sout_mux_t * );
 static block_t *FixPES( sout_mux_t *p_mux, block_fifo_t *p_fifo );
 static block_t *Add_ADTS( block_t *, const es_format_t * );
 static void TSSchedule  ( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
-                          mtime_t i_pcr_length, mtime_t i_pcr_dts );
+                          vlc_tick_t i_pcr_length, vlc_tick_t i_pcr_dts );
 static void TSDate      ( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
-                          mtime_t i_pcr_length, mtime_t i_pcr_dts );
+                          vlc_tick_t i_pcr_length, vlc_tick_t i_pcr_dts );
 static void GetPAT( sout_mux_t *p_mux, sout_buffer_chain_t *c );
 static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c );
 
 static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream, bool b_pcr );
-static void TSSetPCR( block_t *p_ts, mtime_t i_dts );
+static void TSSetPCR( block_t *p_ts, vlc_tick_t i_dts );
 
 static csa_t *csaSetup( vlc_object_t *p_this )
 {
@@ -1071,7 +1071,7 @@ static void SetBlockDuration( sout_input_t *p_input, block_t *p_data )
         block_FifoCount( p_input->p_fifo ) > 0 )
     {
         block_t *p_next = block_FifoShow( p_input->p_fifo );
-        mtime_t i_diff = p_next->i_dts - p_data->i_dts;
+        vlc_tick_t i_diff = p_next->i_dts - p_data->i_dts;
         if( i_diff > 0 &&
                 (p_next->i_flags & BLOCK_FLAG_DISCONTINUITY) == 0 )
         {
@@ -1198,7 +1198,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
     sout_input_sys_t *p_pcr_stream = (sout_input_sys_t*)p_sys->p_pcr_input->p_sys;
 
     sout_buffer_chain_t chain_ts;
-    mtime_t i_shaping_delay = p_pcr_stream->state.b_key_frame
+    vlc_tick_t i_shaping_delay = p_pcr_stream->state.b_key_frame
         ? p_pcr_stream->state.i_pes_length
         : p_sys->i_shaping_delay;
 
@@ -1453,7 +1453,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
     }
 
     /* save */
-    const mtime_t i_pcr_length = p_pcr_stream->state.i_pes_length;
+    const vlc_tick_t i_pcr_length = p_pcr_stream->state.i_pes_length;
     p_pcr_stream->state.b_key_frame = 0;
 
     /* msg_Dbg( p_mux, "starting muxing %lldms", i_pcr_length / 1000 ); */
@@ -1471,7 +1471,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
             if( p_pes->i_dts + p_pes->i_length >
                 p_pcr_stream->state.i_pes_dts + p_pcr_stream->state.i_pes_length )
             {
-                mtime_t i_frag = p_pcr_stream->state.i_pes_dts +
+                vlc_tick_t i_frag = p_pcr_stream->state.i_pes_dts +
                     p_pcr_stream->state.i_pes_length - p_pes->i_dts;
                 if( i_frag < 0 )
                 {
@@ -1496,11 +1496,11 @@ static bool MuxStreams(sout_mux_t *p_mux )
     i_packet_count += chain_ts.i_depth;
     /* msg_Dbg( p_mux, "estimated pck=%d", i_packet_count ); */
 
-    const mtime_t i_pcr_dts = p_pcr_stream->state.i_pes_dts;
+    const vlc_tick_t i_pcr_dts = p_pcr_stream->state.i_pes_dts;
     for (;;)
     {
         int          i_stream = -1;
-        mtime_t      i_dts = 0;
+        vlc_tick_t   i_dts = 0;
         sout_input_sys_t *p_stream;
 
         /* Select stream (lowest dts) */
@@ -1707,7 +1707,7 @@ static block_t *Add_ADTS( block_t *p_data, const es_format_t *p_fmt )
 }
 
 static void TSSchedule( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
-                        mtime_t i_pcr_length, mtime_t i_pcr_dts )
+                        vlc_tick_t i_pcr_length, vlc_tick_t i_pcr_dts )
 {
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
     sout_buffer_chain_t new_chain;
@@ -1723,15 +1723,15 @@ static void TSSchedule( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
     for (int i = 0; i < i_packet_count; i++ )
     {
         block_t *p_ts = BufferChainGet( p_chain_ts );
-        mtime_t i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count;
+        vlc_tick_t i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count;
 
         BufferChainAppend( &new_chain, p_ts );
 
         if (!p_ts->i_dts || p_ts->i_dts + p_sys->i_dts_delay * 2/3 >= i_new_dts)
             continue;
 
-        mtime_t i_max_diff = i_new_dts - p_ts->i_dts;
-        mtime_t i_cut_dts = p_ts->i_dts;
+        vlc_tick_t i_max_diff = i_new_dts - p_ts->i_dts;
+        vlc_tick_t i_cut_dts = p_ts->i_dts;
 
         p_ts = BufferChainPeek( p_chain_ts );
         i++;
@@ -1763,7 +1763,7 @@ static void TSSchedule( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
 }
 
 static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
-                    mtime_t i_pcr_length, mtime_t i_pcr_dts )
+                    vlc_tick_t i_pcr_length, vlc_tick_t i_pcr_dts )
 {
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
     int i_packet_count = p_chain_ts->i_depth;
@@ -1791,7 +1791,7 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
     for (int i = 0; i < i_packet_count; i++ )
     {
         block_t *p_ts = BufferChainGet( p_chain_ts );
-        mtime_t i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count;
+        vlc_tick_t i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count;
 
         p_ts->i_dts    = i_new_dts;
         p_ts->i_length = i_pcr_length / i_packet_count;
@@ -1918,9 +1918,9 @@ static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
     return p_ts;
 }
 
-static void TSSetPCR( block_t *p_ts, mtime_t i_dts )
+static void TSSetPCR( block_t *p_ts, vlc_tick_t i_dts )
 {
-    mtime_t i_pcr = 9 * i_dts / 100;
+    vlc_tick_t i_pcr = 9 * i_dts / 100;
 
     p_ts->p_buffer[6]  = ( i_pcr >> 25 )&0xff;
     p_ts->p_buffer[7]  = ( i_pcr >> 17 )&0xff;
diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c
index 28114db10a..a1b268eeb6 100644
--- a/modules/mux/ogg.c
+++ b/modules/mux/ogg.c
@@ -147,8 +147,8 @@ typedef struct
 
     int b_new;
 
-    mtime_t i_dts;
-    mtime_t i_length;
+    vlc_tick_t i_dts;
+    vlc_tick_t i_length;
     int     i_packet_no;
     int     i_serial_no;
     int     i_keyframe_granule_shift; /* Theora and Daala only */
@@ -182,7 +182,7 @@ typedef struct
 
     int             i_dirac_last_pt;
     int             i_dirac_last_dt;
-    mtime_t         i_baseptsdelay;
+    vlc_tick_t      i_baseptsdelay;
 
 } ogg_stream_t;
 
@@ -190,7 +190,7 @@ typedef struct
 {
     int     i_streams;
 
-    mtime_t i_start_dts;
+    vlc_tick_t i_start_dts;
     int     i_next_serial_no;
 
     /* number of logical streams pending to be added */
@@ -221,8 +221,8 @@ typedef struct
     ssize_t i_segment_start;
 } sout_mux_sys_t;
 
-static void OggSetDate( block_t *, mtime_t , mtime_t  );
-static block_t *OggStreamFlush( sout_mux_t *, ogg_stream_state *, mtime_t );
+static void OggSetDate( block_t *, vlc_tick_t , vlc_tick_t );
+static block_t *OggStreamFlush( sout_mux_t *, ogg_stream_state *, vlc_tick_t );
 static void OggCreateStreamFooter( sout_mux_t *p_mux, ogg_stream_t *p_stream );
 static void OggRewriteFisheadPage( sout_mux_t *p_mux );
 static bool AllocateIndex( sout_mux_t *p_mux, sout_input_t *p_input );
@@ -670,7 +670,7 @@ static bool AddIndexEntry( sout_mux_t *p_mux, uint64_t i_time, sout_input_t *p_i
  * Ogg bitstream manipulation routines
  *****************************************************************************/
 static block_t *OggStreamGetPage( sout_mux_t *p_mux,
-                                  ogg_stream_state *p_os, mtime_t i_pts,
+                                  ogg_stream_state *p_os, vlc_tick_t i_pts,
                                   bool flush )
 {
     (void)p_mux;
@@ -698,13 +698,13 @@ static block_t *OggStreamGetPage( sout_mux_t *p_mux,
 }
 
 static block_t *OggStreamFlush( sout_mux_t *p_mux,
-                                ogg_stream_state *p_os, mtime_t i_pts )
+                                ogg_stream_state *p_os, vlc_tick_t i_pts )
 {
     return OggStreamGetPage( p_mux, p_os, i_pts, true );
 }
 
 static block_t *OggStreamPageOut( sout_mux_t *p_mux,
-                                  ogg_stream_state *p_os, mtime_t i_pts )
+                                  ogg_stream_state *p_os, vlc_tick_t i_pts )
 {
     return OggStreamGetPage( p_mux, p_os, i_pts, false );
 }
@@ -1374,11 +1374,11 @@ static void OggCreateStreamFooter( sout_mux_t *p_mux, ogg_stream_t *p_stream )
     ogg_stream_clear( &p_stream->os );
 }
 
-static void OggSetDate( block_t *p_og, mtime_t i_dts, mtime_t i_length )
+static void OggSetDate( block_t *p_og, vlc_tick_t i_dts, vlc_tick_t i_length )
 {
     int i_count;
     block_t *p_tmp;
-    mtime_t i_delta;
+    vlc_tick_t i_delta;
 
     for( p_tmp = p_og, i_count = 0; p_tmp != NULL; p_tmp = p_tmp->p_next )
     {
@@ -1484,7 +1484,7 @@ static bool AllocateIndex( sout_mux_t *p_mux, sout_input_t *p_input )
 static int Mux( sout_mux_t *p_mux )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
-    mtime_t        i_dts;
+    vlc_tick_t     i_dts;
 
     /* End any stream that ends in that group */
     if ( p_sys->i_del_streams )
@@ -1585,7 +1585,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
     block_t *p_data = block_FifoGet( p_input->p_fifo );
     block_t *p_og = NULL;
     ogg_packet op;
-    mtime_t i_time;
+    vlc_tick_t i_time;
 
     if( p_stream->fmt.i_codec != VLC_CODEC_VORBIS &&
         p_stream->fmt.i_codec != VLC_CODEC_FLAC &&
@@ -1620,7 +1620,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
             /* number of sample from begining + current packet */
             op.granulepos =
                 ( p_data->i_dts - p_sys->i_start_dts + p_data->i_length ) *
-                (mtime_t)p_input->p_fmt->audio.i_rate / CLOCK_FREQ;
+                (vlc_tick_t)p_input->p_fmt->audio.i_rate / CLOCK_FREQ;
 
             i_time = p_data->i_dts - p_sys->i_start_dts;
             AddIndexEntry( p_mux, i_time, p_input );
diff --git a/modules/packetizer/a52.c b/modules/packetizer/a52.c
index 269a291ebb..d3d25299e9 100644
--- a/modules/packetizer/a52.c
+++ b/modules/packetizer/a52.c
@@ -66,7 +66,7 @@ typedef struct
      * Common properties
      */
     date_t  end_date;
-    mtime_t i_prev_bytestream_pts;
+    vlc_tick_t i_prev_bytestream_pts;
     bool    b_discontuinity;
 
     vlc_a52_header_t frame;
diff --git a/modules/packetizer/dts.c b/modules/packetizer/dts.c
index 12245c2bcb..b0a31e79d7 100644
--- a/modules/packetizer/dts.c
+++ b/modules/packetizer/dts.c
@@ -65,7 +65,7 @@ typedef struct
     date_t  end_date;
     bool    b_date_set;
 
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
     bool    b_discontinuity;
 
     vlc_dts_header_t dts;
diff --git a/modules/packetizer/flac.h b/modules/packetizer/flac.h
index dfeda62c67..f64e4313d5 100644
--- a/modules/packetizer/flac.h
+++ b/modules/packetizer/flac.h
@@ -35,7 +35,7 @@ struct flac_stream_info
 
 struct flac_header_info
 {
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
     unsigned i_rate;
     unsigned i_channels;
     unsigned i_bits_per_sample;
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 4f8a97d0f6..e6f637239e 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -120,12 +120,12 @@ typedef struct
     h264_poc_context_t pocctx;
     struct
     {
-        mtime_t pts;
+        vlc_tick_t pts;
         int num;
     } prevdatedpoc;
 
-    mtime_t i_frame_pts;
-    mtime_t i_frame_dts;
+    vlc_tick_t i_frame_pts;
+    vlc_tick_t i_frame_dts;
 
     date_t dts;
 
@@ -586,8 +586,8 @@ static block_t *ParseNALBlock( decoder_t *p_dec, bool *pb_ts_used, block_t *p_fr
     block_t *p_pic = NULL;
 
     const int i_nal_type = p_frag->p_buffer[4]&0x1f;
-    const mtime_t i_frag_dts = p_frag->i_dts;
-    const mtime_t i_frag_pts = p_frag->i_pts;
+    const vlc_tick_t i_frag_dts = p_frag->i_dts;
+    const vlc_tick_t i_frag_pts = p_frag->i_pts;
 
     if( p_sys->b_slice && (!p_sys->p_active_pps || !p_sys->p_active_sps) )
     {
diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index d71a0bfe75..500fb5a30d 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -101,7 +101,7 @@ typedef struct
     bool b_init_sequence_complete;
 
     date_t dts;
-    mtime_t pts;
+    vlc_tick_t pts;
     bool b_need_ts;
 
     /* */
@@ -826,7 +826,7 @@ static void SetOutputBlockProperties(decoder_t *p_dec, block_t *p_output)
     {
         uint8_t i_num_clock_ts = hevc_get_num_clock_ts(p_sys->p_active_sps,
                                                        p_sys->p_timing);
-        const mtime_t i_start = date_Get(&p_sys->dts);
+        const vlc_tick_t i_start = date_Get(&p_sys->dts);
         if( i_start != VLC_TS_INVALID )
         {
             date_Increment(&p_sys->dts, i_num_clock_ts);
@@ -872,7 +872,7 @@ static block_t *ParseNALBlock(decoder_t *p_dec, bool *pb_ts_used, block_t *p_fra
     }
 
     /* Get NALU type */
-    const mtime_t dts = p_frag->i_dts, pts = p_frag->i_pts;
+    const vlc_tick_t dts = p_frag->i_dts, pts = p_frag->i_pts;
     block_t * p_output = NULL;
     uint8_t i_nal_type = hevc_getNALType(&p_frag->p_buffer[4]);
 
diff --git a/modules/packetizer/hxxx_common.c b/modules/packetizer/hxxx_common.c
index 45b33fdc1a..e7d66b698d 100644
--- a/modules/packetizer/hxxx_common.c
+++ b/modules/packetizer/hxxx_common.c
@@ -34,8 +34,8 @@
 struct cc_storage_t
 {
     uint32_t i_flags;
-    mtime_t i_dts;
-    mtime_t i_pts;
+    vlc_tick_t i_dts;
+    vlc_tick_t i_pts;
     cc_data_t current;
     cc_data_t next;
 };
diff --git a/modules/packetizer/mjpeg.c b/modules/packetizer/mjpeg.c
index 504dee28af..d32b17fd1d 100644
--- a/modules/packetizer/mjpeg.c
+++ b/modules/packetizer/mjpeg.c
@@ -127,7 +127,7 @@ static block_t *PacketizeParse( void *p_private, bool *pb_ts_used, block_t *p_bl
     else if( p_block->i_pts == VLC_TS_INVALID )
         p_block->i_pts = p_block->i_dts;
 
-    mtime_t i_prev_dts = date_Get( &p_sys->date );
+    vlc_tick_t i_prev_dts = date_Get( &p_sys->date );
     if( p_block->i_dts != VLC_TS_INVALID )
     {
         date_Set( &p_sys->date, p_block->i_dts );
diff --git a/modules/packetizer/mlp.c b/modules/packetizer/mlp.c
index 6f16e6c8c3..821bfd5693 100644
--- a/modules/packetizer/mlp.c
+++ b/modules/packetizer/mlp.c
@@ -85,7 +85,7 @@ typedef struct
     date_t  end_date;
     bool    b_discontinuity;
 
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
     int i_frame_size;
 
     bool         b_mlp;
diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c
index 9c571c3c7e..34b99eb37d 100644
--- a/modules/packetizer/mpeg4audio.c
+++ b/modules/packetizer/mpeg4audio.c
@@ -128,7 +128,7 @@ typedef struct
      * Common properties
      */
     date_t  end_date;
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
     bool b_discontuinity;
 
     int i_frame_size;
@@ -329,7 +329,7 @@ static block_t *ForwardRawBlock(decoder_t *p_dec, block_t **pp_block)
     p_block = *pp_block;
     *pp_block = NULL; /* Don't reuse this block */
 
-    mtime_t i_diff = 0;
+    vlc_tick_t i_diff = 0;
     if (p_block->i_pts != VLC_TS_INVALID &&
         p_block->i_pts != date_Get(&p_sys->end_date))
     {
diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c
index 63406e569d..4a13ebee05 100644
--- a/modules/packetizer/mpeg4video.c
+++ b/modules/packetizer/mpeg4video.c
@@ -70,9 +70,9 @@ typedef struct
     /*
      * Common properties
      */
-    mtime_t i_interpolated_pts;
-    mtime_t i_interpolated_dts;
-    mtime_t i_last_ref_pts;
+    vlc_tick_t i_interpolated_pts;
+    vlc_tick_t i_interpolated_dts;
+    vlc_tick_t i_last_ref_pts;
     int64_t i_last_time_ref;
     int64_t i_time_ref;
     int64_t i_last_time;
@@ -232,8 +232,8 @@ static void PacketizeReset( void *p_private, bool b_broken )
 static block_t *PacketizeParse( void *p_private, bool *pb_ts_used, block_t *p_block )
 {
     decoder_t *p_dec = p_private;
-    const mtime_t i_dts = p_block->i_dts;
-    const mtime_t i_pts = p_block->i_pts;
+    const vlc_tick_t i_dts = p_block->i_dts;
+    const vlc_tick_t i_pts = p_block->i_pts;
 
     block_t *p_au = ParseMPEGBlock( p_dec, p_block );
 
diff --git a/modules/packetizer/mpegaudio.c b/modules/packetizer/mpegaudio.c
index ab01b5b5c4..76374acc46 100644
--- a/modules/packetizer/mpegaudio.c
+++ b/modules/packetizer/mpegaudio.c
@@ -59,7 +59,7 @@ typedef struct
      */
     date_t          end_date;
 
-    mtime_t i_pts;
+    vlc_tick_t i_pts;
 
     int i_frame_size, i_free_frame_size;
     unsigned int i_channels_conf, i_chan_mode, i_channels;
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index 318b3f7181..4775b1cee5 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -129,8 +129,8 @@ typedef struct
     block_t    **pp_last;
 
     bool b_frame_slice;
-    mtime_t i_pts;
-    mtime_t i_dts;
+    vlc_tick_t i_pts;
+    vlc_tick_t i_dts;
 
     date_t  dts;
     date_t  prev_iframe_dts;
@@ -152,9 +152,9 @@ typedef struct
     int i_repeat_first_field;
     int i_progressive_frame;
 
-    mtime_t i_last_ref_pts;
+    vlc_tick_t i_last_ref_pts;
 
-    mtime_t i_last_frame_pts;
+    vlc_tick_t i_last_frame_pts;
     uint16_t i_last_frame_refid;
 
     bool b_second_field;
@@ -170,8 +170,8 @@ typedef struct
     /* */
     bool b_cc_reset;
     uint32_t i_cc_flags;
-    mtime_t i_cc_pts;
-    mtime_t i_cc_dts;
+    vlc_tick_t i_cc_pts;
+    vlc_tick_t i_cc_dts;
     cc_data_t cc;
 } decoder_sys_t;
 
diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c
index 7ca438fdd9..87f61060a2 100644
--- a/modules/packetizer/vc1.c
+++ b/modules/packetizer/vc1.c
@@ -87,19 +87,19 @@ typedef struct
     bool  b_frame;
 
     /* Current frame being built */
-    mtime_t    i_frame_dts;
-    mtime_t    i_frame_pts;
+    vlc_tick_t  i_frame_dts;
+    vlc_tick_t  i_frame_pts;
     block_t    *p_frame;
     block_t    **pp_last;
 
 
-    mtime_t i_interpolated_dts;
+    vlc_tick_t i_interpolated_dts;
     bool    b_check_startcode;
 
     /* */
     uint32_t i_cc_flags;
-    mtime_t i_cc_pts;
-    mtime_t i_cc_dts;
+    vlc_tick_t i_cc_pts;
+    vlc_tick_t i_cc_dts;
     cc_data_t cc;
 
     cc_data_t cc_next;
diff --git a/modules/services_discovery/microdns.c b/modules/services_discovery/microdns.c
index 97f250e65b..02109cebad 100644
--- a/modules/services_discovery/microdns.c
+++ b/modules/services_discovery/microdns.c
@@ -112,7 +112,7 @@ struct item
     char *              psz_uri;
     input_item_t *      p_input_item;
     vlc_renderer_item_t*p_renderer_item;
-    mtime_t             i_last_seen;
+    vlc_tick_t          i_last_seen;
 };
 
 struct srv
@@ -250,7 +250,7 @@ items_timeout( struct discovery_sys *p_sys, services_discovery_t *p_sd,
                vlc_renderer_discovery_t *p_rd )
 {
     assert( p_rd != NULL || p_sd != NULL );
-    mtime_t i_now = mdate();
+    vlc_tick_t i_now = mdate();
 
     /* Remove items that are not seen since TIMEOUT */
     for( size_t i = 0; i < vlc_array_count( &p_sys->items ); ++i )
diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index 3bc7b7bc16..dbe4bd2785 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -198,8 +198,8 @@ struct attribute_t
 
 struct sap_announce_t
 {
-    mtime_t i_last;
-    mtime_t i_period;
+    vlc_tick_t i_last;
+    vlc_tick_t i_period;
     uint8_t i_period_trust;
 
     uint16_t    i_hash;
@@ -570,7 +570,7 @@ static void *Run( void *data )
             }
         }
 
-        mtime_t now = mdate();
+        vlc_tick_t now = mdate();
 
         /* A 1 hour timeout correspond to the RFC Implicit timeout.
          * This timeout is tuned in the following loop. */
@@ -579,9 +579,9 @@ static void *Run( void *data )
         /* Check for items that need deletion */
         for( int i = 0; i < p_sys->i_announces; i++ )
         {
-            mtime_t i_timeout = CLOCK_FREQ * p_sys->i_timeout;
+            vlc_tick_t i_timeout = CLOCK_FREQ * p_sys->i_timeout;
             sap_announce_t * p_announce = p_sys->pp_announces[i];
-            mtime_t i_last_period = now - p_announce->i_last;
+            vlc_tick_t i_last_period = now - p_announce->i_last;
 
             /* Remove the announcement, if the last announcement was 1 hour ago
              * or if the last packet emitted was 10 times the average time
@@ -814,7 +814,7 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
                     p_announce->i_period_trust++;
 
                 /* Compute the average period */
-                mtime_t now = mdate();
+                vlc_tick_t now = mdate();
                 p_announce->i_period = ( p_announce->i_period * (p_announce->i_period_trust-1) + (now - p_announce->i_last) ) / p_announce->i_period_trust;
                 p_announce->i_last = now;
             }
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 6626cae2f4..7455ceb299 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -911,7 +911,7 @@ namespace
 
         input_item_t *createNewItem(IXML_Element *p_resource)
         {
-            mtime_t i_duration = -1;
+            vlc_tick_t i_duration = -1;
             const char* psz_resource_url = xml_getChildElementValue( p_resource, "res" );
             if( !psz_resource_url )
                 return NULL;
diff --git a/modules/spu/audiobargraph_v.c b/modules/spu/audiobargraph_v.c
index decb6ac347..d64d41e952 100644
--- a/modules/spu/audiobargraph_v.c
+++ b/modules/spu/audiobargraph_v.c
@@ -113,7 +113,7 @@ typedef struct
     int nbChannels;
     int *i_values;
     picture_t *p_pic;
-    mtime_t date;
+    vlc_tick_t date;
     int scale;
     bool alarm;
     int barWidth;
@@ -357,7 +357,7 @@ static int BarGraphCallback(vlc_object_t *p_this, char const *psz_var,
 /**
  * Sub source
  */
-static subpicture_t *FilterSub(filter_t *p_filter, mtime_t date)
+static subpicture_t *FilterSub(filter_t *p_filter, vlc_tick_t date)
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     BarGraph_t *p_BarGraph = &(p_sys->p_BarGraph);
diff --git a/modules/spu/dynamicoverlay/dynamicoverlay.c b/modules/spu/dynamicoverlay/dynamicoverlay.c
index 19c827804b..747e79a1bb 100644
--- a/modules/spu/dynamicoverlay/dynamicoverlay.c
+++ b/modules/spu/dynamicoverlay/dynamicoverlay.c
@@ -47,7 +47,7 @@
  *****************************************************************************/
 static int Create( vlc_object_t * );
 static void Destroy( vlc_object_t * );
-static subpicture_t *Filter( filter_t *, mtime_t );
+static subpicture_t *Filter( filter_t *, vlc_tick_t );
 
 static int AdjustCallback( vlc_object_t *p_this, char const *psz_var,
                            vlc_value_t oldval, vlc_value_t newval,
@@ -162,7 +162,7 @@ static void Destroy( vlc_object_t *p_this )
  * waits until it is displayed and switch the two rendering buffers, preparing
  * next frame.
  *****************************************************************************/
-static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
+static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
 
diff --git a/modules/spu/logo.c b/modules/spu/logo.c
index 78afcf3770..91b785c8f8 100644
--- a/modules/spu/logo.c
+++ b/modules/spu/logo.c
@@ -139,7 +139,7 @@ typedef struct
     unsigned int i_count;   /* the number of logo images to be displayed */
 
     int i_repeat;         /* how often to repeat the images, image time in ms */
-    mtime_t i_next_pic;     /* when to bring up a new logo image */
+    vlc_tick_t i_next_pic;     /* when to bring up a new logo image */
 
     unsigned int i_counter; /* index into the list of logo images */
 
@@ -187,7 +187,7 @@ static const char *const ppsz_filter_callbacks[] = {
 
 static int OpenCommon( vlc_object_t *, bool b_sub );
 
-static subpicture_t *FilterSub( filter_t *, mtime_t );
+static subpicture_t *FilterSub( filter_t *, vlc_tick_t );
 static picture_t    *FilterVideo( filter_t *, picture_t * );
 
 static int Mouse( filter_t *, vlc_mouse_t *, const vlc_mouse_t *, const vlc_mouse_t * );
@@ -197,7 +197,7 @@ static int LogoCallback( vlc_object_t *, char const *,
 
 static void LogoListLoad( vlc_object_t *, logo_list_t *, const char * );
 static void LogoListUnload( logo_list_t * );
-static logo_t *LogoListNext( logo_list_t *p_list, mtime_t i_date );
+static logo_t *LogoListNext( logo_list_t *p_list, vlc_tick_t i_date );
 static logo_t *LogoListCurrent( logo_list_t *p_list );
 
 /**
@@ -330,7 +330,7 @@ static void Close( vlc_object_t *p_this )
 /**
  * Sub source
  */
-static subpicture_t *FilterSub( filter_t *p_filter, mtime_t date )
+static subpicture_t *FilterSub( filter_t *p_filter, vlc_tick_t date )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     logo_list_t *p_list = &p_sys->list;
@@ -730,7 +730,7 @@ static void LogoListUnload( logo_list_t *p_list )
 /**
  * Go to the next logo and return its pointer.
  */
-static logo_t *LogoListNext( logo_list_t *p_list, mtime_t i_date )
+static logo_t *LogoListNext( logo_list_t *p_list, vlc_tick_t i_date )
 {
     p_list->i_counter = ( p_list->i_counter + 1 ) % p_list->i_count;
 
diff --git a/modules/spu/marq.c b/modules/spu/marq.c
index e0ad8dbc8f..42185c3ae5 100644
--- a/modules/spu/marq.c
+++ b/modules/spu/marq.c
@@ -46,7 +46,7 @@
  *****************************************************************************/
 static int  CreateFilter ( vlc_object_t * );
 static void DestroyFilter( vlc_object_t * );
-static subpicture_t *Filter( filter_t *, mtime_t );
+static subpicture_t *Filter( filter_t *, vlc_tick_t );
 
 static char *MarqueeReadFile( filter_t *, const char * );
 static int MarqueeCallback( vlc_object_t *p_this, char const *psz_var,
@@ -81,8 +81,8 @@ typedef struct
 
     text_style_t *p_style; /* font control */
 
-    mtime_t last_time;
-    mtime_t i_refresh;
+    vlc_tick_t last_time;
+    vlc_tick_t i_refresh;
 } filter_sys_t;
 
 #define MSG_TEXT N_("Text")
@@ -267,7 +267,7 @@ static void DestroyFilter( vlc_object_t *p_this )
  ****************************************************************************
  * This function outputs subpictures at regular time intervals.
  ****************************************************************************/
-static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
+static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     subpicture_t *p_spu = NULL;
diff --git a/modules/spu/mosaic.c b/modules/spu/mosaic.c
index 99884fc533..7276a42ea0 100644
--- a/modules/spu/mosaic.c
+++ b/modules/spu/mosaic.c
@@ -47,7 +47,7 @@
  *****************************************************************************/
 static int  CreateFilter    ( vlc_object_t * );
 static void DestroyFilter   ( vlc_object_t * );
-static subpicture_t *Filter ( filter_t *, mtime_t );
+static subpicture_t *Filter ( filter_t *, vlc_tick_t );
 
 static int MosaicCallback   ( vlc_object_t *, char const *, vlc_value_t,
                               vlc_value_t, void * );
@@ -78,7 +78,7 @@ typedef struct
     int *pi_y_offsets;        /* List of substreams y offsets */
     int i_offsets_length;
 
-    mtime_t i_delay;
+    vlc_tick_t i_delay;
 } filter_sys_t;
 
 /*****************************************************************************
@@ -428,7 +428,7 @@ static void DestroyFilter( vlc_object_t *p_this )
 /*****************************************************************************
  * Filter
  *****************************************************************************/
-static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
+static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     bridge_t *p_bridge;
diff --git a/modules/spu/remoteosd.c b/modules/spu/remoteosd.c
index ed880ad722..85366d932d 100644
--- a/modules/spu/remoteosd.c
+++ b/modules/spu/remoteosd.c
@@ -151,7 +151,7 @@ vlc_module_end ()
 typedef struct filter_sys_t filter_sys_t;
 
 /* subsource functions */
-static subpicture_t *Filter( filter_t *, mtime_t );
+static subpicture_t *Filter( filter_t *, vlc_tick_t );
 
 static int MouseEvent( filter_t *,
                        const vlc_mouse_t *,
@@ -702,7 +702,7 @@ static void* update_request_thread( void *obj )
 {
     filter_t* p_filter = (filter_t*)obj;
     int canc = vlc_savecancel();
-    mtime_t interval = var_InheritInteger( p_filter, RMTOSD_CFG "update" );
+    vlc_tick_t interval = var_InheritInteger( p_filter, RMTOSD_CFG "update" );
     vlc_restorecancel(canc);
 
     if( interval < 100 )
@@ -974,7 +974,7 @@ static bool process_server_message ( filter_t *p_filter,
  ****************************************************************************
  * This function outputs subpictures at regular time intervals.
  ****************************************************************************/
-static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
+static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     subpicture_t *p_spu;
diff --git a/modules/spu/rss.c b/modules/spu/rss.c
index b24fd6334c..bd51456ea9 100644
--- a/modules/spu/rss.c
+++ b/modules/spu/rss.c
@@ -52,7 +52,7 @@
  *****************************************************************************/
 static int  CreateFilter ( vlc_object_t * );
 static void DestroyFilter( vlc_object_t * );
-static subpicture_t *Filter( filter_t *, mtime_t );
+static subpicture_t *Filter( filter_t *, vlc_tick_t );
 
 static struct rss_feed_t *FetchRSS( filter_t * );
 static void FreeRSS( struct rss_feed_t *, int );
@@ -104,14 +104,14 @@ typedef struct
 
     int i_xoff, i_yoff;  /* offsets for the display string in the video window */
     int i_pos; /* permit relative positioning (top, bottom, left, right, center) */
-    mtime_t i_speed;
+    vlc_tick_t i_speed;
     int i_length;
 
     char *psz_marquee;    /* marquee string */
 
     text_style_t *p_style; /* font control */
 
-    mtime_t last_date;
+    vlc_tick_t last_date;
 
     int i_feeds;
     rss_feed_t *p_feeds;
@@ -304,7 +304,7 @@ static int CreateFilter( vlc_object_t *p_this )
     /* Misc init */
     vlc_mutex_init( &p_sys->lock );
     p_filter->pf_sub_source = Filter;
-    p_sys->last_date = (mtime_t)0;
+    p_sys->last_date = (vlc_tick_t)0;
     p_sys->b_fetched = false;
 
     /* Create and arm the timer */
@@ -314,7 +314,7 @@ static int CreateFilter( vlc_object_t *p_this )
         goto error;
     }
     vlc_timer_schedule( p_sys->timer, false, 1,
-                        (mtime_t)(i_ttl)*CLOCK_FREQ );
+                        (vlc_tick_t)(i_ttl)*CLOCK_FREQ );
 
     free( psz_urls );
     return VLC_SUCCESS;
@@ -349,7 +349,7 @@ static void DestroyFilter( vlc_object_t *p_this )
  ****************************************************************************
  * This function outputs subpictures at regular time intervals.
  ****************************************************************************/
-static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
+static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     subpicture_t *p_spu;
diff --git a/modules/spu/subsdelay.c b/modules/spu/subsdelay.c
index 4af42e745c..a80a5d5d39 100644
--- a/modules/spu/subsdelay.c
+++ b/modules/spu/subsdelay.c
@@ -134,7 +134,7 @@ struct subsdelay_heap_entry_t
 
     bool b_check_empty; /* subtitle content should be checked */
 
-    mtime_t i_new_stop; /* new stop value */
+    vlc_tick_t i_new_stop; /* new stop value */
 
     /* last region data*/
 
@@ -223,14 +223,14 @@ static bool SubsdelayIsTextEmpty( const text_segment_t* p_segment );
  *****************************************************************************/
 
 static int SubpicValidateWrapper( subpicture_t *p_subpic, bool has_src_changed, const video_format_t *p_fmt_src,
-                                  bool has_dst_changed, const video_format_t *p_fmt_dst, mtime_t i_ts );
+                                  bool has_dst_changed, const video_format_t *p_fmt_dst, vlc_tick_t i_ts );
 
 static void SubpicUpdateWrapper( subpicture_t *p_subpic, const video_format_t *p_fmt_src,
-                                  const video_format_t *p_fmt_dst, mtime_t i_ts );
+                                  const video_format_t *p_fmt_dst, vlc_tick_t i_ts );
 
 static void SubpicDestroyWrapper( subpicture_t *p_subpic );
 
-static void SubpicLocalUpdate( subpicture_t* p_subpic, mtime_t i_ts );
+static void SubpicLocalUpdate( subpicture_t* p_subpic, vlc_tick_t i_ts );
 
 static bool SubpicIsEmpty( subpicture_t* p_subpic );
 
@@ -262,7 +262,7 @@ static void SubsdelayEntryDestroy( subsdelay_heap_entry_t *p_entry );
 
 /* heap / entries special functionality */
 
-static int SubsdelayHeapCountOverlap( subsdelay_heap_t *p_heap, subsdelay_heap_entry_t *p_entry, mtime_t i_date );
+static int SubsdelayHeapCountOverlap( subsdelay_heap_t *p_heap, subsdelay_heap_entry_t *p_entry, vlc_tick_t i_date );
 
 static void SubsdelayEntryNewStopValueUpdated( subsdelay_heap_entry_t *p_entry );
 
@@ -729,7 +729,7 @@ static void SubsdelayEntryDestroy( subsdelay_heap_entry_t *p_entry )
 /*****************************************************************************
  * SubsdelayHeapCountOverlap: Count overlapping subtitles at a given time
  *****************************************************************************/
-static int SubsdelayHeapCountOverlap( subsdelay_heap_t *p_heap, subsdelay_heap_entry_t *p_entry, mtime_t i_date )
+static int SubsdelayHeapCountOverlap( subsdelay_heap_t *p_heap, subsdelay_heap_entry_t *p_entry, vlc_tick_t i_date )
 {
     int i_overlaps;
 
@@ -774,7 +774,7 @@ static void SubsdelayEnforceDelayRules( filter_t *p_filter )
 {
     subsdelay_heap_entry_t ** p_list;
     int i_count, i_overlap;
-    mtime_t i_offset;
+    vlc_tick_t i_offset;
     int64_t i_min_stops_interval;
     int64_t i_min_stop_start_interval;
     int64_t i_min_start_stop_interval;
@@ -928,10 +928,10 @@ static void SubsdelayRecalculateDelays( filter_t *p_filter )
  * SubpicValidateWrapper: Subpicture validate callback wrapper
  *****************************************************************************/
 static int SubpicValidateWrapper( subpicture_t *p_subpic, bool has_src_changed, const video_format_t *p_fmt_src,
-                                  bool has_dst_changed, const video_format_t *p_fmt_dst, mtime_t i_ts )
+                                  bool has_dst_changed, const video_format_t *p_fmt_dst, vlc_tick_t i_ts )
 {
     subsdelay_heap_entry_t *p_entry;
-    mtime_t i_new_ts;
+    vlc_tick_t i_new_ts;
     int i_result = VLC_SUCCESS;
 
     p_entry = p_subpic->updater.p_sys;
@@ -977,10 +977,10 @@ static int SubpicValidateWrapper( subpicture_t *p_subpic, bool has_src_changed,
  * SubpicUpdateWrapper: Subpicture update callback wrapper
  *****************************************************************************/
 static void SubpicUpdateWrapper( subpicture_t *p_subpic, const video_format_t *p_fmt_src,
-                                  const video_format_t *p_fmt_dst, mtime_t i_ts )
+                                  const video_format_t *p_fmt_dst, vlc_tick_t i_ts )
 {
     subsdelay_heap_entry_t *p_entry;
-    mtime_t i_new_ts;
+    vlc_tick_t i_new_ts;
 
     p_entry = p_subpic->updater.p_sys;
     if( !p_entry )
@@ -1036,7 +1036,7 @@ static void SubpicDestroyWrapper( subpicture_t *p_subpic )
 /*****************************************************************************
  * SubpicLocalUpdate: rewrite some of the subpicture parameters
  *****************************************************************************/
-static void SubpicLocalUpdate( subpicture_t* p_subpic, mtime_t i_ts )
+static void SubpicLocalUpdate( subpicture_t* p_subpic, vlc_tick_t i_ts )
 {
     subsdelay_heap_entry_t *p_entry;
     subsdelay_heap_t *p_heap;
diff --git a/modules/stream_filter/cache_block.c b/modules/stream_filter/cache_block.c
index 2ecc6a8dcc..339539b9b6 100644
--- a/modules/stream_filter/cache_block.c
+++ b/modules/stream_filter/cache_block.c
@@ -73,7 +73,7 @@ typedef struct
     {
         /* Stats for calculating speed */
         uint64_t read_bytes;
-        mtime_t read_time;
+        vlc_tick_t read_time;
     } stat;
 } stream_sys_t;
 
@@ -96,7 +96,7 @@ static int AStreamRefillBlock(stream_t *s)
     }
 
     /* Now read a new block */
-    const mtime_t start = mdate();
+    const vlc_tick_t start = mdate();
     block_t *b;
 
     for (;;)
@@ -122,13 +122,13 @@ static int AStreamRefillBlock(stream_t *s)
 static void AStreamPrebufferBlock(stream_t *s)
 {
     stream_sys_t *sys = s->p_sys;
-    mtime_t start = mdate();
+    vlc_tick_t start = mdate();
     bool first = true;
 
     msg_Dbg(s, "starting pre-buffering");
     for (;;)
     {
-        const mtime_t now = mdate();
+        const vlc_tick_t now = mdate();
         size_t cache_size = block_BytestreamRemaining( &sys->cache );
 
         if (vlc_killed() || cache_size > STREAM_CACHE_PREBUFFER_SIZE)
diff --git a/modules/stream_filter/cache_read.c b/modules/stream_filter/cache_read.c
index 0ac5e1b512..40f68eb08a 100644
--- a/modules/stream_filter/cache_read.c
+++ b/modules/stream_filter/cache_read.c
@@ -74,7 +74,7 @@
 
 typedef struct
 {
-    mtime_t date;
+    vlc_tick_t date;
 
     uint64_t i_start;
     uint64_t i_end;
@@ -103,7 +103,7 @@ typedef struct
         /* Stat about reading data */
         uint64_t i_read_count;
         uint64_t i_bytes;
-        mtime_t i_read_time;
+        vlc_tick_t i_read_time;
     } stat;
 } stream_sys_t;
 
@@ -124,7 +124,7 @@ static int AStreamRefillStream(stream_t *s)
                  sys->i_used, i_toread);
 #endif
 
-    mtime_t start = mdate();
+    vlc_tick_t start = mdate();
     while (i_toread > 0)
     {
         int i_off = tk->i_end % STREAM_CACHE_TRACK_SIZE;
@@ -170,14 +170,14 @@ static int AStreamRefillStream(stream_t *s)
 static void AStreamPrebufferStream(stream_t *s)
 {
     stream_sys_t *sys = s->p_sys;
-    mtime_t start = mdate();
+    vlc_tick_t start = mdate();
     bool first = true;
 
     msg_Dbg(s, "starting pre-buffering");
     for (;;)
     {
         stream_track_t *tk = &sys->tk[sys->i_tk];
-        mtime_t now = mdate();
+        vlc_tick_t now = mdate();
 
         int i_read;
         int i_buffered = tk->i_end - tk->i_start;
diff --git a/modules/stream_filter/hds/hds.c b/modules/stream_filter/hds/hds.c
index 774759ced0..aac96d4492 100644
--- a/modules/stream_filter/hds/hds.c
+++ b/modules/stream_filter/hds/hds.c
@@ -1131,7 +1131,7 @@ static void* live_thread( void* p )
         }
     }
 
-    mtime_t last_dl_start_time;
+    vlc_tick_t last_dl_start_time;
 
     while( ! sys->closed )
     {
diff --git a/modules/stream_out/autodel.c b/modules/stream_out/autodel.c
index f0f1facd8c..302f23c466 100644
--- a/modules/stream_out/autodel.c
+++ b/modules/stream_out/autodel.c
@@ -63,7 +63,7 @@ struct sout_stream_id_sys_t
 {
     sout_stream_id_sys_t *id;
     es_format_t fmt;
-    mtime_t i_last;
+    vlc_tick_t i_last;
     bool b_error;
 };
 
@@ -146,7 +146,7 @@ static int Send( sout_stream_t *p_stream, void *_p_es, block_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
     sout_stream_id_sys_t *p_es = (sout_stream_id_sys_t *)_p_es;
-    mtime_t i_current = mdate();
+    vlc_tick_t i_current = mdate();
     int i;
 
     p_es->i_last = p_buffer->i_dts;
diff --git a/modules/stream_out/bridge.c b/modules/stream_out/bridge.c
index 5c04f93a4c..351120d168 100644
--- a/modules/stream_out/bridge.c
+++ b/modules/stream_out/bridge.c
@@ -159,7 +159,7 @@ typedef struct bridged_es_t
 
     /* bridge in part */
     sout_stream_id_sys_t *id;
-    mtime_t i_last;
+    vlc_tick_t i_last;
     bool b_changed;
 } bridged_es_t;
 
@@ -354,18 +354,18 @@ static int SendOut( sout_stream_t *p_stream, void *id, block_t *p_buffer )
 typedef struct in_sout_stream_sys_t
 {
     int i_id_offset;
-    mtime_t i_delay;
+    vlc_tick_t i_delay;
 
     char *psz_name;
 
     bool b_placeholder;
     bool b_switch_on_iframe;
     int i_state;
-    mtime_t i_placeholder_delay;
+    vlc_tick_t i_placeholder_delay;
     sout_stream_id_sys_t *id_video;
-    mtime_t i_last_video;
+    vlc_tick_t i_last_video;
     sout_stream_id_sys_t *id_audio;
-    mtime_t i_last_audio;
+    vlc_tick_t i_last_audio;
 } in_sout_stream_sys_t;
 
 enum { placeholder_on, placeholder_off };
@@ -397,7 +397,7 @@ static int OpenIn( vlc_object_t *p_this )
     p_sys->i_id_offset = val.i_int;
 
     var_Get( p_stream, SOUT_CFG_PREFIX_IN "delay", &val );
-    p_sys->i_delay = (mtime_t)val.i_int * 1000;
+    p_sys->i_delay = (vlc_tick_t)val.i_int * 1000;
 
     var_Get( p_stream, SOUT_CFG_PREFIX_IN "name", &val );
     if( asprintf( &p_sys->psz_name, "bridge-struct-%s", val.psz_string )<0 )
@@ -417,7 +417,7 @@ static int OpenIn( vlc_object_t *p_this )
     p_sys->i_state = placeholder_on;
 
     var_Get( p_stream, SOUT_CFG_PREFIX_IN "placeholder-delay", &val );
-    p_sys->i_placeholder_delay = (mtime_t)val.i_int * 1000;
+    p_sys->i_placeholder_delay = (vlc_tick_t)val.i_int * 1000;
 
     p_sys->i_last_video = VLC_TS_INVALID;
     p_sys->i_last_audio = VLC_TS_INVALID;
@@ -508,7 +508,7 @@ static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     bridge_t *p_bridge;
     bool b_no_es = true;
     int i;
-    mtime_t i_date = mdate();
+    vlc_tick_t i_date = mdate();
 
     /* First forward the packet for our own ES */
     if( !p_sys->b_placeholder )
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index 19d68ba893..4d8b14f5d3 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -139,7 +139,7 @@ struct sout_stream_sys_t
     const int i_port;
 
     sout_stream_id_sys_t *             video_proxy_id;
-    mtime_t                            first_video_keyframe_pts;
+    vlc_tick_t                         first_video_keyframe_pts;
 
     bool                               es_changed;
     bool                               cc_has_input;
@@ -329,7 +329,7 @@ static int ProxySend(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
             }
         }
 
-        mtime_t pause_delay = p_sys->p_intf->getPauseDelay();
+        vlc_tick_t pause_delay = p_sys->p_intf->getPauseDelay();
         if( p_buffer->i_pts != VLC_TS_INVALID )
             p_buffer->i_pts -= pause_delay;
         if( p_buffer->i_dts != VLC_TS_INVALID )
diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
index 19b0c9dea1..b32a0ded7b 100644
--- a/modules/stream_out/chromecast/chromecast.h
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -180,7 +180,7 @@ struct intf_sys_t
     void setPacing(bool do_pace);
     int pace();
     void sendInputEvent(enum cc_input_event event, union cc_input_arg arg);
-    mtime_t getPauseDelay();
+    vlc_tick_t getPauseDelay();
 
     int httpd_file_fill( uint8_t *psz_request, uint8_t **pp_data, int *pi_data );
     void interrupt_wake_up();
@@ -191,7 +191,7 @@ private:
     bool processMessage(const castchannel::CastMessage &msg);
     void queueMessage( QueueableMessages msg );
 
-    void setPauseState(bool paused, mtime_t delay);
+    void setPauseState(bool paused, vlc_tick_t delay);
     bool isFinishedPlaying();
     bool isStateError() const;
     bool isStatePlaying() const;
@@ -201,11 +201,11 @@ private:
 
     void setMeta( vlc_meta_t *p_meta );
 
-    mtime_t getPlaybackTimestamp();
+    vlc_tick_t getPlaybackTimestamp();
 
     double getPlaybackPosition() const;
 
-    void setInitialTime( mtime_t time );
+    void setInitialTime( vlc_tick_t time );
     // Sets the current state and signal the associated wait cond.
     // This must be called with the lock held
     void setState( States state );
@@ -220,20 +220,20 @@ private:
 private:
     static void* ChromecastThread(void* p_data);
 
-    static mtime_t get_time(void*);
+    static vlc_tick_t get_time(void*);
 
     static int pace(void*);
     static void send_input_event(void *, enum cc_input_event event, union cc_input_arg arg);
     static void set_demux_enabled(void *, bool, on_paused_changed_itf, void *);
 
-    static void set_pause_state(void*, bool paused, mtime_t delay);
+    static void set_pause_state(void*, bool paused, vlc_tick_t delay);
 
     static void set_meta(void*, vlc_meta_t *p_meta);
 
     void prepareHttpArtwork();
 
-    static mtime_t      timeCCToVLC(double);
-    static std::string  timeVLCToCC(mtime_t);
+    static vlc_tick_t   timeCCToVLC(double);
+    static std::string  timeVLCToCC(vlc_tick_t);
 
 private:
     vlc_object_t  * const m_module;
@@ -280,10 +280,10 @@ private:
     char             *m_art_url;
     unsigned          m_art_idx;
 
-    mtime_t           m_cc_time_last_request_date;
-    mtime_t           m_cc_time_date;
-    mtime_t           m_cc_time;
-    mtime_t           m_pause_delay;
+    vlc_tick_t        m_cc_time_last_request_date;
+    vlc_tick_t        m_cc_time_date;
+    vlc_tick_t        m_cc_time;
+    vlc_tick_t        m_pause_delay;
 
     /* shared structure with the demux-filter */
     chromecast_common      m_common;
diff --git a/modules/stream_out/chromecast/chromecast_common.h b/modules/stream_out/chromecast/chromecast_common.h
index f5a378812d..fb0c9ddac1 100644
--- a/modules/stream_out/chromecast/chromecast_common.h
+++ b/modules/stream_out/chromecast/chromecast_common.h
@@ -60,13 +60,13 @@ typedef struct
 
     void (*pf_set_demux_enabled)(void *, bool enabled, on_paused_changed_itf, void *);
 
-    mtime_t (*pf_get_time)(void*);
+    vlc_tick_t (*pf_get_time)(void*);
 
     int (*pf_pace)(void*);
 
     void (*pf_send_input_event)(void*, enum cc_input_event, union cc_input_arg);
 
-    void (*pf_set_pause_state)(void*, bool paused, mtime_t delay);
+    void (*pf_set_pause_state)(void*, bool paused, vlc_tick_t delay);
 
     void (*pf_set_meta)(void*, vlc_meta_t *p_meta);
 
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index 3e157e7f5e..2b8b870a3f 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -492,7 +492,7 @@ int intf_sys_t::pace()
     m_interrupted = false;
     vlc_interrupt_register( interrupt_wake_up_cb, this );
     int ret = 0;
-    mtime_t deadline = mdate() + CLOCK_FREQ/2;
+    vlc_tick_t deadline = mdate() + CLOCK_FREQ/2;
 
     /* Wait for the sout to send more data via http (m_pace), or wait for the
      * CC to finish. In case the demux filter is EOF, we always wait for
@@ -860,7 +860,7 @@ void intf_sys_t::processMediaMessage( const castchannel::CastMessage& msg )
             }
             else if (newPlayerState == "PLAYING")
             {
-                mtime_t currentTime = timeCCToVLC((double) status[0]["currentTime"]);
+                vlc_tick_t currentTime = timeCCToVLC((double) status[0]["currentTime"]);
                 m_cc_time = currentTime;
                 m_cc_time_date = mdate();
 
@@ -947,7 +947,7 @@ bool intf_sys_t::handleMessages()
     size_t i_payloadSize = 0;
     size_t i_received = 0;
     bool b_timeout = false;
-    mtime_t i_begin_time = mdate();
+    vlc_tick_t i_begin_time = mdate();
 
     /* Packet structure:
      * +------------------------------------+------------------------------+
@@ -1051,12 +1051,12 @@ States intf_sys_t::state() const
     return m_state;
 }
 
-mtime_t intf_sys_t::timeCCToVLC(double time)
+vlc_tick_t intf_sys_t::timeCCToVLC(double time)
 {
-    return mtime_t(time * (double)CLOCK_FREQ);
+    return vlc_tick_t(time * (double)CLOCK_FREQ);
 }
 
-std::string intf_sys_t::timeVLCToCC(mtime_t time)
+std::string intf_sys_t::timeVLCToCC(vlc_tick_t time)
 {
     std::stringstream ss;
     ss.setf(std::ios_base::fixed, std::ios_base::floatfield);
@@ -1087,7 +1087,7 @@ void intf_sys_t::setDemuxEnabled(bool enabled,
     }
 }
 
-void intf_sys_t::setPauseState(bool paused, mtime_t delay)
+void intf_sys_t::setPauseState(bool paused, vlc_tick_t delay)
 {
     vlc_mutex_locker locker( &m_lock );
     if ( m_mediaSessionId == 0 || paused == m_paused || !m_communication )
@@ -1106,7 +1106,7 @@ void intf_sys_t::setPauseState(bool paused, mtime_t delay)
             m_communication->msgPlayerPause( m_appTransportId, m_mediaSessionId );
 }
 
-mtime_t intf_sys_t::getPauseDelay()
+vlc_tick_t intf_sys_t::getPauseDelay()
 {
     vlc_mutex_locker locker( &m_lock );
     return m_pause_delay;
@@ -1125,7 +1125,7 @@ void intf_sys_t::setMeta(vlc_meta_t *p_meta)
     m_meta = p_meta;
 }
 
-mtime_t intf_sys_t::getPlaybackTimestamp()
+vlc_tick_t intf_sys_t::getPlaybackTimestamp()
 {
     vlc_mutex_locker locker( &m_lock );
     switch( m_state )
@@ -1138,7 +1138,7 @@ mtime_t intf_sys_t::getPlaybackTimestamp()
         case Playing:
         {
             assert( m_communication );
-            mtime_t now = mdate();
+            vlc_tick_t now = mdate();
             if( m_state == Playing && m_last_request_id == 0
              && now - m_cc_time_last_request_date > INT64_C(4000000) )
             {
@@ -1185,7 +1185,7 @@ void intf_sys_t::setState( States state )
     }
 }
 
-mtime_t intf_sys_t::get_time(void *pt)
+vlc_tick_t intf_sys_t::get_time(void *pt)
 {
     intf_sys_t *p_this = static_cast<intf_sys_t*>(pt);
     return p_this->getPlaybackTimestamp();
@@ -1210,7 +1210,7 @@ void intf_sys_t::send_input_event(void *pt, enum cc_input_event event, union cc_
     return p_this->sendInputEvent(event, arg);
 }
 
-void intf_sys_t::set_pause_state(void *pt, bool paused, mtime_t delay)
+void intf_sys_t::set_pause_state(void *pt, bool paused, vlc_tick_t delay)
 {
     intf_sys_t *p_this = static_cast<intf_sys_t*>(pt);
     p_this->setPauseState( paused, delay );
diff --git a/modules/stream_out/chromecast/chromecast_demux.cpp b/modules/stream_out/chromecast/chromecast_demux.cpp
index a5b30eb8c4..bacb3a70ee 100644
--- a/modules/stream_out/chromecast/chromecast_demux.cpp
+++ b/modules/stream_out/chromecast/chromecast_demux.cpp
@@ -178,30 +178,30 @@ struct demux_cc
                                          cc_input_arg { false } );
     }
 
-    void setPauseState(bool paused, mtime_t delay)
+    void setPauseState(bool paused, vlc_tick_t delay)
     {
         p_renderer->pf_set_pause_state( p_renderer->p_opaque, paused, delay );
     }
 
-    mtime_t getCCTime()
+    vlc_tick_t getCCTime()
     {
-        mtime_t system, delay;
+        vlc_tick_t system, delay;
         if( es_out_ControlGetPcrSystem( p_demux->p_next->out, &system, &delay ) )
             return VLC_TS_INVALID;
 
-        mtime_t cc_time = p_renderer->pf_get_time( p_renderer->p_opaque );
+        vlc_tick_t cc_time = p_renderer->pf_get_time( p_renderer->p_opaque );
         if( cc_time != VLC_TS_INVALID )
             return cc_time - system + m_pause_delay;
         return VLC_TS_INVALID;
     }
 
-    mtime_t getTime()
+    vlc_tick_t getTime()
     {
         if( m_start_time < 0 )
             return -1;
 
         int64_t time = m_start_time;
-        mtime_t cc_time = getCCTime();
+        vlc_tick_t cc_time = getCCTime();
 
         if( cc_time != VLC_TS_INVALID )
             time += cc_time;
@@ -220,7 +220,7 @@ struct demux_cc
             return -1;
     }
 
-    void seekBack( mtime_t time, double pos )
+    void seekBack( vlc_tick_t time, double pos )
     {
         es_out_Control( p_demux->p_next->out, ES_OUT_RESET_PCR );
 
@@ -318,7 +318,7 @@ struct demux_cc
         }
         case DEMUX_GET_TIME:
         {
-            mtime_t time = getTime();
+            vlc_tick_t time = getTime();
             if( time >= 0 )
             {
                 *va_arg(args, int64_t *) = time;
@@ -370,7 +370,7 @@ struct demux_cc
         {
             m_pause_delay = m_pause_date = VLC_TS_INVALID;
 
-            mtime_t time = va_arg( args, int64_t );
+            vlc_tick_t time = va_arg( args, int64_t );
             /* Force unprecise seek */
             int ret = demux_Control( p_demux->p_next, DEMUX_SET_TIME, time, false );
             if( ret != VLC_SUCCESS )
@@ -442,16 +442,16 @@ struct demux_cc
 protected:
     demux_t     * const p_demux;
     chromecast_common  * p_renderer;
-    mtime_t       m_length;
+    vlc_tick_t    m_length;
     bool          m_can_seek;
     bool          m_enabled;
     bool          m_demux_eof;
     double        m_start_pos;
     double        m_last_pos;
-    mtime_t       m_start_time;
-    mtime_t       m_last_time;
-    mtime_t       m_pause_date;
-    mtime_t       m_pause_delay;
+    vlc_tick_t    m_start_time;
+    vlc_tick_t    m_last_time;
+    vlc_tick_t    m_pause_date;
+    vlc_tick_t    m_pause_delay;
 };
 
 static void on_paused_changed_cb( void *data, bool paused )
diff --git a/modules/stream_out/cycle.c b/modules/stream_out/cycle.c
index b6fc5191d1..0f6fe14183 100644
--- a/modules/stream_out/cycle.c
+++ b/modules/stream_out/cycle.c
@@ -41,7 +41,7 @@ typedef struct sout_cycle sout_cycle_t;
 struct sout_cycle
 {
     sout_cycle_t *next;
-    mtime_t offset;
+    vlc_tick_t offset;
     char chain[1];
 };
 
@@ -62,11 +62,11 @@ typedef struct
 
     sout_cycle_t *start;
     sout_cycle_t *next;
-    mtime_t (*clock)(const block_t *);
-    mtime_t period; /*< Total cycle duration */
+    vlc_tick_t (*clock)(const block_t *);
+    vlc_tick_t period; /*< Total cycle duration */
 } sout_stream_sys_t;
 
-static mtime_t get_dts(const block_t *block)
+static vlc_tick_t get_dts(const block_t *block)
 {
     return block->i_dts;
 }
@@ -183,7 +183,7 @@ static int Send(sout_stream_t *stream, void *_id, block_t *block)
 }
 
 static int AppendPhase(sout_cycle_t ***restrict pp,
-                       mtime_t offset, const char *chain)
+                       vlc_tick_t offset, const char *chain)
 {
 
     size_t len = strlen(chain);
@@ -200,7 +200,7 @@ static int AppendPhase(sout_cycle_t ***restrict pp,
     return 0;
 }
 
-static mtime_t ParseTime(const char *str)
+static vlc_tick_t ParseTime(const char *str)
 {
     char *end;
     unsigned long long u = strtoull(str, &end, 0);
@@ -245,7 +245,7 @@ static int Open(vlc_object_t *obj)
     sys->start = NULL;
     sys->clock = get_dts;
 
-    mtime_t offset = 0;
+    vlc_tick_t offset = 0;
     sout_cycle_t **pp = &sys->start;
     const char *chain = "";
 
@@ -259,7 +259,7 @@ static int Open(vlc_object_t *obj)
         }
         else if (!strcmp(cfg->psz_name, "duration"))
         {
-            mtime_t t = ParseTime(cfg->psz_value);
+            vlc_tick_t t = ParseTime(cfg->psz_value);
 
             if (t > 0)
             {
@@ -271,7 +271,7 @@ static int Open(vlc_object_t *obj)
         }
         else if (!strcmp(cfg->psz_name, "offset"))
         {
-            mtime_t t = ParseTime(cfg->psz_value);
+            vlc_tick_t t = ParseTime(cfg->psz_value);
 
             if (t > offset)
             {
diff --git a/modules/stream_out/delay.c b/modules/stream_out/delay.c
index 5ec217eb7a..38641fba09 100644
--- a/modules/stream_out/delay.c
+++ b/modules/stream_out/delay.c
@@ -80,7 +80,7 @@ typedef struct
 {
     void *id;
     int i_id;
-    mtime_t i_delay;
+    vlc_tick_t i_delay;
 } sout_stream_sys_t;
 
 /*****************************************************************************
diff --git a/modules/stream_out/description.c b/modules/stream_out/description.c
index 128f4ecce5..5451942ac2 100644
--- a/modules/stream_out/description.c
+++ b/modules/stream_out/description.c
@@ -60,7 +60,7 @@ vlc_module_end ()
 typedef struct
 {
     sout_description_data_t *data;
-    mtime_t i_stream_start;
+    vlc_tick_t i_stream_start;
 } sout_stream_sys_t;
 
 /*****************************************************************************
diff --git a/modules/stream_out/display.c b/modules/stream_out/display.c
index c2c8c42f17..485b67c2c5 100644
--- a/modules/stream_out/display.c
+++ b/modules/stream_out/display.c
@@ -83,7 +83,7 @@ typedef struct
     bool     b_audio;
     bool     b_video;
 
-    mtime_t        i_delay;
+    vlc_tick_t     i_delay;
     input_resource_t *p_resource;
 } sout_stream_sys_t;
 
diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index 9722672187..18ee744e24 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -99,17 +99,17 @@ typedef struct
 
     sout_stream_t *p_out;
 
-    mtime_t     i_date_start;
+    vlc_tick_t  i_date_start;
     size_t      i_size;
 
-    mtime_t     i_max_wait;
+    vlc_tick_t  i_max_wait;
     size_t      i_max_size;
 
     bool        b_drop;
 
     int              i_id;
     sout_stream_id_sys_t **id;
-    mtime_t     i_dts_start;
+    vlc_tick_t  i_dts_start;
 } sout_stream_sys_t;
 
 static void OutputStart( sout_stream_t *p_stream );
@@ -504,7 +504,7 @@ static void OutputStart( sout_stream_t *p_stream )
 
     /* Compute highest timestamp of first I over all streams */
     p_sys->i_dts_start = 0;
-    mtime_t i_highest_head_dts = 0;
+    vlc_tick_t i_highest_head_dts = 0;
     for( int i = 0; i < p_sys->i_id; i++ )
     {
         sout_stream_id_sys_t *id = p_sys->id[i];
@@ -513,7 +513,7 @@ static void OutputStart( sout_stream_t *p_stream )
             continue;
 
         const block_t *p_block = id->p_first;
-        mtime_t i_dts = p_block->i_dts;
+        vlc_tick_t i_dts = p_block->i_dts;
 
         if( i_dts > i_highest_head_dts &&
            ( id->fmt.i_cat == AUDIO_ES || id->fmt.i_cat == VIDEO_ES ) )
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 54c9e7c06d..269964bc30 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -287,7 +287,7 @@ static int SapSetup( sout_stream_t *p_stream );
 static int FileSetup( sout_stream_t *p_stream );
 static int HttpSetup( sout_stream_t *p_stream, const vlc_url_t * );
 
-static mtime_t rtp_init_ts( const vod_media_t *p_media,
+static vlc_tick_t rtp_init_ts( const vod_media_t *p_media,
                             const char *psz_vod_session );
 
 typedef struct
@@ -311,9 +311,9 @@ typedef struct
     rtsp_stream_t *rtsp;
 
     /* RTSP NPT and timestamp computations */
-    mtime_t      i_npt_zero;    /* when NPT=0 packet is sent */
-    mtime_t      i_pts_zero;    /* predicts PTS of NPT=0 packet */
-    mtime_t      i_pts_offset;  /* matches actual PTS to prediction */
+    vlc_tick_t   i_npt_zero;    /* when NPT=0 packet is sent */
+    vlc_tick_t   i_pts_zero;    /* predicts PTS of NPT=0 packet */
+    vlc_tick_t   i_pts_offset;  /* matches actual PTS to prediction */
     vlc_mutex_t  lock_ts;
 
     /* */
@@ -382,7 +382,7 @@ struct sout_stream_id_sys_t
     } listen;
 
     block_fifo_t     *p_fifo;
-    mtime_t           i_caching;
+    vlc_tick_t        i_caching;
 };
 
 /*****************************************************************************
@@ -936,7 +936,7 @@ rtp_set_ptime (sout_stream_id_sys_t *id, unsigned ptime_ms, size_t bytes)
         id->i_mtu = 12 + (((id->i_mtu - 12) / bytes) * bytes);
 }
 
-uint32_t rtp_compute_ts( unsigned i_clock_rate, mtime_t i_pts )
+uint32_t rtp_compute_ts( unsigned i_clock_rate, vlc_tick_t i_pts )
 {
     /* This is an overflow-proof way of doing:
      * return i_pts * (int64_t)i_clock_rate / CLOCK_FREQ;
@@ -1397,7 +1397,7 @@ static void* ThreadSend( void *data )
 # define EWOULDBLOCK  WSAEWOULDBLOCK
 #endif
     sout_stream_id_sys_t *id = data;
-    mtime_t i_caching = id->i_caching;
+    vlc_tick_t i_caching = id->i_caching;
 
     for (;;)
     {
@@ -1554,7 +1554,7 @@ uint16_t rtp_get_seq( sout_stream_id_sys_t *id )
  * feature). In the VoD case, this function is called independently
  * from several parts of the code, so we need to always return the same
  * value. */
-static mtime_t rtp_init_ts( const vod_media_t *p_media,
+static vlc_tick_t rtp_init_ts( const vod_media_t *p_media,
                             const char *psz_vod_session )
 {
     if (p_media == NULL || psz_vod_session == NULL)
@@ -1575,7 +1575,7 @@ static mtime_t rtp_init_ts( const vod_media_t *p_media,
  * Also return the NPT corresponding to this timestamp. If the stream
  * output is not started, the initial timestamp that will be used with
  * the first packets for NPT=0 is returned instead. */
-mtime_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *id,
+vlc_tick_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *id,
                     const vod_media_t *p_media, const char *psz_vod_session,
                     int64_t *p_npt )
 {
@@ -1589,7 +1589,7 @@ mtime_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *i
         return rtp_init_ts(p_media, psz_vod_session);
 
     sout_stream_sys_t *p_sys = p_stream->p_sys;
-    mtime_t i_npt_zero;
+    vlc_tick_t i_npt_zero;
     vlc_mutex_lock( &p_sys->lock_ts );
     i_npt_zero = p_sys->i_npt_zero;
     vlc_mutex_unlock( &p_sys->lock_ts );
@@ -1597,7 +1597,7 @@ mtime_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *i
     if( i_npt_zero == VLC_TS_INVALID )
         return p_sys->i_pts_zero;
 
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
     if( now < i_npt_zero )
         return p_sys->i_pts_zero;
 
@@ -1609,7 +1609,7 @@ mtime_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *i
 }
 
 void rtp_packetize_common( sout_stream_id_sys_t *id, block_t *out,
-                           bool b_m_bit, mtime_t i_pts )
+                           bool b_m_bit, vlc_tick_t i_pts )
 {
     if( !id->b_ts_init )
     {
@@ -1718,7 +1718,7 @@ static ssize_t AccessOutGrabberWriteBuffer( sout_stream_t *p_stream,
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     sout_stream_id_sys_t *id = p_sys->es[0];
 
-    mtime_t  i_dts = p_buffer->i_dts;
+    vlc_tick_t  i_dts = p_buffer->i_dts;
 
     uint8_t         *p_data = p_buffer->p_buffer;
     size_t          i_data  = p_buffer->i_buffer;
diff --git a/modules/stream_out/rtp.h b/modules/stream_out/rtp.h
index 31f9058ff1..6808fa871f 100644
--- a/modules/stream_out/rtp.h
+++ b/modules/stream_out/rtp.h
@@ -46,22 +46,22 @@ void RtspTrackDetach( rtsp_stream_t *rtsp, const char *name,
 char *SDPGenerate( sout_stream_t *p_stream, const char *rtsp_url );
 char *SDPGenerateVoD( const vod_media_t *p_media, const char *rtsp_url );
 
-uint32_t rtp_compute_ts( unsigned i_clock_rate, mtime_t i_pts );
+uint32_t rtp_compute_ts( unsigned i_clock_rate, vlc_tick_t i_pts );
 int rtp_add_sink( sout_stream_id_sys_t *id, int fd, bool rtcp_mux, uint16_t *seq );
 void rtp_del_sink( sout_stream_id_sys_t *id, int fd );
 uint16_t rtp_get_seq( sout_stream_id_sys_t *id );
-mtime_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *id,
+vlc_tick_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *id,
                     const vod_media_t *p_media, const char *psz_vod_session,
-                    mtime_t *p_npt );
+                    vlc_tick_t *p_npt );
 
 /* RTP packetization */
 void rtp_packetize_common (sout_stream_id_sys_t *id, block_t *out,
-                           bool b_m_bit, mtime_t i_pts);
+                           bool b_m_bit, vlc_tick_t i_pts);
 void rtp_packetize_send (sout_stream_id_sys_t *id, block_t *out);
 size_t rtp_mtu (const sout_stream_id_sys_t *id);
 
 int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
-                               mtime_t i_pts );
+                               vlc_tick_t i_pts );
 
 /* RTCP */
 typedef struct rtcp_sender_t rtcp_sender_t;
@@ -99,7 +99,7 @@ int  OpenVoD ( vlc_object_t * );
 void CloseVoD( vlc_object_t * );
 
 int vod_check_range(vod_media_t *p_media, const char *psz_session,
-                    mtime_t start, mtime_t end);
+                    vlc_tick_t start, vlc_tick_t end);
 void vod_play(vod_media_t *p_media, const char *psz_session,
               int64_t *start, int64_t end);
 void vod_pause(vod_media_t *p_media, const char *psz_session, int64_t *npt);
diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c
index 2aff6f87cb..13118eb361 100644
--- a/modules/stream_out/rtpfmt.c
+++ b/modules/stream_out/rtpfmt.c
@@ -674,11 +674,11 @@ int rtp_get_fmt( vlc_object_t *obj, const es_format_t *p_fmt, const char *mux,
 
 static int
 rtp_packetize_h264_nal( sout_stream_id_sys_t *id,
-                        const uint8_t *p_data, int i_data, mtime_t i_pts,
-                        mtime_t i_dts, bool b_last, mtime_t i_length );
+                        const uint8_t *p_data, int i_data, vlc_tick_t i_pts,
+                        vlc_tick_t i_dts, bool b_last, vlc_tick_t i_length );
 
 int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
-                               mtime_t i_pts )
+                               vlc_tick_t i_pts )
 {
     if (fmtp == NULL)
         return VLC_EGENERIC;
@@ -1055,7 +1055,7 @@ static int rtp_packetize_swab(sout_stream_id_sys_t *id, block_t *in)
     while (in->i_buffer > 0)
     {
         unsigned payload = (max < in->i_buffer) ? max : in->i_buffer;
-        mtime_t duration = (in->i_length * payload) / in->i_buffer;
+        vlc_tick_t duration = (in->i_length * payload) / in->i_buffer;
         bool marker = (in->i_flags & BLOCK_FLAG_DISCONTINUITY) != 0;
 
         block_t *out = block_Alloc(12 + payload);
@@ -1239,8 +1239,8 @@ static int rtp_packetize_h263( sout_stream_id_sys_t *id, block_t *in )
 /* rfc3984 */
 static int
 rtp_packetize_h264_nal( sout_stream_id_sys_t *id,
-                        const uint8_t *p_data, int i_data, mtime_t i_pts,
-                        mtime_t i_dts, bool b_last, mtime_t i_length )
+                        const uint8_t *p_data, int i_data, vlc_tick_t i_pts,
+                        vlc_tick_t i_dts, bool b_last, vlc_tick_t i_length )
 {
     const int i_max = rtp_mtu (id); /* payload max in one packet */
     int i_nal_hdr;
@@ -1323,8 +1323,8 @@ static int rtp_packetize_h264( sout_stream_id_sys_t *id, block_t *in )
 /* rfc7798 */
 static int
 rtp_packetize_h265_nal( sout_stream_id_sys_t *id,
-                        const uint8_t *p_data, size_t i_data, mtime_t i_pts,
-                        mtime_t i_dts, bool b_last, mtime_t i_length )
+                        const uint8_t *p_data, size_t i_data, vlc_tick_t i_pts,
+                        vlc_tick_t i_dts, bool b_last, vlc_tick_t i_length )
 {
     const size_t i_max = rtp_mtu (id); /* payload max in one packet */
 
diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index 2af657164d..a907389601 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -177,7 +177,7 @@ struct rtsp_session_t
 {
     rtsp_stream_t *stream;
     uint64_t       id;
-    mtime_t        last_seen; /* for timeouts */
+    vlc_tick_t     last_seen; /* for timeouts */
 
     /* output (id-access) */
     int            trackc;
@@ -303,7 +303,7 @@ static void RtspUpdateTimer( rtsp_stream_t *rtsp )
     if (rtsp->timeout <= 0)
         return;
 
-    mtime_t timeout = 0;
+    vlc_tick_t timeout = 0;
     for (int i = 0; i < rtsp->sessionc; i++)
     {
         if (timeout == 0 || rtsp->sessionv[i]->last_seen < timeout)
@@ -320,7 +320,7 @@ static void RtspTimeOut( void *data )
     rtsp_stream_t *rtsp = data;
 
     vlc_mutex_lock(&rtsp->lock);
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
     for (int i = rtsp->sessionc - 1; i >= 0; i--)
     {
         if (rtsp->sessionv[i]->last_seen + rtsp->timeout * CLOCK_FREQ < now)
@@ -1006,7 +1006,7 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
                             break;
                     }
                 }
-                mtime_t ts = rtp_get_ts(vod ? NULL : (sout_stream_t *)owner,
+                vlc_tick_t ts = rtp_get_ts(vod ? NULL : (sout_stream_t *)owner,
                                         sout_id, rtsp->vod_media, psz_session,
                                         vod ? NULL : &npt);
 
diff --git a/modules/stream_out/smem.c b/modules/stream_out/smem.c
index f16bd649cf..a86410c7d6 100644
--- a/modules/stream_out/smem.c
+++ b/modules/stream_out/smem.c
@@ -146,18 +146,18 @@ typedef struct
     vlc_mutex_t *p_lock;
     void ( *pf_video_prerender_callback ) ( void* p_video_data, uint8_t** pp_pixel_buffer, size_t size );
     void ( *pf_audio_prerender_callback ) ( void* p_audio_data, uint8_t** pp_pcm_buffer, size_t size );
-    void ( *pf_video_postrender_callback ) ( void* p_video_data, uint8_t* p_pixel_buffer, int width, int height, int pixel_pitch, size_t size, mtime_t pts );
-    void ( *pf_audio_postrender_callback ) ( void* p_audio_data, uint8_t* p_pcm_buffer, unsigned int channels, unsigned int rate, unsigned int nb_samples, unsigned int bits_per_sample, size_t size, mtime_t pts );
+    void ( *pf_video_postrender_callback ) ( void* p_video_data, uint8_t* p_pixel_buffer, int width, int height, int pixel_pitch, size_t size, vlc_tick_t pts );
+    void ( *pf_audio_postrender_callback ) ( void* p_audio_data, uint8_t* p_pcm_buffer, unsigned int channels, unsigned int rate, unsigned int nb_samples, unsigned int bits_per_sample, size_t size, vlc_tick_t pts );
     bool time_sync;
 } sout_stream_sys_t;
 
 void VideoPrerenderDefaultCallback( void* p_video_data, uint8_t** pp_pixel_buffer, size_t size );
 void AudioPrerenderDefaultCallback( void* p_audio_data, uint8_t** pp_pcm_buffer, size_t size );
 void VideoPostrenderDefaultCallback( void* p_video_data, uint8_t* p_pixel_buffer, int width, int height,
-                                     int pixel_pitch, size_t size, mtime_t pts );
+                                     int pixel_pitch, size_t size, vlc_tick_t pts );
 void AudioPostrenderDefaultCallback( void* p_audio_data, uint8_t* p_pcm_buffer, unsigned int channels,
                                      unsigned int rate, unsigned int nb_samples, unsigned int bits_per_sample,
-                                     size_t size, mtime_t pts );
+                                     size_t size, vlc_tick_t pts );
 
 /*****************************************************************************
  * Default empty callbacks
@@ -174,7 +174,7 @@ void AudioPrerenderDefaultCallback( void* p_audio_data, uint8_t** pp_pcm_buffer,
 }
 
 void VideoPostrenderDefaultCallback( void* p_video_data, uint8_t* p_pixel_buffer, int width, int height,
-                                     int pixel_pitch, size_t size, mtime_t pts )
+                                     int pixel_pitch, size_t size, vlc_tick_t pts )
 {
     VLC_UNUSED( p_video_data ); VLC_UNUSED( p_pixel_buffer );
     VLC_UNUSED( width ); VLC_UNUSED( height );
@@ -183,7 +183,7 @@ void VideoPostrenderDefaultCallback( void* p_video_data, uint8_t* p_pixel_buffer
 
 void AudioPostrenderDefaultCallback( void* p_audio_data, uint8_t* p_pcm_buffer, unsigned int channels,
                                      unsigned int rate, unsigned int nb_samples, unsigned int bits_per_sample,
-                                     size_t size, mtime_t pts )
+                                     size_t size, vlc_tick_t pts )
 {
     VLC_UNUSED( p_audio_data ); VLC_UNUSED( p_pcm_buffer );
     VLC_UNUSED( channels ); VLC_UNUSED( rate ); VLC_UNUSED( nb_samples );
@@ -222,13 +222,13 @@ static int Open( vlc_object_t *p_this )
         p_sys->pf_audio_prerender_callback = AudioPrerenderDefaultCallback;
 
     psz_tmp = var_GetString( p_stream, SOUT_PREFIX_VIDEO "postrender-callback" );
-    p_sys->pf_video_postrender_callback = (void (*) (void*, uint8_t*, int, int, int, size_t, mtime_t))(intptr_t)atoll( psz_tmp );
+    p_sys->pf_video_postrender_callback = (void (*) (void*, uint8_t*, int, int, int, size_t, vlc_tick_t))(intptr_t)atoll( psz_tmp );
     free( psz_tmp );
     if (p_sys->pf_video_postrender_callback == NULL)
         p_sys->pf_video_postrender_callback = VideoPostrenderDefaultCallback;
 
     psz_tmp = var_GetString( p_stream, SOUT_PREFIX_AUDIO "postrender-callback" );
-    p_sys->pf_audio_postrender_callback = (void (*) (void*, uint8_t*, unsigned int, unsigned int, unsigned int, unsigned int, size_t, mtime_t))(intptr_t)atoll( psz_tmp );
+    p_sys->pf_audio_postrender_callback = (void (*) (void*, uint8_t*, unsigned int, unsigned int, unsigned int, unsigned int, size_t, vlc_tick_t))(intptr_t)atoll( psz_tmp );
     free( psz_tmp );
     if (p_sys->pf_audio_postrender_callback == NULL)
         p_sys->pf_audio_postrender_callback = AudioPostrenderDefaultCallback;
diff --git a/modules/stream_out/stats.c b/modules/stream_out/stats.c
index cbf0b963c1..1dcba21d84 100644
--- a/modules/stream_out/stats.c
+++ b/modules/stream_out/stats.c
@@ -83,7 +83,7 @@ typedef struct
     uint64_t segment_number;
     void *next_id;
     const char *type;
-    mtime_t previous_dts,track_duration;
+    vlc_tick_t previous_dts,track_duration;
     struct md5_s hash;
 } sout_stream_id_sys_t;
 
@@ -228,7 +228,7 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
         /* We could just set p_sys->output to stdout and remove user of msg_Dbg
          * if we don't need ability to output info to gui modules (like qt messages window
          */
-        mtime_t dts_difference = VLC_TS_INVALID;
+        vlc_tick_t dts_difference = VLC_TS_INVALID;
         if( likely( id->previous_dts != VLC_TS_INVALID ) )
             dts_difference = p_block->i_dts - id->previous_dts;
         if( p_sys->output )
diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 60523d47e2..520944057d 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -349,8 +349,8 @@ int transcode_audio_process( sout_stream_t *p_stream,
 
         if( p_sys->b_master_sync )
         {
-            mtime_t i_pts = date_Get( &id->next_input_pts );
-            mtime_t i_drift = 0;
+            vlc_tick_t i_pts = date_Get( &id->next_input_pts );
+            vlc_tick_t i_drift = 0;
 
             if( likely( p_audio_buf->i_pts != VLC_TS_INVALID ) )
                 i_drift = p_audio_buf->i_pts - i_pts;
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index 071f5d20bf..563d5c6859 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -69,7 +69,7 @@ typedef struct
     /* Sync */
     bool            b_master_sync;
     /* i_master drift is how much audio buffer is ahead of calculated pts */
-    mtime_t         i_master_drift;
+    vlc_tick_t      i_master_drift;
 } sout_stream_sys_t;
 
 struct aout_filters;
diff --git a/modules/stream_out/vod.c b/modules/stream_out/vod.c
index 5f389d5b18..a7ebd8ebaa 100644
--- a/modules/stream_out/vod.c
+++ b/modules/stream_out/vod.c
@@ -73,7 +73,7 @@ struct vod_media_t
     const char *psz_mux;
 
     /* Infos */
-    mtime_t i_length;
+    vlc_tick_t i_length;
 };
 
 typedef struct
diff --git a/modules/text_renderer/freetype/fonts/fontconfig.c b/modules/text_renderer/freetype/fonts/fontconfig.c
index 489d67d0fa..a8359066d7 100644
--- a/modules/text_renderer/freetype/fonts/fontconfig.c
+++ b/modules/text_renderer/freetype/fonts/fontconfig.c
@@ -51,7 +51,7 @@ static vlc_mutex_t lock = VLC_STATIC_MUTEX;
 
 int FontConfig_Prepare( filter_t *p_filter )
 {
-    mtime_t ts;
+    vlc_tick_t ts;
 
     vlc_mutex_lock( &lock );
     if( refs++ > 0 )
diff --git a/modules/video_filter/blendbench.c b/modules/video_filter/blendbench.c
index f1aa544e40..2db0ee91b8 100644
--- a/modules/video_filter/blendbench.c
+++ b/modules/video_filter/blendbench.c
@@ -251,7 +251,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         return NULL;
     }
 
-    mtime_t time = mdate();
+    vlc_tick_t time = mdate();
     for( int i_iter = 0; i_iter < p_sys->i_loops; ++i_iter )
     {
         p_blend->pf_video_blend( p_blend,
diff --git a/modules/video_filter/deinterlace/algo_ivtc.c b/modules/video_filter/deinterlace/algo_ivtc.c
index 8b9254df7d..a6c671b1fd 100644
--- a/modules/video_filter/deinterlace/algo_ivtc.c
+++ b/modules/video_filter/deinterlace/algo_ivtc.c
@@ -1216,7 +1216,7 @@ static bool IVTCOutputOrDropFrame( filter_t *p_filter, picture_t *p_dst )
 
     filter_sys_t *p_sys = p_filter->p_sys;
     ivtc_sys_t *p_ivtc  = &p_sys->ivtc;
-    mtime_t t_final = VLC_TS_INVALID; /* for custom timestamp mangling */
+    vlc_tick_t t_final = VLC_TS_INVALID; /* for custom timestamp mangling */
 
     picture_t *p_curr = p_sys->context.pp_history[1];
     picture_t *p_next = p_sys->context.pp_history[2];
@@ -1412,7 +1412,7 @@ static bool IVTCOutputOrDropFrame( filter_t *p_filter, picture_t *p_dst )
         {
             /* Approximate field duration from the PTS difference. */
             /* FIXME: use field length as measured by Deinterlace()? */
-            mtime_t i_half_field_dur = ( (p_next->date - p_curr->date)/3 ) / 2;
+            vlc_tick_t i_half_field_dur = ( (p_next->date - p_curr->date)/3 ) / 2;
             t_final = p_curr->date + i_half_field_dur;
         }
         else /* Otherwise, use original PTS of the outgoing frame. */
diff --git a/modules/video_filter/deinterlace/common.c b/modules/video_filter/deinterlace/common.c
index d8d794ae2a..953af6930e 100644
--- a/modules/video_filter/deinterlace/common.c
+++ b/modules/video_filter/deinterlace/common.c
@@ -70,10 +70,10 @@ void FlushDeinterlacing(struct deinterlace_ctx *p_context)
     }
 }
 
-mtime_t GetFieldDuration(const struct deinterlace_ctx *p_context,
+vlc_tick_t GetFieldDuration(const struct deinterlace_ctx *p_context,
                          const video_format_t *fmt, const picture_t *p_pic )
 {
-    mtime_t i_field_dur = 0;
+    vlc_tick_t i_field_dur = 0;
 
     /* Calculate one field duration. */
     int i = 0;
@@ -308,7 +308,7 @@ picture_t *DoDeinterlacing( filter_t *p_filter,
             i_frame_offset == CUSTOM_PTS );
     if( i_frame_offset != CUSTOM_PTS )
     {
-        mtime_t i_base_pts = p_context->meta[i_meta_idx].pi_date;
+        vlc_tick_t i_base_pts = p_context->meta[i_meta_idx].pi_date;
 
         /* Note: in the usual case (i_frame_offset = 0  and
                  b_double_rate = false), this effectively does nothing.
@@ -318,7 +318,7 @@ picture_t *DoDeinterlacing( filter_t *p_filter,
 
         if( p_context->settings.b_double_rate )
         {
-            mtime_t i_field_dur = GetFieldDuration( p_context, &p_filter->fmt_out.video, p_pic );
+            vlc_tick_t i_field_dur = GetFieldDuration( p_context, &p_filter->fmt_out.video, p_pic );
             /* Processing all actually allocated output frames. */
             for( int i = 1; i < i_double_rate_alloc_end; ++i )
             {
diff --git a/modules/video_filter/deinterlace/common.h b/modules/video_filter/deinterlace/common.h
index e897c3145a..01bfc2a70d 100644
--- a/modules/video_filter/deinterlace/common.h
+++ b/modules/video_filter/deinterlace/common.h
@@ -47,7 +47,7 @@
  * @see Deinterlace()
  */
 typedef struct {
-    mtime_t pi_date;
+    vlc_tick_t pi_date;
     int     pi_nb_fields;
     bool    pb_top_field_first;
 } metadata_history_t;
@@ -101,7 +101,7 @@ void InitDeinterlacingContext( struct deinterlace_ctx * );
  * @param p_pic the picture which field we want the duration
  * @return the duration of the field or 0 if there's no known framerate
  */
-mtime_t GetFieldDuration( const struct deinterlace_ctx *,
+vlc_tick_t GetFieldDuration( const struct deinterlace_ctx *,
                           const video_format_t *fmt, const picture_t *p_pic );
 
 /**
diff --git a/modules/video_filter/fps.c b/modules/video_filter/fps.c
index d44c6ded6a..2302c1f378 100644
--- a/modules/video_filter/fps.c
+++ b/modules/video_filter/fps.c
@@ -64,7 +64,7 @@ typedef struct
 {
     date_t          next_output_pts; /**< output calculated PTS */
     picture_t       *p_previous_pic;
-    mtime_t         i_output_frame_interval;
+    vlc_tick_t      i_output_frame_interval;
 } filter_sys_t;
 
 static picture_t *Filter( filter_t *p_filter, picture_t *p_picture)
diff --git a/modules/video_filter/grain.c b/modules/video_filter/grain.c
index f8e98a31e7..c3331608d9 100644
--- a/modules/video_filter/grain.c
+++ b/modules/video_filter/grain.c
@@ -335,7 +335,7 @@ static int Generate(int16_t *bank, int h_min, int h_max, int v_min, int v_max)
         }
     }
 
-    //mtime_t tmul_0 = mdate();
+    //vlc_tick_t tmul_0 = mdate();
     for (int i = 0; i < N; i++) {
         for (int j = 0; j < N; j++) {
             double v = 0.0;
@@ -358,7 +358,7 @@ static int Generate(int16_t *bank, int h_min, int h_max, int v_min, int v_max)
             bank[i * N + j] = VLC_CLIP(vq, INT16_MIN, INT16_MAX);
         }
     }
-    //mtime_t mul_duration = mdate() - tmul_0;
+    //vlc_tick_t mul_duration = mdate() - tmul_0;
     //fprintf(stderr, "IDCT took %d ms\n", (int)(mul_duration / 1000));
 
     free(workspace);
diff --git a/modules/video_filter/magnify.c b/modules/video_filter/magnify.c
index 9507f477d3..04b2e7f3ae 100644
--- a/modules/video_filter/magnify.c
+++ b/modules/video_filter/magnify.c
@@ -80,7 +80,7 @@ typedef struct
 
     bool b_visible; /* is "interface" visible ? */
 
-    mtime_t i_last_activity;
+    vlc_tick_t i_last_activity;
 } filter_sys_t;
 
 #define VIS_ZOOM 4
diff --git a/modules/video_filter/oldmovie.c b/modules/video_filter/oldmovie.c
index 04d2dca31c..4529be5485 100644
--- a/modules/video_filter/oldmovie.c
+++ b/modules/video_filter/oldmovie.c
@@ -89,7 +89,7 @@ typedef struct {
     int32_t  i_offset;
     int32_t  i_width;
     uint16_t i_intensity;
-    mtime_t  i_stop_trigger;
+    vlc_tick_t  i_stop_trigger;
 } scratch_t;
 
 typedef struct {
@@ -99,14 +99,14 @@ typedef struct {
     int32_t  i_length;
     int32_t  i_curve;
     uint16_t i_intensity;
-    mtime_t  i_stop_trigger;
+    vlc_tick_t  i_stop_trigger;
 } hair_t;
 
 typedef struct {
     int32_t  i_x, i_y;
     int32_t  i_width;
     uint16_t i_intensity;
-    mtime_t  i_stop_trigger;
+    vlc_tick_t  i_stop_trigger;
 } dust_t;
 
 typedef struct
@@ -118,31 +118,31 @@ typedef struct
     int32_t *i_height;
     int32_t *i_width;
     int32_t *i_visible_pitch;
-    mtime_t i_start_time;
-    mtime_t i_last_time;
-    mtime_t i_cur_time;
+    vlc_tick_t i_start_time;
+    vlc_tick_t i_last_time;
+    vlc_tick_t i_cur_time;
 
     /* sliding & offset effect */
-    mtime_t  i_offset_trigger;
-    mtime_t  i_sliding_trigger;
-    mtime_t  i_sliding_stop_trig;
+    vlc_tick_t  i_offset_trigger;
+    vlc_tick_t  i_sliding_trigger;
+    vlc_tick_t  i_sliding_stop_trig;
     int32_t  i_offset_ofs;
     int32_t  i_sliding_ofs;
     int32_t  i_sliding_speed;
 
     /* scratch on film */
-    mtime_t    i_scratch_trigger;
+    vlc_tick_t  i_scratch_trigger;
     scratch_t *p_scratch[MAX_SCRATCH];
 
     /* hair on lens */
-    mtime_t    i_hair_trigger;
+    vlc_tick_t  i_hair_trigger;
     hair_t    *p_hair[MAX_HAIR];
 
     /* blotch on film */
-    mtime_t    i_blotch_trigger;
+    vlc_tick_t  i_blotch_trigger;
 
     /* dust on lens */
-    mtime_t    i_dust_trigger;
+    vlc_tick_t  i_dust_trigger;
     dust_t    *p_dust[MAX_DUST];
 } filter_sys_t;
 
diff --git a/modules/video_filter/ripple.c b/modules/video_filter/ripple.c
index 536d2df4fe..40379a1eff 100644
--- a/modules/video_filter/ripple.c
+++ b/modules/video_filter/ripple.c
@@ -69,7 +69,7 @@ vlc_module_end ()
 typedef struct
 {
     double  f_angle;
-    mtime_t last_date;
+    vlc_tick_t last_date;
 } filter_sys_t;
 
 /*****************************************************************************
@@ -121,7 +121,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 {
     picture_t *p_outpic;
     double f_angle;
-    mtime_t new_date = mdate();
+    vlc_tick_t new_date = mdate();
 
     if( !p_pic ) return NULL;
 
diff --git a/modules/video_filter/vhs.c b/modules/video_filter/vhs.c
index c9fe7d01df..2c14b1e1c4 100644
--- a/modules/video_filter/vhs.c
+++ b/modules/video_filter/vhs.c
@@ -47,7 +47,7 @@ typedef struct {
     int32_t  i_offset;
     uint16_t i_intensity;
     bool     b_blue_red;
-    mtime_t  i_stop_trigger;
+    vlc_tick_t  i_stop_trigger;
 } blue_red_line_t;
 
 typedef struct
@@ -59,9 +59,9 @@ typedef struct
     int32_t *i_height; /* note: each plane may have different dimensions */
     int32_t *i_width;
     int32_t *i_visible_pitch;
-    mtime_t  i_start_time;
-    mtime_t  i_last_time;
-    mtime_t  i_cur_time;
+    vlc_tick_t  i_start_time;
+    vlc_tick_t  i_last_time;
+    vlc_tick_t  i_cur_time;
 
     /* sliding & offset effect */
     int32_t  i_phase_speed;
@@ -69,13 +69,13 @@ typedef struct
     int32_t  i_offset_ofs;
     int32_t  i_sliding_ofs;
     int32_t  i_sliding_speed;
-    mtime_t  i_offset_trigger;
-    mtime_t  i_sliding_trigger;
-    mtime_t  i_sliding_stop_trig;
+    vlc_tick_t  i_offset_trigger;
+    vlc_tick_t  i_sliding_trigger;
+    vlc_tick_t  i_sliding_stop_trig;
     bool     i_sliding_type_duplicate;
 
     /* blue red lines effect */
-    mtime_t  i_BR_line_trigger;
+    vlc_tick_t  i_BR_line_trigger;
     blue_red_line_t *p_BR_lines[MAX_BLUE_RED_LINES];
 
 } filter_sys_t;
diff --git a/modules/video_filter/wave.c b/modules/video_filter/wave.c
index 0590aaea9d..8570b51328 100644
--- a/modules/video_filter/wave.c
+++ b/modules/video_filter/wave.c
@@ -68,7 +68,7 @@ vlc_module_end ()
 typedef struct
 {
     double  f_angle;
-    mtime_t last_date;
+    vlc_tick_t last_date;
 } filter_sys_t;
 
 /*****************************************************************************
@@ -110,7 +110,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 {
     picture_t *p_outpic;
     double f_angle;
-    mtime_t new_date = mdate();
+    vlc_tick_t new_date = mdate();
 
     if( !p_pic ) return NULL;
 
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 1c89f69342..1e8a3111e4 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -82,7 +82,7 @@ static const vlc_fourcc_t subpicture_chromas[] =
 };
 
 static picture_pool_t   *Pool  (vout_display_t *, unsigned);
-static void             Prepare(vout_display_t *, picture_t *, subpicture_t *, mtime_t);
+static void             Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void             Display(vout_display_t *, picture_t *, subpicture_t *);
 static int              Control(vout_display_t *, int, va_list);
 
@@ -941,7 +941,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned requested_count)
 }
 
 static void Prepare(vout_display_t *vd, picture_t *picture,
-                    subpicture_t *subpicture, mtime_t date)
+                    subpicture_t *subpicture, vlc_tick_t date)
 {
     vout_display_sys_t *sys = vd->sys;
     VLC_UNUSED(picture);
@@ -988,7 +988,7 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
     if (sys->p_window->b_opaque
      && AndroidOpaquePicture_CanReleaseAtTime(picture->p_sys))
     {
-        mtime_t now = mdate();
+        vlc_tick_t now = mdate();
         if (date > now)
         {
             if (date - now <= 1*CLOCK_FREQ)
diff --git a/modules/video_output/android/display.h b/modules/video_output/android/display.h
index e3e91149ec..4e0afcbb12 100644
--- a/modules/video_output/android/display.h
+++ b/modules/video_output/android/display.h
@@ -50,7 +50,7 @@ typedef struct
             void (*pf_release)(decoder_t *p_dec, unsigned int i_index,
                                bool b_render);
             void (*pf_release_ts)(decoder_t *p_dec, unsigned int i_index,
-                                  mtime_t i_ts);
+                                  vlc_tick_t i_ts);
         } hw;
         struct {
             vout_display_sys_t *p_vd_sys;
@@ -123,7 +123,7 @@ AndroidOpaquePicture_Release(picture_sys_t *p_picsys, bool b_render)
 }
 
 static inline void
-AndroidOpaquePicture_ReleaseAtTime(picture_sys_t *p_picsys, mtime_t i_ts)
+AndroidOpaquePicture_ReleaseAtTime(picture_sys_t *p_picsys, vlc_tick_t i_ts)
 {
     if (!p_picsys->b_locked)
         return;
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index 7f161298df..82b315db69 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -57,8 +57,8 @@ struct vout_display_sys_t {
     block_fifo_t *fifo;
     vlc_thread_t thread;
 
-    mtime_t cursor_timeout;
-    mtime_t cursor_deadline;
+    vlc_tick_t cursor_timeout;
+    vlc_tick_t cursor_deadline;
 };
 
 noreturn static void *VoutDisplayEventKeyDispatch(void *data)
@@ -133,7 +133,7 @@ static void Manage(vout_display_t *vd);
 /**
  * Prepare a picture for display */
 static void Prepare(vout_display_t *vd, picture_t *picture,
-                    subpicture_t *subpicture, mtime_t date)
+                    subpicture_t *subpicture, vlc_tick_t date)
 {
     Manage(vd);
     VLC_UNUSED(date);
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index b690ce0f21..ac120be93e 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -61,7 +61,7 @@ vlc_module_end()
 
 static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count);
 static void PictureRender   (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
-                             mtime_t date);
+                             vlc_tick_t date);
 static void PictureDisplay  (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture);
 static int Control          (vout_display_t *vd, int query, va_list ap);
 
@@ -278,7 +278,7 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned count)
 }
 
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
-                           mtime_t date)
+                           vlc_tick_t date)
 {
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index 821c9a805d..3a6d5a227b 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -203,7 +203,7 @@ typedef struct decklink_sys_t
     BMDTimeValue frameduration;
 
     /* XXX: workaround card clock drift */
-    mtime_t offset;
+    vlc_tick_t offset;
 
     /* !With LOCK */
 
@@ -890,10 +890,10 @@ static void send_AFD(uint8_t afdcode, uint8_t ar, uint8_t *buf)
 }
 
 static void PrepareVideo(vout_display_t *vd, picture_t *picture, subpicture_t *,
-                         mtime_t date)
+                         vlc_tick_t date)
 {
     decklink_sys_t *sys = (decklink_sys_t *) vd->sys;
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
 
     if (!picture)
         return;
@@ -1099,7 +1099,7 @@ static void Flush (audio_output_t *aout, bool drain)
         msg_Err(aout, "Flush failed");
 }
 
-static int TimeGet(audio_output_t *, mtime_t* restrict)
+static int TimeGet(audio_output_t *, vlc_tick_t* restrict)
 {
     /* synchronization is handled by the card */
     return -1;
@@ -1124,7 +1124,7 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
     return VLC_SUCCESS;
 }
 
-static void PlayAudio(audio_output_t *aout, block_t *audio, mtime_t systempts)
+static void PlayAudio(audio_output_t *aout, block_t *audio, vlc_tick_t systempts)
 {
     decklink_sys_t *sys = (decklink_sys_t *) aout->sys;
     vlc_mutex_lock(&sys->lock);
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index 36075488b7..ed20827884 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -55,7 +55,7 @@ static int Open(vlc_object_t *);
 static void Close(vlc_object_t *);
 
 static picture_pool_t* PicturePool(vout_display_t *, unsigned);
-static void PictureRender(vout_display_t *, picture_t *, subpicture_t *, mtime_t);
+static void PictureRender(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void PictureDisplay(vout_display_t *, picture_t *, subpicture_t *);
 static int Control(vout_display_t*, int, va_list);
 
@@ -315,7 +315,7 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *sub
 }
 
 static void PictureRender(vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
-                          mtime_t date)
+                          vlc_tick_t date)
 {
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 406281db0d..359836a8ea 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -57,7 +57,7 @@ static void Close (vlc_object_t *);
 
 static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count);
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
-                           mtime_t date);
+                           vlc_tick_t date);
 static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture);
 static int Control (vout_display_t *vd, int query, va_list ap);
 
@@ -319,7 +319,7 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
 }
 
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
-                           mtime_t date)
+                           vlc_tick_t date)
 {
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index 1c22540c36..d0ae442196 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -78,7 +78,7 @@ struct vout_display_sys_t
 
 /* Display callbacks */
 static picture_pool_t *Pool (vout_display_t *, unsigned);
-static void PictureRender (vout_display_t *, picture_t *, subpicture_t *, mtime_t);
+static void PictureRender (vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void PictureDisplay (vout_display_t *, picture_t *, subpicture_t *);
 static int Control (vout_display_t *, int, va_list);
 
@@ -193,7 +193,7 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned count)
 }
 
 static void PictureRender (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
-                           mtime_t date)
+                           vlc_tick_t date)
 {
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
diff --git a/modules/video_output/vdummy.c b/modules/video_output/vdummy.c
index 92a1f50cf3..c2f28b219e 100644
--- a/modules/video_output/vdummy.c
+++ b/modules/video_output/vdummy.c
@@ -148,9 +148,9 @@ static void DisplayStat(vout_display_t *vd, picture_t *picture, subpicture_t *su
     VLC_UNUSED(vd);
     VLC_UNUSED(subpicture);
 
-    if (vd->fmt.i_width * vd->fmt.i_height >= sizeof (mtime_t)
-     && (p->i_pitch * p->i_lines) >= (ssize_t)sizeof (mtime_t)) {
-        mtime_t date;
+    if (vd->fmt.i_width * vd->fmt.i_height >= sizeof (vlc_tick_t)
+     && (p->i_pitch * p->i_lines) >= (ssize_t)sizeof (vlc_tick_t)) {
+        vlc_tick_t date;
         memcpy(&date, p->p_pixels, sizeof(date));
         msg_Dbg(vd, "VOUT got %"PRIu64" ms offset",
                 (mdate() - date) / 1000 );
diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 09b6f31bfe..7edf2974f0 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -105,7 +105,7 @@ typedef unsigned (*vlc_format_cb)(void **, char *, unsigned *, unsigned *,
                                   unsigned *, unsigned *);
 
 static picture_pool_t *Pool  (vout_display_t *, unsigned);
-static void           Prepare(vout_display_t *, picture_t *, subpicture_t *, mtime_t);
+static void           Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void           Display(vout_display_t *, picture_t *, subpicture_t *);
 static int            Control(vout_display_t *, int, va_list);
 
@@ -241,7 +241,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 }
 
 static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
-                    mtime_t date)
+                    vlc_tick_t date)
 {
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
diff --git a/modules/video_output/wayland/input.c b/modules/video_output/wayland/input.c
index 7627e48789..c9a4f7bcc3 100644
--- a/modules/video_output/wayland/input.c
+++ b/modules/video_output/wayland/input.c
@@ -47,8 +47,8 @@ struct seat_data
     struct wl_seat *seat;
 
     struct wl_pointer *pointer;
-    mtime_t cursor_timeout;
-    mtime_t cursor_deadline;
+    vlc_tick_t cursor_timeout;
+    vlc_tick_t cursor_deadline;
     uint32_t cursor_serial;
 
 #ifdef HAVE_XKBCOMMON
@@ -453,12 +453,12 @@ int seat_create(vout_window_t *wnd, struct wl_registry *registry,
     return 0;
 }
 
-static mtime_t seat_next_deadline(const struct seat_data *sd)
+static vlc_tick_t seat_next_deadline(const struct seat_data *sd)
 {
     return (sd->pointer != NULL) ? sd->cursor_deadline : INT64_MAX;
 }
 
-static void seat_refresh(struct seat_data *sd, mtime_t now)
+static void seat_refresh(struct seat_data *sd, vlc_tick_t now)
 {
     if (sd->pointer != NULL && sd->cursor_deadline <= now)
     {   /* Hide cursor */
@@ -512,11 +512,11 @@ void seat_destroy_all(struct wl_list *list)
 int seat_next_timeout(const struct wl_list *list)
 {
     struct seat_data *sd;
-    mtime_t deadline = INT64_MAX;
+    vlc_tick_t deadline = INT64_MAX;
 
     wl_list_for_each(sd, list, node)
     {
-        mtime_t d = seat_next_deadline(sd);
+        vlc_tick_t d = seat_next_deadline(sd);
         if (deadline > d)
             deadline = d;
     }
@@ -524,7 +524,7 @@ int seat_next_timeout(const struct wl_list *list)
     if (deadline == INT64_MAX)
         return -1;
 
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
     if (now >= deadline)
         return 0;
 
@@ -534,7 +534,7 @@ int seat_next_timeout(const struct wl_list *list)
 void seat_timeout(struct wl_list *list)
 {
     struct seat_data *sd;
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
 
     wl_list_for_each(sd, list, node)
         seat_refresh(sd, now);
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 3e80a5d194..89d33b2c87 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -211,7 +211,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned req)
 }
 
 static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
-                    mtime_t date)
+                    vlc_tick_t date)
 {
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 077c62d61a..a9a55d4d9f 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -125,7 +125,7 @@ struct vout_display_sys_t
 
 static picture_pool_t *Pool(vout_display_t *vd, unsigned count);
 
-static void Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture, mtime_t);
+static void Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture, vlc_tick_t);
 static void Display(vout_display_t *, picture_t *, subpicture_t *subpicture);
 
 static void Direct3D11Destroy(vout_display_t *);
@@ -765,7 +765,7 @@ static void Manage(vout_display_t *vd)
 }
 
 static void Prepare(vout_display_t *vd, picture_t *picture,
-                    subpicture_t *subpicture, mtime_t date)
+                    subpicture_t *subpicture, vlc_tick_t date)
 {
     Manage(vd);
     VLC_UNUSED(date);
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index b098d736a7..d91daab237 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -174,7 +174,7 @@ static int  Open(vlc_object_t *);
 static picture_pool_t *Direct3D9CreatePicturePool  (vlc_object_t *, d3d9_device_t *,
      const d3d9_format_t *, const video_format_t *, unsigned);
 
-static void           Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture, mtime_t);
+static void           Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture, vlc_tick_t);
 static void           Display(vout_display_t *, picture_t *, subpicture_t *subpicture);
 static picture_pool_t*DisplayPool(vout_display_t *, unsigned);
 static int            Control(vout_display_t *, int, va_list);
@@ -493,7 +493,7 @@ static picture_pool_t *DisplayPool(vout_display_t *vd, unsigned count)
 }
 
 static void Prepare(vout_display_t *vd, picture_t *picture,
-                    subpicture_t *subpicture, mtime_t date)
+                    subpicture_t *subpicture, vlc_tick_t date)
 {
     Manage(vd);
     VLC_UNUSED(date);
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index f897b0b48d..4611f177cc 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -72,7 +72,7 @@ struct event_thread_t
     HCURSOR cursor_empty;
     unsigned button_pressed;
     int64_t hide_timeout;
-    mtime_t last_moved;
+    vlc_tick_t last_moved;
 
     /* Gestures */
     win32_gesture_sys_t *p_gesture;
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index cb7d383046..0635a184a8 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -67,7 +67,7 @@ struct vout_display_sys_t
 };
 
 static picture_pool_t *Pool  (vout_display_t *, unsigned);
-static void           Prepare(vout_display_t *, picture_t *, subpicture_t *, mtime_t);
+static void           Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void           Display(vout_display_t *, picture_t *, subpicture_t *);
 static void           Manage (vout_display_t *);
 
@@ -210,7 +210,7 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 }
 
 static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture,
-                    mtime_t date)
+                    vlc_tick_t date)
 {
     Manage(vd);
     VLC_UNUSED(date);
diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 793adb3eeb..575179a37d 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -315,9 +315,9 @@ static void *Thread (void *data)
         .events = POLLIN,
     };
     xcb_cursor_t cursor = CursorCreate(conn, p_sys->root); /* blank cursor */
-    mtime_t lifetime = var_InheritInteger(wnd, "mouse-hide-timeout")
+    vlc_tick_t lifetime = var_InheritInteger(wnd, "mouse-hide-timeout")
                        * (CLOCK_FREQ / 1000);
-    mtime_t deadline = INT64_MAX;
+    vlc_tick_t deadline = INT64_MAX;
 
     if (ufd.fd == -1)
         return NULL;
@@ -328,7 +328,7 @@ static void *Thread (void *data)
 
         if (deadline != INT64_MAX)
         {
-            mtime_t delay = deadline - mdate();
+            vlc_tick_t delay = deadline - mdate();
             timeout = (delay > 0) ? delay / (CLOCK_FREQ / 1000) : 0;
         }
 
diff --git a/modules/visualization/cyclic_buffer.h b/modules/visualization/cyclic_buffer.h
index c07f41fa3f..6c7c279e74 100644
--- a/modules/visualization/cyclic_buffer.h
+++ b/modules/visualization/cyclic_buffer.h
@@ -28,7 +28,7 @@ class block_holder
 {
 public:
     float data[512]; // data holder
-    mtime_t pts; // machine time when this is to be played
+    vlc_tick_t pts; // machine time when this is to be played
     block_holder()
     {
         pts = 0; // max_int 64-bit
@@ -50,7 +50,7 @@ public:
 
     block_holder* consume()
     {
-        mtime_t cur_machine_time = mdate();
+        vlc_tick_t cur_machine_time = mdate();
         size_t steps = 0;
         while (
                (cycl_buffer[consumer_pos].pts < cur_machine_time)
diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
index d42cd5a7af..d2f0e6fac6 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -347,7 +347,7 @@ static void *Thread( void *p_data )
     /* */
     for( ;; )
     {
-        const mtime_t i_deadline = mdate() + CLOCK_FREQ / 50; /* 50 fps max */
+        const vlc_tick_t i_deadline = mdate() + CLOCK_FREQ / 50; /* 50 fps max */
 
         /* Manage the events */
         unsigned width, height;
diff --git a/src/android/thread.c b/src/android/thread.c
index dd6421f606..ae5025abab 100644
--- a/src/android/thread.c
+++ b/src/android/thread.c
@@ -409,7 +409,7 @@ void *vlc_threadvar_get (vlc_threadvar_t key)
 }
 
 /* time */
-mtime_t mdate (void)
+vlc_tick_t mdate (void)
 {
     struct timespec ts;
 
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 49e6e8e3b9..8b5ff1bf26 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -70,9 +70,9 @@ typedef struct
 
     struct
     {
-        mtime_t end; /**< Last seen PTS */
+        vlc_tick_t end; /**< Last seen PTS */
         float rate; /**< Play-out speed rate */
-        mtime_t resamp_start_drift; /**< Resampler drift absolute value */
+        vlc_tick_t resamp_start_drift; /**< Resampler drift absolute value */
         int resamp_type; /**< Resampler mode (FIXME: redundant / resampling) */
         bool discontinuity;
     } sync;
@@ -143,7 +143,7 @@ int aout_DecNew(audio_output_t *, const audio_sample_format_t *,
 void aout_DecDelete(audio_output_t *);
 int aout_DecPlay(audio_output_t *aout, block_t *block);
 void aout_DecGetResetStats(audio_output_t *, unsigned *, unsigned *);
-void aout_DecChangePause(audio_output_t *, bool b_paused, mtime_t i_date);
+void aout_DecChangePause(audio_output_t *, bool b_paused, vlc_tick_t i_date);
 void aout_DecChangeRate(audio_output_t *aout, float rate);
 void aout_DecFlush(audio_output_t *, bool wait);
 void aout_RequestRestart (audio_output_t *, unsigned);
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 4a0a42ff10..008a34c2b6 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -205,7 +205,7 @@ static void aout_StopResampling (audio_output_t *aout)
     aout_FiltersAdjustResampling (owner->filters, 0);
 }
 
-static void aout_DecSilence (audio_output_t *aout, mtime_t length, mtime_t pts)
+static void aout_DecSilence (audio_output_t *aout, vlc_tick_t length, vlc_tick_t pts)
 {
     aout_owner_t *owner = aout_owner (aout);
     const audio_sample_format_t *fmt = &owner->mixer_format;
@@ -225,11 +225,11 @@ static void aout_DecSilence (audio_output_t *aout, mtime_t length, mtime_t pts)
     aout->play(aout, block, pts);
 }
 
-static void aout_DecSynchronize(audio_output_t *aout, mtime_t dec_pts)
+static void aout_DecSynchronize(audio_output_t *aout, vlc_tick_t dec_pts)
 {
     aout_owner_t *owner = aout_owner (aout);
     const float rate = owner->sync.rate;
-    mtime_t drift;
+    vlc_tick_t drift;
 
     /**
      * Depending on the drift between the actual and intended playback times,
@@ -405,7 +405,7 @@ void aout_DecGetResetStats(audio_output_t *aout, unsigned *restrict lost,
                                        memory_order_relaxed);
 }
 
-void aout_DecChangePause (audio_output_t *aout, bool paused, mtime_t date)
+void aout_DecChangePause (audio_output_t *aout, bool paused, vlc_tick_t date)
 {
     aout_owner_t *owner = aout_owner (aout);
 
diff --git a/src/clock/clock_internal.c b/src/clock/clock_internal.c
index 77f9758aaa..49711cbf01 100644
--- a/src/clock/clock_internal.c
+++ b/src/clock/clock_internal.c
@@ -48,12 +48,12 @@ void AvgReset( average_t *p_avg )
     p_avg->i_count = 0;
 }
 
-void AvgUpdate( average_t *p_avg, mtime_t i_value )
+void AvgUpdate( average_t *p_avg, vlc_tick_t i_value )
 {
     const int i_f0 = __MIN( p_avg->i_divider - 1, p_avg->i_count );
     const int i_f1 = p_avg->i_divider - i_f0;
 
-    const mtime_t i_tmp = i_f0 * p_avg->i_value + i_f1 * i_value + p_avg->i_residue;
+    const vlc_tick_t i_tmp = i_f0 * p_avg->i_value + i_f1 * i_value + p_avg->i_residue;
 
     p_avg->i_value   = i_tmp / p_avg->i_divider;
     p_avg->i_residue = i_tmp % p_avg->i_divider;
@@ -61,14 +61,14 @@ void AvgUpdate( average_t *p_avg, mtime_t i_value )
     p_avg->i_count++;
 }
 
-mtime_t AvgGet( average_t *p_avg )
+vlc_tick_t AvgGet( average_t *p_avg )
 {
     return p_avg->i_value;
 }
 
 void AvgRescale( average_t *p_avg, int i_divider )
 {
-    const mtime_t i_tmp = p_avg->i_value * p_avg->i_divider + p_avg->i_residue;
+    const vlc_tick_t i_tmp = p_avg->i_value * p_avg->i_divider + p_avg->i_residue;
 
     p_avg->i_divider = i_divider;
     p_avg->i_value   = i_tmp / p_avg->i_divider;
diff --git a/src/clock/clock_internal.h b/src/clock/clock_internal.h
index d974901cff..21da59c075 100644
--- a/src/clock/clock_internal.h
+++ b/src/clock/clock_internal.h
@@ -32,7 +32,7 @@
  */
 typedef struct
 {
-    mtime_t i_value;
+    vlc_tick_t i_value;
     int     i_residue;
 
     int     i_count;
@@ -43,18 +43,18 @@ void    AvgInit( average_t *, int i_divider );
 void    AvgClean( average_t * );
 
 void    AvgReset( average_t * );
-void    AvgUpdate( average_t *, mtime_t i_value );
-mtime_t AvgGet( average_t * );
+void    AvgUpdate( average_t *, vlc_tick_t i_value );
+vlc_tick_t AvgGet( average_t * );
 void    AvgRescale( average_t *, int i_divider );
 
 /* */
 typedef struct
 {
-    mtime_t i_stream;
-    mtime_t i_system;
+    vlc_tick_t i_stream;
+    vlc_tick_t i_system;
 } clock_point_t;
 
-static inline clock_point_t clock_point_Create( mtime_t i_stream, mtime_t i_system )
+static inline clock_point_t clock_point_Create( vlc_tick_t i_stream, vlc_tick_t i_system )
 {
     clock_point_t p = { .i_stream = i_stream, .i_system = i_system };
     return p;
diff --git a/src/clock/input_clock.c b/src/clock/input_clock.c
index a69ed53e32..0e75174ae2 100644
--- a/src/clock/input_clock.c
+++ b/src/clock/input_clock.c
@@ -113,19 +113,19 @@ struct input_clock_t
     clock_point_t last;
 
     /* Maximal timestamp returned by input_clock_ConvertTS (in system unit) */
-    mtime_t i_ts_max;
+    vlc_tick_t i_ts_max;
 
     /* Amount of extra buffering expressed in stream clock */
-    mtime_t i_buffering_duration;
+    vlc_tick_t i_buffering_duration;
 
     /* Clock drift */
-    mtime_t i_next_drift_update;
+    vlc_tick_t i_next_drift_update;
     average_t drift;
 
     /* Late statistics */
     struct
     {
-        mtime_t  pi_value[INPUT_CLOCK_LATE_COUNT];
+        vlc_tick_t  pi_value[INPUT_CLOCK_LATE_COUNT];
         unsigned i_index;
     } late;
 
@@ -134,20 +134,20 @@ struct input_clock_t
     bool          b_has_reference;
 
     /* External clock drift */
-    mtime_t       i_external_clock;
+    vlc_tick_t    i_external_clock;
     bool          b_has_external_clock;
 
     /* Current modifiers */
     bool    b_paused;
     int     i_rate;
-    mtime_t i_pts_delay;
-    mtime_t i_pause_date;
+    vlc_tick_t i_pts_delay;
+    vlc_tick_t i_pause_date;
 };
 
-static mtime_t ClockStreamToSystem( input_clock_t *, mtime_t i_stream );
-static mtime_t ClockSystemToStream( input_clock_t *, mtime_t i_system );
+static vlc_tick_t ClockStreamToSystem( input_clock_t *, vlc_tick_t i_stream );
+static vlc_tick_t ClockSystemToStream( input_clock_t *, vlc_tick_t i_system );
 
-static mtime_t ClockGetTsOffset( input_clock_t * );
+static vlc_tick_t ClockGetTsOffset( input_clock_t * );
 
 /*****************************************************************************
  * input_clock_New: create a new clock
@@ -203,7 +203,7 @@ void input_clock_Delete( input_clock_t *cl )
 void input_clock_Update( input_clock_t *cl, vlc_object_t *p_log,
                          bool *pb_late,
                          bool b_can_pace_control, bool b_buffering_allowed,
-                         mtime_t i_ck_stream, mtime_t i_ck_system )
+                         vlc_tick_t i_ck_stream, vlc_tick_t i_ck_system )
 {
     bool b_reset_reference = false;
 
@@ -248,7 +248,7 @@ void input_clock_Update( input_clock_t *cl, vlc_object_t *p_log,
      * when we don't control the source pace */
     if( !b_can_pace_control && cl->i_next_drift_update < i_ck_system )
     {
-        const mtime_t i_converted = ClockSystemToStream( cl, i_ck_system );
+        const vlc_tick_t i_converted = ClockSystemToStream( cl, i_ck_system );
 
         AvgUpdate( &cl->drift, i_converted - i_ck_stream );
 
@@ -265,7 +265,7 @@ void input_clock_Update( input_clock_t *cl, vlc_object_t *p_log,
         /* Try to bufferize more than necessary by reading
          * CR_BUFFERING_RATE/256 faster until we have CR_BUFFERING_TARGET.
          */
-        const mtime_t i_duration = __MAX( i_ck_stream - cl->last.i_stream, 0 );
+        const vlc_tick_t i_duration = __MAX( i_ck_stream - cl->last.i_stream, 0 );
 
         cl->i_buffering_duration += ( i_duration * CR_BUFFERING_RATE + 255 ) / 256;
         if( cl->i_buffering_duration > CR_BUFFERING_TARGET )
@@ -278,8 +278,8 @@ void input_clock_Update( input_clock_t *cl, vlc_object_t *p_log,
 
     /* It does not take the decoder latency into account but it is not really
      * the goal of the clock here */
-    const mtime_t i_system_expected = ClockStreamToSystem( cl, i_ck_stream + AvgGet( &cl->drift ) );
-    const mtime_t i_late = ( i_ck_system - cl->i_pts_delay ) - i_system_expected;
+    const vlc_tick_t i_system_expected = ClockStreamToSystem( cl, i_ck_stream + AvgGet( &cl->drift ) );
+    const vlc_tick_t i_late = ( i_ck_system - cl->i_pts_delay ) - i_system_expected;
     *pb_late = i_late > 0;
     if( i_late > 0 )
     {
@@ -326,14 +326,14 @@ void input_clock_ChangeRate( input_clock_t *cl, int i_rate )
 /*****************************************************************************
  * input_clock_ChangePause:
  *****************************************************************************/
-void input_clock_ChangePause( input_clock_t *cl, bool b_paused, mtime_t i_date )
+void input_clock_ChangePause( input_clock_t *cl, bool b_paused, vlc_tick_t i_date )
 {
     vlc_mutex_lock( &cl->lock );
     assert( (!cl->b_paused) != (!b_paused) );
 
     if( cl->b_paused )
     {
-        const mtime_t i_duration = i_date - cl->i_pause_date;
+        const vlc_tick_t i_duration = i_date - cl->i_pause_date;
 
         if( cl->b_has_reference && i_duration > 0 )
         {
@@ -350,9 +350,9 @@ void input_clock_ChangePause( input_clock_t *cl, bool b_paused, mtime_t i_date )
 /*****************************************************************************
  * input_clock_GetWakeup
  *****************************************************************************/
-mtime_t input_clock_GetWakeup( input_clock_t *cl )
+vlc_tick_t input_clock_GetWakeup( input_clock_t *cl )
 {
-    mtime_t i_wakeup = 0;
+    vlc_tick_t i_wakeup = 0;
 
     vlc_mutex_lock( &cl->lock );
 
@@ -369,8 +369,8 @@ mtime_t input_clock_GetWakeup( input_clock_t *cl )
  * input_clock_ConvertTS
  *****************************************************************************/
 int input_clock_ConvertTS( vlc_object_t *p_object, input_clock_t *cl,
-                           int *pi_rate, mtime_t *pi_ts0, mtime_t *pi_ts1,
-                           mtime_t i_ts_bound )
+                           int *pi_rate, vlc_tick_t *pi_ts0, vlc_tick_t *pi_ts1,
+                           vlc_tick_t i_ts_bound )
 {
     assert( pi_ts0 );
     vlc_mutex_lock( &cl->lock );
@@ -390,8 +390,8 @@ int input_clock_ConvertTS( vlc_object_t *p_object, input_clock_t *cl,
     }
 
     /* */
-    const mtime_t i_ts_buffering = cl->i_buffering_duration * cl->i_rate / INPUT_RATE_DEFAULT;
-    const mtime_t i_ts_delay = cl->i_pts_delay + ClockGetTsOffset( cl );
+    const vlc_tick_t i_ts_buffering = cl->i_buffering_duration * cl->i_rate / INPUT_RATE_DEFAULT;
+    const vlc_tick_t i_ts_delay = cl->i_pts_delay + ClockGetTsOffset( cl );
 
     /* */
     if( *pi_ts0 != VLC_TS_INVALID )
@@ -439,8 +439,8 @@ int input_clock_GetRate( input_clock_t *cl )
 }
 
 int input_clock_GetState( input_clock_t *cl,
-                          mtime_t *pi_stream_start, mtime_t *pi_system_start,
-                          mtime_t *pi_stream_duration, mtime_t *pi_system_duration )
+                          vlc_tick_t *pi_stream_start, vlc_tick_t *pi_system_start,
+                          vlc_tick_t *pi_stream_duration, vlc_tick_t *pi_system_duration )
 {
     vlc_mutex_lock( &cl->lock );
 
@@ -461,12 +461,12 @@ int input_clock_GetState( input_clock_t *cl,
     return VLC_SUCCESS;
 }
 
-void input_clock_ChangeSystemOrigin( input_clock_t *cl, bool b_absolute, mtime_t i_system )
+void input_clock_ChangeSystemOrigin( input_clock_t *cl, bool b_absolute, vlc_tick_t i_system )
 {
     vlc_mutex_lock( &cl->lock );
 
     assert( cl->b_has_reference );
-    mtime_t i_offset;
+    vlc_tick_t i_offset;
     if( b_absolute )
     {
         i_offset = i_system - cl->ref.i_system - ClockGetTsOffset( cl );
@@ -487,7 +487,7 @@ void input_clock_ChangeSystemOrigin( input_clock_t *cl, bool b_absolute, mtime_t
     vlc_mutex_unlock( &cl->lock );
 }
 
-void input_clock_GetSystemOrigin( input_clock_t *cl, mtime_t *pi_system, mtime_t *pi_delay )
+void input_clock_GetSystemOrigin( input_clock_t *cl, vlc_tick_t *pi_system, vlc_tick_t *pi_delay )
 {
     vlc_mutex_lock( &cl->lock );
 
@@ -502,13 +502,13 @@ void input_clock_GetSystemOrigin( input_clock_t *cl, mtime_t *pi_system, mtime_t
 
 #warning "input_clock_SetJitter needs more work"
 void input_clock_SetJitter( input_clock_t *cl,
-                            mtime_t i_pts_delay, int i_cr_average )
+                            vlc_tick_t i_pts_delay, int i_cr_average )
 {
     vlc_mutex_lock( &cl->lock );
 
     /* Update late observations */
-    const mtime_t i_delay_delta = i_pts_delay - cl->i_pts_delay;
-    mtime_t pi_late[INPUT_CLOCK_LATE_COUNT];
+    const vlc_tick_t i_delay_delta = i_pts_delay - cl->i_pts_delay;
+    vlc_tick_t pi_late[INPUT_CLOCK_LATE_COUNT];
     for( int i = 0; i < INPUT_CLOCK_LATE_COUNT; i++ )
         pi_late[i] = __MAX( cl->late.pi_value[(cl->late.i_index + 1 + i)%INPUT_CLOCK_LATE_COUNT] - i_delay_delta, 0 );
 
@@ -540,7 +540,7 @@ void input_clock_SetJitter( input_clock_t *cl,
     vlc_mutex_unlock( &cl->lock );
 }
 
-mtime_t input_clock_GetJitter( input_clock_t *cl )
+vlc_tick_t input_clock_GetJitter( input_clock_t *cl )
 {
     vlc_mutex_lock( &cl->lock );
 
@@ -553,9 +553,9 @@ mtime_t input_clock_GetJitter( input_clock_t *cl )
      * XXX we only increase pts_delay over time, decreasing it is
      * not that easy if we want to be robust.
      */
-    const mtime_t *p = cl->late.pi_value;
-    mtime_t i_late_median = p[0] + p[1] + p[2] - __MIN(__MIN(p[0],p[1]),p[2]) - __MAX(__MAX(p[0],p[1]),p[2]);
-    mtime_t i_pts_delay = cl->i_pts_delay ;
+    const vlc_tick_t *p = cl->late.pi_value;
+    vlc_tick_t i_late_median = p[0] + p[1] + p[2] - __MIN(__MIN(p[0],p[1]),p[2]) - __MAX(__MAX(p[0],p[1]),p[2]);
+    vlc_tick_t i_pts_delay = cl->i_pts_delay ;
 
     vlc_mutex_unlock( &cl->lock );
 
@@ -565,7 +565,7 @@ mtime_t input_clock_GetJitter( input_clock_t *cl )
 /*****************************************************************************
  * ClockStreamToSystem: converts a movie clock to system date
  *****************************************************************************/
-static mtime_t ClockStreamToSystem( input_clock_t *cl, mtime_t i_stream )
+static vlc_tick_t ClockStreamToSystem( input_clock_t *cl, vlc_tick_t i_stream )
 {
     if( !cl->b_has_reference )
         return VLC_TS_INVALID;
@@ -579,7 +579,7 @@ static mtime_t ClockStreamToSystem( input_clock_t *cl, mtime_t i_stream )
  *****************************************************************************
  * Caution : a valid reference point is needed for this to operate.
  *****************************************************************************/
-static mtime_t ClockSystemToStream( input_clock_t *cl, mtime_t i_system )
+static vlc_tick_t ClockSystemToStream( input_clock_t *cl, vlc_tick_t i_system )
 {
     assert( cl->b_has_reference );
     return ( i_system - cl->ref.i_system ) * INPUT_RATE_DEFAULT / cl->i_rate +
@@ -590,7 +590,7 @@ static mtime_t ClockSystemToStream( input_clock_t *cl, mtime_t i_system )
  * It returns timestamp display offset due to ref/last modfied on rate changes
  * It ensures that currently converted dates are not changed.
  */
-static mtime_t ClockGetTsOffset( input_clock_t *cl )
+static vlc_tick_t ClockGetTsOffset( input_clock_t *cl )
 {
     return cl->i_pts_delay * ( cl->i_rate - INPUT_RATE_DEFAULT ) / INPUT_RATE_DEFAULT;
 }
diff --git a/src/clock/input_clock.h b/src/clock/input_clock.h
index e7210af75e..56518dc8e8 100644
--- a/src/clock/input_clock.h
+++ b/src/clock/input_clock.h
@@ -56,7 +56,7 @@ void           input_clock_Delete( input_clock_t * );
 void    input_clock_Update( input_clock_t *, vlc_object_t *p_log,
                             bool *pb_late,
                             bool b_can_pace_control, bool b_buffering_allowed,
-                            mtime_t i_clock, mtime_t i_system );
+                            vlc_tick_t i_clock, vlc_tick_t i_system );
 /**
  * This function will reset the drift of a input_clock_t.
  *
@@ -67,7 +67,7 @@ void    input_clock_Reset( input_clock_t * );
 /**
  * This functions will return a deadline used to control the reading speed.
  */
-mtime_t input_clock_GetWakeup( input_clock_t * );
+vlc_tick_t input_clock_GetWakeup( input_clock_t * );
 
 /**
  * This functions allows changing the actual reading speed.
@@ -77,13 +77,13 @@ void    input_clock_ChangeRate( input_clock_t *, int i_rate );
 /**
  * This function allows changing the pause status.
  */
-void    input_clock_ChangePause( input_clock_t *, bool b_paused, mtime_t i_date );
+void    input_clock_ChangePause( input_clock_t *, bool b_paused, vlc_tick_t i_date );
 
 /**
  * This function returns the original system value date and the delay for the current
  * reference point (a valid reference point must have been set).
  */
-void    input_clock_GetSystemOrigin( input_clock_t *, mtime_t *pi_system, mtime_t *pi_delay );
+void    input_clock_GetSystemOrigin( input_clock_t *, vlc_tick_t *pi_system, vlc_tick_t *pi_delay );
 
 /**
  * This function allows rebasing the original system value date (a valid
@@ -91,7 +91,7 @@ void    input_clock_GetSystemOrigin( input_clock_t *, mtime_t *pi_system, mtime_
  * When using the absolute mode, it will create a discontinuity unless
  * called imediatly after a input_clock_Update.
  */
-void    input_clock_ChangeSystemOrigin( input_clock_t *, bool b_absolute, mtime_t i_system );
+void    input_clock_ChangeSystemOrigin( input_clock_t *, bool b_absolute, vlc_tick_t i_system );
 
 /**
  * This function converts a pair of timestamp from stream clock to system clock.
@@ -108,7 +108,7 @@ void    input_clock_ChangeSystemOrigin( input_clock_t *, bool b_absolute, mtime_
  * Otherwise it will return VLC_SUCCESS.
  */
 int input_clock_ConvertTS( vlc_object_t *, input_clock_t *, int *pi_rate,
-                           mtime_t *pi_ts0, mtime_t *pi_ts1, mtime_t i_ts_bound );
+                           vlc_tick_t *pi_ts0, vlc_tick_t *pi_ts1, vlc_tick_t i_ts_bound );
 
 /**
  * This function returns the current rate.
@@ -120,19 +120,19 @@ int input_clock_GetRate( input_clock_t * );
  * reference point.
  */
 int input_clock_GetState( input_clock_t *,
-                          mtime_t *pi_stream_start, mtime_t *pi_system_start,
-                          mtime_t *pi_stream_duration, mtime_t *pi_system_duration );
+                          vlc_tick_t *pi_stream_start, vlc_tick_t *pi_system_start,
+                          vlc_tick_t *pi_stream_duration, vlc_tick_t *pi_system_duration );
 
 /**
  * This function allows the set the minimal configuration for the jitter estimation algo.
  */
 void input_clock_SetJitter( input_clock_t *,
-                            mtime_t i_pts_delay, int i_cr_average );
+                            vlc_tick_t i_pts_delay, int i_cr_average );
 
 /**
  * This function returns an estimation of the pts_delay needed to avoid rebufferization.
  * XXX in the current implementation, the pts_delay will never be decreased.
  */
-mtime_t input_clock_GetJitter( input_clock_t * );
+vlc_tick_t input_clock_GetJitter( input_clock_t * );
 
 #endif
diff --git a/src/darwin/thread.c b/src/darwin/thread.c
index 22660c0ee8..3a906af4fc 100644
--- a/src/darwin/thread.c
+++ b/src/darwin/thread.c
@@ -55,7 +55,7 @@ static pthread_once_t vlc_clock_once = PTHREAD_ONCE_INIT;
 #define vlc_clock_setup() \
     pthread_once(&vlc_clock_once, vlc_clock_setup_once)
 
-static struct timespec mtime_to_ts (mtime_t date)
+static struct timespec mtime_to_ts (vlc_tick_t date)
 {
     lldiv_t d = lldiv (date, CLOCK_FREQ);
     struct timespec ts = { d.quot, d.rem * (1000000000 / CLOCK_FREQ) };
@@ -244,7 +244,7 @@ void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
 }
 
 int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
-                        mtime_t deadline)
+                        vlc_tick_t deadline)
 {
     /* according to POSIX standards, cond_timedwait should be a cancellation point
      * Of course, Darwin does not care */
@@ -254,7 +254,7 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
      * mdate() is the monotonic clock, pthread_cond_timedwait expects
      * origin of gettimeofday(). Use timedwait_relative_np() instead.
      */
-    mtime_t base = mdate();
+    vlc_tick_t base = mdate();
     deadline -= base;
     if (deadline < 0)
         deadline = 0;
@@ -519,7 +519,7 @@ void vlc_control_cancel (int cmd, ...)
     vlc_assert_unreachable ();
 }
 
-mtime_t mdate (void)
+vlc_tick_t mdate (void)
 {
     vlc_clock_setup();
     uint64_t date = mach_absolute_time();
@@ -537,7 +537,7 @@ mtime_t mdate (void)
 }
 
 #undef mwait
-void mwait (mtime_t deadline)
+void mwait (vlc_tick_t deadline)
 {
     deadline -= mdate ();
     if (deadline > 0)
@@ -545,7 +545,7 @@ void mwait (mtime_t deadline)
 }
 
 #undef msleep
-void msleep (mtime_t delay)
+void msleep (vlc_tick_t delay)
 {
     struct timespec ts = mtime_to_ts (delay);
 
diff --git a/src/input/control.c b/src/input/control.c
index e92ab3a3f8..c61526275e 100644
--- a/src/input/control.c
+++ b/src/input/control.c
@@ -562,15 +562,15 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
 
         case INPUT_GET_PCR_SYSTEM:
         {
-            mtime_t *pi_system = va_arg( args, mtime_t * );
-            mtime_t *pi_delay  = va_arg( args, mtime_t * );
+            vlc_tick_t *pi_system = va_arg( args, vlc_tick_t * );
+            vlc_tick_t *pi_delay  = va_arg( args, vlc_tick_t * );
             return es_out_ControlGetPcrSystem( priv->p_es_out_display, pi_system, pi_delay );
         }
 
         case INPUT_MODIFY_PCR_SYSTEM:
         {
             bool b_absolute = va_arg( args, int );
-            mtime_t i_system = va_arg( args, mtime_t );
+            vlc_tick_t i_system = va_arg( args, vlc_tick_t );
             return es_out_ControlModifyPcrSystem( priv->p_es_out_display, b_absolute, i_system );
         }
 
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 9bc7fe32be..862c0447e6 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -110,9 +110,9 @@ struct decoder_owner
 
     /* -- Theses variables need locking on read *and* write -- */
     /* Preroll */
-    mtime_t i_preroll_end;
+    vlc_tick_t i_preroll_end;
     /* Pause & Rate */
-    mtime_t pause_date;
+    vlc_tick_t pause_date;
     float rate;
     unsigned frames_countdown;
     bool paused;
@@ -140,12 +140,12 @@ struct decoder_owner
     } cc;
 
     /* Delay */
-    mtime_t i_ts_delay;
+    vlc_tick_t i_ts_delay;
 };
 
 /* Pictures which are DECODER_BOGUS_VIDEO_DELAY or more in advance probably have
  * a bogus PTS and won't be displayed */
-#define DECODER_BOGUS_VIDEO_DELAY                ((mtime_t)(DEFAULT_PTS_DELAY * 30))
+#define DECODER_BOGUS_VIDEO_DELAY                ((vlc_tick_t)(DEFAULT_PTS_DELAY * 30))
 
 /* */
 #define DECODER_SPU_VOUT_WAIT_DURATION   (CLOCK_FREQ/5)
@@ -623,7 +623,7 @@ static int DecoderGetInputAttachments( decoder_t *p_dec,
                           ppp_attachment, pi_attachment );
 }
 
-static mtime_t DecoderGetDisplayDate( decoder_t *p_dec, mtime_t i_ts )
+static vlc_tick_t DecoderGetDisplayDate( decoder_t *p_dec, vlc_tick_t i_ts )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
@@ -705,7 +705,7 @@ static void DecoderWaitUnblock( decoder_t *p_dec )
 
 /* DecoderTimedWait: Interruptible wait
  * Returns VLC_SUCCESS if wait was not interrupted, and VLC_EGENERIC otherwise */
-static int DecoderTimedWait( decoder_t *p_dec, mtime_t deadline )
+static int DecoderTimedWait( decoder_t *p_dec, vlc_tick_t deadline )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
@@ -721,29 +721,29 @@ static int DecoderTimedWait( decoder_t *p_dec, mtime_t deadline )
     return ret;
 }
 
-static inline void DecoderUpdatePreroll( mtime_t *pi_preroll, const block_t *p )
+static inline void DecoderUpdatePreroll( vlc_tick_t *pi_preroll, const block_t *p )
 {
     if( p->i_flags & BLOCK_FLAG_PREROLL )
-        *pi_preroll = (mtime_t)INT64_MAX;
+        *pi_preroll = (vlc_tick_t)INT64_MAX;
     /* Check if we can use the packet for end of preroll */
     else if( (p->i_flags & BLOCK_FLAG_DISCONTINUITY) &&
              (p->i_buffer == 0 || (p->i_flags & BLOCK_FLAG_CORRUPTED)) )
-        *pi_preroll = (mtime_t)INT64_MAX;
+        *pi_preroll = (vlc_tick_t)INT64_MAX;
     else if( p->i_dts != VLC_TS_INVALID )
         *pi_preroll = __MIN( *pi_preroll, p->i_dts );
     else if( p->i_pts != VLC_TS_INVALID )
         *pi_preroll = __MIN( *pi_preroll, p->i_pts );
 }
 
-static void DecoderFixTs( decoder_t *p_dec, mtime_t *pi_ts0, mtime_t *pi_ts1,
-                          mtime_t *pi_duration, int *pi_rate, mtime_t i_ts_bound )
+static void DecoderFixTs( decoder_t *p_dec, vlc_tick_t *pi_ts0, vlc_tick_t *pi_ts1,
+                          vlc_tick_t *pi_duration, int *pi_rate, vlc_tick_t i_ts_bound )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
     input_clock_t   *p_clock = p_owner->p_clock;
 
     vlc_assert_locked( &p_owner->lock );
 
-    const mtime_t i_es_delay = p_owner->i_ts_delay;
+    const vlc_tick_t i_es_delay = p_owner->i_ts_delay;
 
     if( !p_clock )
         return;
@@ -968,8 +968,8 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
         return;
     }
 
-    prerolled = p_owner->i_preroll_end > (mtime_t)INT64_MIN;
-    p_owner->i_preroll_end = (mtime_t)INT64_MIN;
+    prerolled = p_owner->i_preroll_end > (vlc_tick_t)INT64_MIN;
+    p_owner->i_preroll_end = (vlc_tick_t)INT64_MIN;
     vlc_mutex_unlock( &p_owner->lock );
 
     if( unlikely(prerolled) )
@@ -1108,8 +1108,8 @@ static void DecoderPlayAudio( decoder_t *p_dec, block_t *p_audio,
         return;
     }
 
-    prerolled = p_owner->i_preroll_end > (mtime_t)INT64_MIN;
-    p_owner->i_preroll_end = (mtime_t)INT64_MIN;
+    prerolled = p_owner->i_preroll_end > (vlc_tick_t)INT64_MIN;
+    p_owner->i_preroll_end = (vlc_tick_t)INT64_MIN;
     vlc_mutex_unlock( &p_owner->lock );
 
     if( unlikely(prerolled) )
@@ -1482,11 +1482,11 @@ static void DecoderProcessFlush( decoder_t *p_dec )
     }
 
     vlc_mutex_lock( &p_owner->lock );
-    p_owner->i_preroll_end = (mtime_t)INT64_MIN;
+    p_owner->i_preroll_end = (vlc_tick_t)INT64_MIN;
     vlc_mutex_unlock( &p_owner->lock );
 }
 
-static void OutputChangePause( decoder_t *p_dec, bool paused, mtime_t date )
+static void OutputChangePause( decoder_t *p_dec, bool paused, vlc_tick_t date )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
@@ -1570,7 +1570,7 @@ static void *DecoderThread( void *p_data )
         if( paused != p_owner->paused )
         {   /* Update playing/paused status of the output */
             int canc = vlc_savecancel();
-            mtime_t date = p_owner->pause_date;
+            vlc_tick_t date = p_owner->pause_date;
 
             paused = p_owner->paused;
             vlc_fifo_Unlock( p_owner->p_fifo );
@@ -1701,7 +1701,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
         return NULL;
     p_dec = &p_owner->dec;
 
-    p_owner->i_preroll_end = (mtime_t)INT64_MIN;
+    p_owner->i_preroll_end = (vlc_tick_t)INT64_MIN;
     p_owner->i_last_rate = INPUT_RATE_DEFAULT;
     p_owner->p_input = p_input;
     p_owner->p_resource = p_resource;
@@ -2292,7 +2292,7 @@ int input_DecoderGetCcState( decoder_t *p_dec, vlc_fourcc_t codec,
     return VLC_SUCCESS;
 }
 
-void input_DecoderChangePause( decoder_t *p_dec, bool b_paused, mtime_t i_date )
+void input_DecoderChangePause( decoder_t *p_dec, bool b_paused, vlc_tick_t i_date )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
@@ -2317,7 +2317,7 @@ void input_DecoderChangeRate( decoder_t *dec, float rate )
     vlc_fifo_Unlock( owner->p_fifo );
 }
 
-void input_DecoderChangeDelay( decoder_t *p_dec, mtime_t i_delay )
+void input_DecoderChangeDelay( decoder_t *p_dec, vlc_tick_t i_delay )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
@@ -2378,7 +2378,7 @@ void input_DecoderWait( decoder_t *p_dec )
     vlc_mutex_unlock( &p_owner->lock );
 }
 
-void input_DecoderFrameNext( decoder_t *p_dec, mtime_t *pi_duration )
+void input_DecoderFrameNext( decoder_t *p_dec, vlc_tick_t *pi_duration )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
diff --git a/src/input/decoder.h b/src/input/decoder.h
index eecd68499d..2cfda8cc54 100644
--- a/src/input/decoder.h
+++ b/src/input/decoder.h
@@ -36,7 +36,7 @@ decoder_t *input_DecoderNew( input_thread_t *, es_format_t *, input_clock_t *,
  * The date parameter MUST hold the exact date at which the change has been
  * done for proper vout/aout pausing.
  */
-void input_DecoderChangePause( decoder_t *, bool b_paused, mtime_t i_date );
+void input_DecoderChangePause( decoder_t *, bool b_paused, vlc_tick_t i_date );
 
 /**
  * Changes the decoder rate.
@@ -50,7 +50,7 @@ void input_DecoderChangeRate( decoder_t *dec, float rate );
 /**
  * This function changes the delay.
  */
-void input_DecoderChangeDelay( decoder_t *, mtime_t i_delay );
+void input_DecoderChangeDelay( decoder_t *, vlc_tick_t i_delay );
 
 /**
  * This function makes the decoder start waiting for a valid data block from its fifo.
@@ -92,7 +92,7 @@ void input_DecoderGetCcDesc( decoder_t *, decoder_cc_desc_t * );
  * This function force the display of the next picture and fills the stream
  * time consumed.
  */
-void input_DecoderFrameNext( decoder_t *p_dec, mtime_t *pi_duration );
+void input_DecoderFrameNext( decoder_t *p_dec, vlc_tick_t *pi_duration );
 
 /**
  * This function will return true if the ES format or meta data have changed since
diff --git a/src/input/demux_chained.c b/src/input/demux_chained.c
index f91adf164b..dbae43b775 100644
--- a/src/input/demux_chained.c
+++ b/src/input/demux_chained.c
@@ -66,7 +66,7 @@ static void *vlc_demux_chained_Thread(void *data)
     demux_Control(demux, DEMUX_SET_GROUP_ALL);
 
     /* Main loop */
-    mtime_t next_update = 0;
+    vlc_tick_t next_update = 0;
 
     do
         if (demux_TestAndClearFlags(demux, UINT_MAX) || mdate() >= next_update)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 38283e0df0..3649fbed96 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -150,27 +150,27 @@ typedef struct
     int         i_group_id;
 
     /* delay */
-    mtime_t i_audio_delay;
-    mtime_t i_spu_delay;
+    vlc_tick_t i_audio_delay;
+    vlc_tick_t i_spu_delay;
 
     /* Clock configuration */
-    mtime_t     i_pts_delay;
-    mtime_t     i_pts_jitter;
+    vlc_tick_t  i_pts_delay;
+    vlc_tick_t  i_pts_jitter;
     int         i_cr_average;
     int         i_rate;
 
     /* */
     bool        b_paused;
-    mtime_t     i_pause_date;
+    vlc_tick_t  i_pause_date;
 
     /* Current preroll */
-    mtime_t     i_preroll_end;
+    vlc_tick_t  i_preroll_end;
 
     /* Used for buffering */
     bool        b_buffering;
-    mtime_t     i_buffering_extra_initial;
-    mtime_t     i_buffering_extra_stream;
-    mtime_t     i_buffering_extra_system;
+    vlc_tick_t  i_buffering_extra_initial;
+    vlc_tick_t  i_buffering_extra_stream;
+    vlc_tick_t  i_buffering_extra_system;
 
     /* Record */
     sout_instance_t *p_sout_record;
@@ -193,8 +193,8 @@ static void EsSelect( es_out_t *out, es_out_id_t *es );
 static void EsDeleteInfo( es_out_t *, es_out_id_t *es );
 static void EsUnselect( es_out_t *out, es_out_id_t *es, bool b_update );
 static void EsOutDecoderChangeDelay( es_out_t *out, es_out_id_t *p_es );
-static void EsOutDecodersChangePause( es_out_t *out, bool b_paused, mtime_t i_date );
-static void EsOutProgramChangePause( es_out_t *out, bool b_paused, mtime_t i_date );
+static void EsOutDecodersChangePause( es_out_t *out, bool b_paused, vlc_tick_t i_date );
+static void EsOutProgramChangePause( es_out_t *out, bool b_paused, vlc_tick_t i_date );
 static void EsOutProgramsChangeRate( es_out_t *out );
 static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced );
 static void EsOutGlobalMeta( es_out_t *p_out, const vlc_meta_t *p_meta );
@@ -381,7 +381,7 @@ static void EsOutTerminate( es_out_t *out )
     input_SendEventMetaEpg( p_sys->p_input );
 }
 
-static mtime_t EsOutGetWakeup( es_out_t *out )
+static vlc_tick_t EsOutGetWakeup( es_out_t *out )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     input_thread_t *p_input = p_sys->p_input;
@@ -443,7 +443,7 @@ static bool EsOutDecodersIsEmpty( es_out_t *out )
     return true;
 }
 
-static void EsOutSetDelay( es_out_t *out, int i_cat, mtime_t i_delay )
+static void EsOutSetDelay( es_out_t *out, int i_cat, vlc_tick_t i_delay )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     es_out_id_t *es;
@@ -536,7 +536,7 @@ static int EsOutSetRecord(  es_out_t *out, bool b_record )
 
     return VLC_SUCCESS;
 }
-static void EsOutChangePause( es_out_t *out, bool b_paused, mtime_t i_date )
+static void EsOutChangePause( es_out_t *out, bool b_paused, vlc_tick_t i_date )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
 
@@ -550,10 +550,10 @@ static void EsOutChangePause( es_out_t *out, bool b_paused, mtime_t i_date )
     {
         if( p_sys->i_buffering_extra_initial > 0 )
         {
-            mtime_t i_stream_start;
-            mtime_t i_system_start;
-            mtime_t i_stream_duration;
-            mtime_t i_system_duration;
+            vlc_tick_t i_stream_start;
+            vlc_tick_t i_system_start;
+            vlc_tick_t i_stream_duration;
+            vlc_tick_t i_system_duration;
             int i_ret;
             i_ret = input_clock_GetState( p_sys->p_pgrm->p_input_clock,
                                           &i_stream_start, &i_system_start,
@@ -561,7 +561,7 @@ static void EsOutChangePause( es_out_t *out, bool b_paused, mtime_t i_date )
             if( !i_ret )
             {
                 /* FIXME pcr != exactly what wanted */
-                const mtime_t i_used = /*(i_stream_duration - input_priv(p_sys->p_input)->i_pts_delay)*/ p_sys->i_buffering_extra_system - p_sys->i_buffering_extra_initial;
+                const vlc_tick_t i_used = /*(i_stream_duration - input_priv(p_sys->p_input)->i_pts_delay)*/ p_sys->i_buffering_extra_system - p_sys->i_buffering_extra_initial;
                 i_date -= i_used;
             }
             p_sys->i_buffering_extra_initial = 0;
@@ -629,20 +629,20 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     es_out_id_t *p_es;
 
-    mtime_t i_stream_start;
-    mtime_t i_system_start;
-    mtime_t i_stream_duration;
-    mtime_t i_system_duration;
+    vlc_tick_t i_stream_start;
+    vlc_tick_t i_system_start;
+    vlc_tick_t i_stream_duration;
+    vlc_tick_t i_system_duration;
     if (input_clock_GetState( p_sys->p_pgrm->p_input_clock,
                                   &i_stream_start, &i_system_start,
                                   &i_stream_duration, &i_system_duration ))
         return;
 
-    mtime_t i_preroll_duration = 0;
+    vlc_tick_t i_preroll_duration = 0;
     if( p_sys->i_preroll_end >= 0 )
         i_preroll_duration = __MAX( p_sys->i_preroll_end - i_stream_start, 0 );
 
-    const mtime_t i_buffering_duration = p_sys->i_pts_delay +
+    const vlc_tick_t i_buffering_duration = p_sys->i_pts_delay +
                                          i_preroll_duration +
                                          p_sys->i_buffering_extra_stream - p_sys->i_buffering_extra_initial;
 
@@ -678,7 +678,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
         return;
     }
 
-    const mtime_t i_decoder_buffering_start = mdate();
+    const vlc_tick_t i_decoder_buffering_start = mdate();
     vlc_list_foreach(p_es, &p_sys->es, node)
     {
         if( !p_es->p_dec || p_es->fmt.i_cat == SPU_ES )
@@ -695,8 +695,8 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
     input_resource_TerminateVout( input_priv(p_sys->p_input)->p_resource );
 
     /* */
-    const mtime_t i_wakeup_delay = CLOCK_FREQ/100; /* FIXME CLEANUP thread wake up time*/
-    const mtime_t i_current_date = p_sys->b_paused ? p_sys->i_pause_date : mdate();
+    const vlc_tick_t i_wakeup_delay = CLOCK_FREQ/100; /* FIXME CLEANUP thread wake up time*/
+    const vlc_tick_t i_current_date = p_sys->b_paused ? p_sys->i_pause_date : mdate();
 
     input_clock_ChangeSystemOrigin( p_sys->p_pgrm->p_input_clock, true,
                                     i_current_date + i_wakeup_delay - i_buffering_duration );
@@ -711,7 +711,7 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
             input_DecoderStopWait( p_es->p_dec_record );
     }
 }
-static void EsOutDecodersChangePause( es_out_t *out, bool b_paused, mtime_t i_date )
+static void EsOutDecodersChangePause( es_out_t *out, bool b_paused, vlc_tick_t i_date )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     es_out_id_t *es;
@@ -750,7 +750,7 @@ static bool EsOutIsExtraBufferingAllowed( es_out_t *out )
     return i_size < i_level_high;
 }
 
-static void EsOutProgramChangePause( es_out_t *out, bool b_paused, mtime_t i_date )
+static void EsOutProgramChangePause( es_out_t *out, bool b_paused, vlc_tick_t i_date )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     es_out_pgrm_t *pgrm;
@@ -763,7 +763,7 @@ static void EsOutDecoderChangeDelay( es_out_t *out, es_out_id_t *p_es )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
 
-    mtime_t i_delay;
+    vlc_tick_t i_delay;
     if( p_es->fmt.i_cat == AUDIO_ES )
         i_delay = p_sys->i_audio_delay;
     else if( p_es->fmt.i_cat == SPU_ES )
@@ -811,7 +811,7 @@ static void EsOutFrameNext( es_out_t *out )
         return;
     }
 
-    mtime_t i_duration;
+    vlc_tick_t i_duration;
     input_DecoderFrameNext( p_es_video->p_dec, &i_duration );
 
     msg_Dbg( p_sys->p_input, "EsOutFrameNext consummed %d ms", (int)(i_duration/1000) );
@@ -822,10 +822,10 @@ static void EsOutFrameNext( es_out_t *out )
     /* FIXME it is not a clean way ? */
     if( p_sys->i_buffering_extra_initial <= 0 )
     {
-        mtime_t i_stream_start;
-        mtime_t i_system_start;
-        mtime_t i_stream_duration;
-        mtime_t i_system_duration;
+        vlc_tick_t i_stream_start;
+        vlc_tick_t i_system_start;
+        vlc_tick_t i_stream_duration;
+        vlc_tick_t i_system_duration;
         int i_ret;
 
         i_ret = input_clock_GetState( p_sys->p_pgrm->p_input_clock,
@@ -850,16 +850,16 @@ static void EsOutFrameNext( es_out_t *out )
     p_sys->i_preroll_end = -1;
     p_sys->i_prev_stream_level = -1;
 }
-static mtime_t EsOutGetBuffering( es_out_t *out )
+static vlc_tick_t EsOutGetBuffering( es_out_t *out )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
-    mtime_t i_stream_duration, i_system_start;
+    vlc_tick_t i_stream_duration, i_system_start;
 
     if( !p_sys->p_pgrm )
         return 0;
     else
     {
-        mtime_t i_stream_start, i_system_duration;
+        vlc_tick_t i_stream_start, i_system_duration;
 
         if( input_clock_GetState( p_sys->p_pgrm->p_input_clock,
                                   &i_stream_start, &i_system_start,
@@ -867,7 +867,7 @@ static mtime_t EsOutGetBuffering( es_out_t *out )
             return 0;
     }
 
-    mtime_t i_delay;
+    vlc_tick_t i_delay;
 
     if( p_sys->b_buffering && p_sys->i_buffering_extra_initial <= 0 )
     {
@@ -875,7 +875,7 @@ static mtime_t EsOutGetBuffering( es_out_t *out )
     }
     else
     {
-        mtime_t i_system_duration;
+        vlc_tick_t i_system_duration;
 
         if( p_sys->b_paused )
         {
@@ -888,7 +888,7 @@ static mtime_t EsOutGetBuffering( es_out_t *out )
             i_system_duration = mdate() - i_system_start;
         }
 
-        const mtime_t i_consumed = i_system_duration * INPUT_RATE_DEFAULT / p_sys->i_rate - i_stream_duration;
+        const vlc_tick_t i_consumed = i_system_duration * INPUT_RATE_DEFAULT / p_sys->i_rate - i_stream_duration;
         i_delay = p_sys->i_pts_delay - i_consumed;
     }
     if( i_delay < 0 )
@@ -2453,7 +2453,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
     {
         es_out_pgrm_t *p_pgrm = NULL;
         int            i_group = 0;
-        mtime_t        i_pcr;
+        vlc_tick_t     i_pcr;
 
         /* Search program */
         if( i_query == ES_OUT_SET_PCR )
@@ -2470,7 +2470,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         if( !p_pgrm )
             return VLC_EGENERIC;
 
-        i_pcr = va_arg( args, mtime_t );
+        i_pcr = va_arg( args, vlc_tick_t );
         if( i_pcr == VLC_TS_INVALID )
         {
             msg_Err( p_sys->p_input, "Invalid PCR value in ES_OUT_SET_(GROUP_)PCR !" );
@@ -2498,11 +2498,11 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
             if( b_late && ( !input_priv(p_sys->p_input)->p_sout ||
                             !input_priv(p_sys->p_input)->b_out_pace_control ) )
             {
-                const mtime_t i_pts_delay_base = p_sys->i_pts_delay - p_sys->i_pts_jitter;
-                mtime_t i_pts_delay = input_clock_GetJitter( p_pgrm->p_input_clock );
+                const vlc_tick_t i_pts_delay_base = p_sys->i_pts_delay - p_sys->i_pts_jitter;
+                vlc_tick_t i_pts_delay = input_clock_GetJitter( p_pgrm->p_input_clock );
 
                 /* Avoid dangerously high value */
-                const mtime_t i_jitter_max = INT64_C(1000) * var_InheritInteger( p_sys->p_input, "clock-jitter" );
+                const vlc_tick_t i_jitter_max = INT64_C(1000) * var_InheritInteger( p_sys->p_input, "clock-jitter" );
                 if( i_pts_delay > __MIN( i_pts_delay_base + i_jitter_max, INPUT_PTS_DELAY_MAX ) )
                 {
                     es_out_pgrm_t *pgrm;
@@ -2648,7 +2648,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
 
     case ES_OUT_GET_WAKE_UP:
     {
-        mtime_t *pi_wakeup = va_arg( args, mtime_t* );
+        vlc_tick_t *pi_wakeup = va_arg( args, vlc_tick_t* );
         *pi_wakeup = EsOutGetWakeup( out );
         return VLC_SUCCESS;
     }
@@ -2724,7 +2724,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
     case ES_OUT_SET_DELAY:
     {
         const int i_cat = va_arg( args, int );
-        const mtime_t i_delay = va_arg( args, mtime_t );
+        const vlc_tick_t i_delay = va_arg( args, vlc_tick_t );
         EsOutSetDelay( out, i_cat, i_delay );
         return VLC_SUCCESS;
     }
@@ -2739,7 +2739,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
     {
         const bool b_source_paused = (bool)va_arg( args, int );
         const bool b_paused = (bool)va_arg( args, int );
-        const mtime_t i_date = va_arg( args, mtime_t );
+        const vlc_tick_t i_date = va_arg( args, vlc_tick_t );
 
         assert( !b_source_paused == !b_paused );
         EsOutChangePause( out, b_paused, i_date );
@@ -2765,14 +2765,14 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
     case ES_OUT_SET_TIMES:
     {
         double f_position = va_arg( args, double );
-        mtime_t i_time = va_arg( args, mtime_t );
-        mtime_t i_length = va_arg( args, mtime_t );
+        vlc_tick_t i_time = va_arg( args, vlc_tick_t );
+        vlc_tick_t i_length = va_arg( args, vlc_tick_t );
 
         input_SendEventLength( p_sys->p_input, i_length );
 
         if( !p_sys->b_buffering )
         {
-            mtime_t i_delay;
+            vlc_tick_t i_delay;
 
             /* Fix for buffering delay */
             if( !input_priv(p_sys->p_input)->p_sout ||
@@ -2796,8 +2796,8 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
     }
     case ES_OUT_SET_JITTER:
     {
-        mtime_t i_pts_delay  = va_arg( args, mtime_t );
-        mtime_t i_pts_jitter = va_arg( args, mtime_t );
+        vlc_tick_t i_pts_delay  = va_arg( args, vlc_tick_t );
+        vlc_tick_t i_pts_jitter = va_arg( args, vlc_tick_t );
         int     i_cr_average = va_arg( args, int );
         es_out_pgrm_t *pgrm;
 
@@ -2826,8 +2826,8 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         if( !p_pgrm )
             return VLC_EGENERIC;
 
-        mtime_t *pi_system = va_arg( args, mtime_t *);
-        mtime_t *pi_delay  = va_arg( args, mtime_t *);
+        vlc_tick_t *pi_system = va_arg( args, vlc_tick_t *);
+        vlc_tick_t *pi_delay  = va_arg( args, vlc_tick_t *);
         input_clock_GetSystemOrigin( p_pgrm->p_input_clock, pi_system, pi_delay );
         return VLC_SUCCESS;
     }
@@ -2842,7 +2842,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
             return VLC_EGENERIC;
 
         const bool    b_absolute = va_arg( args, int );
-        const mtime_t i_system   = va_arg( args, mtime_t );
+        const vlc_tick_t i_system   = va_arg( args, vlc_tick_t );
         input_clock_ChangeSystemOrigin( p_pgrm->p_input_clock, b_absolute, i_system );
         return VLC_SUCCESS;
     }
diff --git a/src/input/es_out.h b/src/input/es_out.h
index fc5197ca22..6d45c42232 100644
--- a/src/input/es_out.h
+++ b/src/input/es_out.h
@@ -42,7 +42,7 @@ enum es_out_query_private_e
     ES_OUT_SET_MODE = ES_OUT_PRIVATE_START,         /* arg1= int                            */
 
     /* Get date to wait before demuxing more data */
-    ES_OUT_GET_WAKE_UP,                             /* arg1=mtime_t*            res=cannot fail */
+    ES_OUT_GET_WAKE_UP,                             /* arg1=vlc_tick_t*            res=cannot fail */
 
     /* Wrapper for some ES command to work with id */
     ES_OUT_SET_ES_BY_ID,
@@ -66,7 +66,7 @@ enum es_out_query_private_e
     ES_OUT_SET_RECORD_STATE,                        /* arg1=bool                res=can fail */
 
     /* Set pause state */
-    ES_OUT_SET_PAUSE_STATE,                         /* arg1=bool b_source_paused, bool b_paused arg2=mtime_t   res=can fail */
+    ES_OUT_SET_PAUSE_STATE,                         /* arg1=bool b_source_paused, bool b_paused arg2=vlc_tick_t  res=can fail */
 
     /* Set rate */
     ES_OUT_SET_RATE,                                /* arg1=int i_source_rate arg2=int i_rate                  res=can fail */
@@ -75,10 +75,10 @@ enum es_out_query_private_e
     ES_OUT_SET_FRAME_NEXT,                          /*                          res=can fail */
 
     /* Set position/time/length */
-    ES_OUT_SET_TIMES,                               /* arg1=double f_position arg2=mtime_t i_time arg3=mtime_t i_length res=cannot fail */
+    ES_OUT_SET_TIMES,                               /* arg1=double f_position arg2=vlc_tick_t i_time arg3=vlc_tick_t i_length res=cannot fail */
 
     /* Set jitter */
-    ES_OUT_SET_JITTER,                              /* arg1=mtime_t i_pts_delay arg2= mtime_t i_pts_jitter, arg2=int i_cr_average res=cannot fail */
+    ES_OUT_SET_JITTER,                              /* arg1=vlc_tick_t i_pts_delay arg2= vlc_tick_t i_pts_jitter, arg2=int i_cr_average res=cannot fail */
 
     /* Get forced group */
     ES_OUT_GET_GROUP_FORCED,                        /* arg1=int * res=cannot fail */
@@ -92,9 +92,9 @@ static inline void es_out_SetMode( es_out_t *p_out, int i_mode )
     int i_ret = es_out_Control( p_out, ES_OUT_SET_MODE, i_mode );
     assert( !i_ret );
 }
-static inline mtime_t es_out_GetWakeup( es_out_t *p_out )
+static inline vlc_tick_t es_out_GetWakeup( es_out_t *p_out )
 {
-    mtime_t i_wu;
+    vlc_tick_t i_wu;
     int i_ret = es_out_Control( p_out, ES_OUT_GET_WAKE_UP, &i_wu );
 
     assert( !i_ret );
@@ -116,7 +116,7 @@ static inline bool es_out_GetEmpty( es_out_t *p_out )
     assert( !i_ret );
     return b;
 }
-static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, mtime_t i_delay )
+static inline void es_out_SetDelay( es_out_t *p_out, int i_cat, vlc_tick_t i_delay )
 {
     int i_ret = es_out_Control( p_out, ES_OUT_SET_DELAY, i_cat, i_delay );
     assert( !i_ret );
@@ -125,7 +125,7 @@ static inline int es_out_SetRecordState( es_out_t *p_out, bool b_record )
 {
     return es_out_Control( p_out, ES_OUT_SET_RECORD_STATE, b_record );
 }
-static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, mtime_t i_date )
+static inline int es_out_SetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, vlc_tick_t i_date )
 {
     return es_out_Control( p_out, ES_OUT_SET_PAUSE_STATE, b_source_paused, b_paused, i_date );
 }
@@ -137,13 +137,13 @@ static inline int es_out_SetFrameNext( es_out_t *p_out )
 {
     return es_out_Control( p_out, ES_OUT_SET_FRAME_NEXT );
 }
-static inline void es_out_SetTimes( es_out_t *p_out, double f_position, mtime_t i_time, mtime_t i_length )
+static inline void es_out_SetTimes( es_out_t *p_out, double f_position, vlc_tick_t i_time, vlc_tick_t i_length )
 {
     int i_ret = es_out_Control( p_out, ES_OUT_SET_TIMES, f_position, i_time, i_length );
     assert( !i_ret );
 }
 static inline void es_out_SetJitter( es_out_t *p_out,
-                                     mtime_t i_pts_delay, mtime_t i_pts_jitter, int i_cr_average )
+                                     vlc_tick_t i_pts_delay, vlc_tick_t i_pts_jitter, int i_cr_average )
 {
     int i_ret = es_out_Control( p_out, ES_OUT_SET_JITTER,
                                 i_pts_delay, i_pts_jitter, i_cr_average );
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index aaacf152ee..c51287d711 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -136,13 +136,13 @@ typedef struct attribute_packed
         {
             /* FIXME Really too big (double make the whole thing too big) */
             double  f_position;
-            mtime_t i_time;
-            mtime_t i_length;
+            vlc_tick_t i_time;
+            vlc_tick_t i_length;
         } times;
         struct
         {
-            mtime_t i_pts_delay;
-            mtime_t i_pts_jitter;
+            vlc_tick_t i_pts_delay;
+            vlc_tick_t i_pts_jitter;
             int     i_cr_average;
         } jitter;
     } u;
@@ -151,7 +151,7 @@ typedef struct attribute_packed
 typedef struct attribute_packed
 {
     int8_t  i_type;
-    mtime_t i_date;
+    vlc_tick_t i_date;
     union
     {
         ts_cmd_add_t     add;
@@ -196,22 +196,22 @@ typedef struct
 
     /* */
     bool           b_paused;
-    mtime_t        i_pause_date;
+    vlc_tick_t     i_pause_date;
 
     /* */
     int            i_rate;
     int            i_rate_source;
-    mtime_t        i_rate_date;
-    mtime_t        i_rate_delay;
+    vlc_tick_t     i_rate_date;
+    vlc_tick_t     i_rate_delay;
 
     /* */
-    mtime_t        i_buffering_delay;
+    vlc_tick_t     i_buffering_delay;
 
     /* */
     ts_storage_t   *p_storage_r;
     ts_storage_t   *p_storage_w;
 
-    mtime_t        i_cmd_delay;
+    vlc_tick_t     i_cmd_delay;
 
 } ts_thread_t;
 
@@ -259,7 +259,7 @@ static void         TsPushCmd( ts_thread_t *, ts_cmd_t * );
 static int          TsPopCmdLocked( ts_thread_t *, ts_cmd_t *, bool b_flush );
 static bool         TsHasCmd( ts_thread_t * );
 static bool         TsIsUnused( ts_thread_t * );
-static int          TsChangePause( ts_thread_t *, bool b_source_paused, bool b_paused, mtime_t i_date );
+static int          TsChangePause( ts_thread_t *, bool b_source_paused, bool b_paused, vlc_tick_t i_date );
 static int          TsChangeRate( ts_thread_t *, int i_src_rate, int i_rate );
 
 static void         *TsRun( void * );
@@ -492,7 +492,7 @@ static int ControlLockedGetEmpty( es_out_t *p_out, bool *pb_empty )
 
     return VLC_SUCCESS;
 }
-static int ControlLockedGetWakeup( es_out_t *p_out, mtime_t *pi_wakeup )
+static int ControlLockedGetWakeup( es_out_t *p_out, vlc_tick_t *pi_wakeup )
 {
     es_out_sys_t *p_sys = container_of(p_out, es_out_sys_t, out);
 
@@ -519,7 +519,7 @@ static int ControlLockedGetBuffering( es_out_t *p_out, bool *pb_buffering )
 
     return VLC_SUCCESS;
 }
-static int ControlLockedSetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, mtime_t i_date )
+static int ControlLockedSetPauseState( es_out_t *p_out, bool b_source_paused, bool b_paused, vlc_tick_t i_date )
 {
     es_out_sys_t *p_sys = container_of(p_out, es_out_sys_t, out);
     int i_ret;
@@ -660,7 +660,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
     }
     case ES_OUT_GET_WAKE_UP: /* TODO ? */
     {
-        mtime_t *pi_wakeup = (mtime_t*)va_arg( args, mtime_t* );
+        vlc_tick_t *pi_wakeup = (vlc_tick_t*)va_arg( args, vlc_tick_t* );
         return ControlLockedGetWakeup( p_out, pi_wakeup );
     }
     case ES_OUT_GET_BUFFERING:
@@ -672,7 +672,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
     {
         const bool b_source_paused = (bool)va_arg( args, int );
         const bool b_paused = (bool)va_arg( args, int );
-        const mtime_t i_date = (mtime_t) va_arg( args, mtime_t );
+        const vlc_tick_t i_date = (vlc_tick_t) va_arg( args, vlc_tick_t );
 
         return ControlLockedSetPauseState( p_out, b_source_paused, b_paused, i_date );
     }
@@ -699,7 +699,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
     case ES_OUT_MODIFY_PCR_SYSTEM:
     {
         const bool    b_absolute = va_arg( args, int );
-        const mtime_t i_system   = va_arg( args, mtime_t );
+        const vlc_tick_t i_system   = va_arg( args, vlc_tick_t );
 
         if( b_absolute && p_sys->b_delayed )
             return VLC_EGENERIC;
@@ -908,7 +908,7 @@ static bool TsIsUnused( ts_thread_t *p_ts )
 
     return b_unused;
 }
-static int TsChangePause( ts_thread_t *p_ts, bool b_source_paused, bool b_paused, mtime_t i_date )
+static int TsChangePause( ts_thread_t *p_ts, bool b_source_paused, bool b_paused, vlc_tick_t i_date )
 {
     vlc_mutex_lock( &p_ts->lock );
 
@@ -961,12 +961,12 @@ static int TsChangeRate( ts_thread_t *p_ts, int i_src_rate, int i_rate )
 static void *TsRun( void *p_data )
 {
     ts_thread_t *p_ts = p_data;
-    mtime_t i_buffering_date = -1;
+    vlc_tick_t i_buffering_date = -1;
 
     for( ;; )
     {
         ts_cmd_t cmd;
-        mtime_t  i_deadline;
+        vlc_tick_t  i_deadline;
         bool b_buffering;
 
         /* Pop a command to execute */
@@ -1007,7 +1007,7 @@ static void *TsRun( void *p_data )
         p_ts->i_rate_delay = 0;
         if( p_ts->i_rate_source != p_ts->i_rate )
         {
-            const mtime_t i_duration = cmd.i_date - p_ts->i_rate_date;
+            const vlc_tick_t i_duration = cmd.i_date - p_ts->i_rate_date;
             p_ts->i_rate_delay = i_duration * p_ts->i_rate / p_ts->i_rate_source - i_duration;
         }
         if( p_ts->i_cmd_delay + p_ts->i_rate_delay + p_ts->i_buffering_delay < 0 && p_ts->i_rate != p_ts->i_rate_source )
@@ -1365,14 +1365,14 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
         p_cmd->u.control.u.i_int = (int)va_arg( args, int );
         break;
 
-    case ES_OUT_SET_PCR:                /* arg1=mtime_t i_pcr(microsecond!) (using default group 0)*/
+    case ES_OUT_SET_PCR:                /* arg1=vlc_tick_t i_pcr(microsecond!) (using default group 0)*/
     case ES_OUT_SET_NEXT_DISPLAY_TIME:  /* arg1=int64_t i_pts(microsecond) */
         p_cmd->u.control.u.i_i64 = (int64_t)va_arg( args, int64_t );
         break;
 
-    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=mtime_t i_pcr(microsecond!)*/
+    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=vlc_tick_t i_pcr(microsecond!)*/
         p_cmd->u.control.u.int_i64.i_int = (int)va_arg( args, int );
-        p_cmd->u.control.u.int_i64.i_i64 = (int64_t)va_arg( args, mtime_t );
+        p_cmd->u.control.u.int_i64.i_i64 = (int64_t)va_arg( args, vlc_tick_t );
         break;
 
     case ES_OUT_SET_ES_SCRAMBLED_STATE:
@@ -1485,8 +1485,8 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
     case ES_OUT_SET_TIMES:
     {
         double f_position = (double)va_arg( args, double );
-        mtime_t i_time = (mtime_t)va_arg( args, mtime_t );
-        mtime_t i_length = (mtime_t)va_arg( args, mtime_t );
+        vlc_tick_t i_time = (vlc_tick_t)va_arg( args, vlc_tick_t );
+        vlc_tick_t i_length = (vlc_tick_t)va_arg( args, vlc_tick_t );
 
         p_cmd->u.control.u.times.f_position = f_position;
         p_cmd->u.control.u.times.i_time = i_time;
@@ -1495,8 +1495,8 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
     }
     case ES_OUT_SET_JITTER:
     {
-        mtime_t i_pts_delay = (mtime_t)va_arg( args, mtime_t );
-        mtime_t i_pts_jitter = (mtime_t)va_arg( args, mtime_t );
+        vlc_tick_t i_pts_delay = (vlc_tick_t)va_arg( args, vlc_tick_t );
+        vlc_tick_t i_pts_jitter = (vlc_tick_t)va_arg( args, vlc_tick_t );
         int     i_cr_average = (int)va_arg( args, int );
 
         p_cmd->u.control.u.jitter.i_pts_delay = i_pts_delay;
@@ -1524,11 +1524,11 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
     case ES_OUT_DEL_GROUP:   /* arg1=int i_group */
         return es_out_Control( p_out, i_query, p_cmd->u.control.u.i_int );
 
-    case ES_OUT_SET_PCR:                /* arg1=mtime_t i_pcr(microsecond!) (using default group 0)*/
+    case ES_OUT_SET_PCR:                /* arg1=vlc_tick_t i_pcr(microsecond!) (using default group 0)*/
     case ES_OUT_SET_NEXT_DISPLAY_TIME:  /* arg1=int64_t i_pts(microsecond) */
         return es_out_Control( p_out, i_query, p_cmd->u.control.u.i_i64 );
 
-    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=mtime_t i_pcr(microsecond!)*/
+    case ES_OUT_SET_GROUP_PCR:          /* arg1= int i_group, arg2=vlc_tick_t i_pcr(microsecond!)*/
         return es_out_Control( p_out, i_query, p_cmd->u.control.u.int_i64.i_int,
                                                p_cmd->u.control.u.int_i64.i_i64 );
 
diff --git a/src/input/event.c b/src/input/event.c
index d305433628..1f94918ebb 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -54,7 +54,7 @@ void input_SendEventDead( input_thread_t *p_input )
     Trigger( p_input, INPUT_EVENT_DEAD );
 }
 
-void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time )
+void input_SendEventPosition( input_thread_t *p_input, double f_position, vlc_tick_t i_time )
 {
     vlc_value_t val;
 
@@ -68,7 +68,7 @@ void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_
 
     Trigger( p_input, INPUT_EVENT_POSITION );
 }
-void input_SendEventLength( input_thread_t *p_input, mtime_t i_length )
+void input_SendEventLength( input_thread_t *p_input, vlc_tick_t i_length )
 {
     vlc_value_t val;
 
@@ -96,7 +96,7 @@ void input_SendEventRate( input_thread_t *p_input, int i_rate )
 
     Trigger( p_input, INPUT_EVENT_RATE );
 }
-void input_SendEventAudioDelay( input_thread_t *p_input, mtime_t i_delay )
+void input_SendEventAudioDelay( input_thread_t *p_input, vlc_tick_t i_delay )
 {
     vlc_value_t val;
 
@@ -106,7 +106,7 @@ void input_SendEventAudioDelay( input_thread_t *p_input, mtime_t i_delay )
     Trigger( p_input, INPUT_EVENT_AUDIO_DELAY );
 }
 
-void input_SendEventSubtitleDelay( input_thread_t *p_input, mtime_t i_delay )
+void input_SendEventSubtitleDelay( input_thread_t *p_input, vlc_tick_t i_delay )
 {
     vlc_value_t val;
 
diff --git a/src/input/event.h b/src/input/event.h
index 156b992059..0be2fd0e22 100644
--- a/src/input/event.h
+++ b/src/input/event.h
@@ -30,12 +30,12 @@
  * Event for input.c
  *****************************************************************************/
 void input_SendEventDead( input_thread_t *p_input );
-void input_SendEventPosition( input_thread_t *p_input, double f_position, mtime_t i_time );
-void input_SendEventLength( input_thread_t *p_input, mtime_t i_length );
+void input_SendEventPosition( input_thread_t *p_input, double f_position, vlc_tick_t i_time );
+void input_SendEventLength( input_thread_t *p_input, vlc_tick_t i_length );
 void input_SendEventStatistics( input_thread_t *p_input );
 void input_SendEventRate( input_thread_t *p_input, int i_rate );
-void input_SendEventAudioDelay( input_thread_t *p_input, mtime_t i_delay );
-void input_SendEventSubtitleDelay( input_thread_t *p_input, mtime_t i_delay );
+void input_SendEventAudioDelay( input_thread_t *p_input, vlc_tick_t i_delay );
+void input_SendEventSubtitleDelay( input_thread_t *p_input, vlc_tick_t i_delay );
 void input_SendEventRecord( input_thread_t *p_input, bool b_recording );
 void input_SendEventTitle( input_thread_t *p_input, int i_title );
 void input_SendEventSeekpoint( input_thread_t *p_input, int i_title, int i_seekpoint );
diff --git a/src/input/input.c b/src/input/input.c
index a4136838dd..04ee726d1f 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -69,11 +69,11 @@ static  int             Init    ( input_thread_t *p_input );
 static void             End     ( input_thread_t *p_input );
 static void             MainLoop( input_thread_t *p_input, bool b_interactive );
 
-static inline int ControlPop( input_thread_t *, int *, vlc_value_t *, mtime_t i_deadline, bool b_postpone_seek );
+static inline int ControlPop( input_thread_t *, int *, vlc_value_t *, vlc_tick_t i_deadline, bool b_postpone_seek );
 static void       ControlRelease( int i_type, vlc_value_t val );
 static bool       ControlIsSeekRequest( int i_type );
 static bool       Control( input_thread_t *, int, vlc_value_t );
-static void       ControlPause( input_thread_t *, mtime_t );
+static void       ControlPause( input_thread_t *, vlc_tick_t );
 
 static int  UpdateTitleSeekpointFromDemux( input_thread_t * );
 static void UpdateGenericFromDemux( input_thread_t * );
@@ -652,8 +652,8 @@ static void MainLoopStatistics( input_thread_t *p_input )
 {
     input_thread_private_t *priv = input_priv(p_input);
     double f_position = 0.0;
-    mtime_t i_time = 0;
-    mtime_t i_length = 0;
+    vlc_tick_t i_time = 0;
+    vlc_tick_t i_length = 0;
 
     /* update input status variables */
     if( demux_Control( priv->master->p_demux,
@@ -686,8 +686,8 @@ static void MainLoopStatistics( input_thread_t *p_input )
  */
 static void MainLoop( input_thread_t *p_input, bool b_interactive )
 {
-    mtime_t i_intf_update = 0;
-    mtime_t i_last_seek_mdate = 0;
+    vlc_tick_t i_intf_update = 0;
+    vlc_tick_t i_last_seek_mdate = 0;
 
     if( b_interactive && var_InheritBool( p_input, "start-paused" ) )
         ControlPause( p_input, mdate() );
@@ -701,7 +701,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
 
     while( !input_Stopped( p_input ) && input_priv(p_input)->i_state != ERROR_S )
     {
-        mtime_t i_wakeup = -1;
+        vlc_tick_t i_wakeup = -1;
         bool b_paused = input_priv(p_input)->i_state == PAUSE_S;
         /* FIXME if input_priv(p_input)->i_state == PAUSE_S the access/access_demux
          * is paused -> this may cause problem with some of them
@@ -752,7 +752,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
             }
 
             /* Update interface and statistics */
-            mtime_t now = mdate();
+            vlc_tick_t now = mdate();
             if( now >= i_intf_update )
             {
                 MainLoopStatistics( p_input );
@@ -763,7 +763,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
         /* Handle control */
         for( ;; )
         {
-            mtime_t i_deadline = i_wakeup;
+            vlc_tick_t i_deadline = i_wakeup;
 
             /* Postpone seeking until ES buffering is complete or at most
              * 125 ms. */
@@ -771,7 +771,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
                             && !input_priv(p_input)->master->b_eof;
             if( b_postpone )
             {
-                mtime_t now = mdate();
+                vlc_tick_t now = mdate();
 
                 /* Recheck ES buffer level every 20 ms when seeking */
                 if( now < i_last_seek_mdate + CLOCK_FREQ/8
@@ -1193,7 +1193,7 @@ static void UpdatePtsDelay( input_thread_t *p_input )
     input_thread_private_t *p_sys = input_priv(p_input);
 
     /* Get max pts delay from input source */
-    mtime_t i_pts_delay = p_sys->master->i_pts_delay;
+    vlc_tick_t i_pts_delay = p_sys->master->i_pts_delay;
     for( int i = 0; i < p_sys->i_slave; i++ )
         i_pts_delay = __MAX( i_pts_delay, p_sys->slave[i]->i_pts_delay );
 
@@ -1201,9 +1201,9 @@ static void UpdatePtsDelay( input_thread_t *p_input )
         i_pts_delay = 0;
 
     /* Take care of audio/spu delay */
-    const mtime_t i_audio_delay = var_GetInteger( p_input, "audio-delay" );
-    const mtime_t i_spu_delay   = var_GetInteger( p_input, "spu-delay" );
-    const mtime_t i_extra_delay = __MIN( i_audio_delay, i_spu_delay );
+    const vlc_tick_t i_audio_delay = var_GetInteger( p_input, "audio-delay" );
+    const vlc_tick_t i_spu_delay   = var_GetInteger( p_input, "spu-delay" );
+    const vlc_tick_t i_extra_delay = __MIN( i_audio_delay, i_spu_delay );
     if( i_extra_delay < 0 )
         i_pts_delay -= i_extra_delay;
 
@@ -1322,7 +1322,7 @@ static int Init( input_thread_t * p_input )
 
     /* Load master infos */
     /* Init length */
-    mtime_t i_length;
+    vlc_tick_t i_length;
     if( demux_Control( master->p_demux, DEMUX_GET_LENGTH, &i_length ) )
         i_length = 0;
     if( i_length <= 0 )
@@ -1542,7 +1542,7 @@ static int ControlGetReducedIndexLocked( input_thread_t *p_input )
 
 static inline int ControlPop( input_thread_t *p_input,
                               int *pi_type, vlc_value_t *p_val,
-                              mtime_t i_deadline, bool b_postpone_seek )
+                              vlc_tick_t i_deadline, bool b_postpone_seek )
 {
     input_thread_private_t *p_sys = input_priv(p_input);
 
@@ -1640,7 +1640,7 @@ static void ControlRelease( int i_type, vlc_value_t val )
 }
 
 /* Pause input */
-static void ControlPause( input_thread_t *p_input, mtime_t i_control_date )
+static void ControlPause( input_thread_t *p_input, vlc_tick_t i_control_date )
 {
     int i_state = PAUSE_S;
 
@@ -1667,7 +1667,7 @@ static void ControlPause( input_thread_t *p_input, mtime_t i_control_date )
     input_ChangeState( p_input, i_state );
 }
 
-static void ControlUnpause( input_thread_t *p_input, mtime_t i_control_date )
+static void ControlUnpause( input_thread_t *p_input, vlc_tick_t i_control_date )
 {
     if( input_priv(p_input)->b_can_pause )
     {
@@ -1784,7 +1784,7 @@ static void ControlNav( input_thread_t *p_input, int i_type )
     /* Seek or change volume if the input doesn't have navigation or viewpoint */
     if( seek_direction != 0 )
     {
-        mtime_t it = CLOCK_FREQ * seek_direction * var_InheritInteger( p_input, "short-jump-size" );
+        vlc_tick_t it = CLOCK_FREQ * seek_direction * var_InheritInteger( p_input, "short-jump-size" );
         var_SetInteger( p_input, "time-offset", it );
     }
     else
@@ -1832,7 +1832,7 @@ static void ControlInsertDemuxFilter( input_thread_t* p_input, const char* psz_d
 static bool Control( input_thread_t *p_input,
                      int i_type, vlc_value_t val )
 {
-    const mtime_t i_control_date = mdate();
+    const vlc_tick_t i_control_date = mdate();
     /* FIXME b_force_update is abused, it should be carefully checked */
     bool b_force_update = false;
 
@@ -2220,7 +2220,7 @@ static bool Control( input_thread_t *p_input,
 
         case INPUT_CONTROL_SET_BOOKMARK:
         {
-            mtime_t time_offset = -1;
+            vlc_tick_t time_offset = -1;
 
             vlc_mutex_lock( &input_priv(p_input)->p_item->lock );
             if( val.i_int >= 0 && val.i_int < input_priv(p_input)->i_bookmark )
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index c0b8ae4756..25454a9e45 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -72,7 +72,7 @@ typedef struct
     double f_fps;
 
     /* */
-    mtime_t i_pts_delay;
+    vlc_tick_t i_pts_delay;
 
     bool       b_eof;   /* eof of demuxer */
 
@@ -103,9 +103,9 @@ typedef struct input_thread_private_t
     int         i_rate;
 
     /* Playtime configuration and state */
-    mtime_t     i_start;    /* :start-time,0 by default */
-    mtime_t     i_stop;     /* :stop-time, 0 if none */
-    mtime_t     i_time;     /* Current time */
+    vlc_tick_t  i_start;    /* :start-time,0 by default */
+    vlc_tick_t  i_stop;     /* :stop-time, 0 if none */
+    vlc_tick_t  i_time;     /* Current time */
     bool        b_fast_seek;/* :input-fast-seek */
 
     /* Output */
@@ -270,7 +270,7 @@ typedef struct input_rate_t
     struct
     {
         uintmax_t value;
-        mtime_t   date;
+        vlc_tick_t  date;
     } samples[2];
 } input_rate_t;
 
diff --git a/src/input/item.c b/src/input/item.c
index 31c4bdea70..6789f73caa 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -396,17 +396,17 @@ void input_item_SetURI( input_item_t *p_i, const char *psz_uri )
     vlc_mutex_unlock( &p_i->lock );
 }
 
-mtime_t input_item_GetDuration( input_item_t *p_i )
+vlc_tick_t input_item_GetDuration( input_item_t *p_i )
 {
     vlc_mutex_lock( &p_i->lock );
 
-    mtime_t i_duration = p_i->i_duration;
+    vlc_tick_t i_duration = p_i->i_duration;
 
     vlc_mutex_unlock( &p_i->lock );
     return i_duration;
 }
 
-void input_item_SetDuration( input_item_t *p_i, mtime_t i_duration )
+void input_item_SetDuration( input_item_t *p_i, vlc_tick_t i_duration )
 {
     bool b_send_event = false;
 
@@ -1054,7 +1054,7 @@ void input_item_SetEpgOffline( input_item_t *p_item )
 
 input_item_t *
 input_item_NewExt( const char *psz_uri, const char *psz_name,
-                   mtime_t duration, int type, enum input_item_net_type i_net )
+                   vlc_tick_t duration, int type, enum input_item_net_type i_net )
 {
     input_item_owner_t *owner = calloc( 1, sizeof( *owner ) );
     if( unlikely(owner == NULL) )
diff --git a/src/input/stats.c b/src/input/stats.c
index 3ae2909da8..4e1070f85f 100644
--- a/src/input/stats.c
+++ b/src/input/stats.c
@@ -124,7 +124,7 @@ void input_rate_Add(input_rate_t *counter, uintmax_t val)
     counter->value += val;
 
     /* Ignore samples within a second of another */
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
     if (counter->samples[0].date != VLC_TS_INVALID
      && (now - counter->samples[0].date) < 1*CLOCK_FREQ)
         return;
diff --git a/src/linux/thread.c b/src/linux/thread.c
index 20da2965ec..b2c5eecfea 100644
--- a/src/linux/thread.c
+++ b/src/linux/thread.c
@@ -78,7 +78,7 @@ void vlc_addr_wait(void *addr, unsigned val)
     vlc_futex_wait(addr, val, NULL);
 }
 
-bool vlc_addr_timedwait(void *addr, unsigned val, mtime_t delay)
+bool vlc_addr_timedwait(void *addr, unsigned val, vlc_tick_t delay)
 {
     lldiv_t d = lldiv(delay, CLOCK_FREQ);
     struct timespec ts = { d.quot, d.rem * (1000000000 / CLOCK_FREQ) };
diff --git a/src/misc/background_worker.c b/src/misc/background_worker.c
index 0610ed541a..b9071bae6d 100644
--- a/src/misc/background_worker.c
+++ b/src/misc/background_worker.c
@@ -43,7 +43,7 @@ struct background_worker {
         bool probe_request; /**< true if a probe is requested */
         vlc_cond_t wait; /**< wait for update in terms of head */
         vlc_cond_t worker_wait; /**< wait for probe request or cancelation */
-        mtime_t deadline; /**< deadline of the current task */
+        vlc_tick_t deadline; /**< deadline of the current task */
         void* id; /**< id of the current task */
         bool active; /**< true if there is an active thread */
     } head;
@@ -89,7 +89,7 @@ static void* Thread( void* data )
             else if( worker->head.deadline != VLC_TS_INVALID )
             {
                 /* Wait 1 seconds for new inputs before terminating */
-                mtime_t deadline = mdate() + 1*CLOCK_FREQ;
+                vlc_tick_t deadline = mdate() + 1*CLOCK_FREQ;
                 int ret = vlc_cond_timedwait( &worker->tail.wait,
                                               &worker->lock, deadline );
                 if( ret != 0 )
diff --git a/src/misc/background_worker.h b/src/misc/background_worker.h
index 30792fa3ed..049e47d543 100644
--- a/src/misc/background_worker.h
+++ b/src/misc/background_worker.h
@@ -27,7 +27,7 @@ struct background_worker_config {
      * a positive value denotes the maximum number of milliseconds a task can
      * run before \ref pf_stop is called to kill it.
      **/
-    mtime_t default_timeout;
+    vlc_tick_t default_timeout;
 
     /**
      * Release an entity
diff --git a/src/misc/fifo.c b/src/misc/fifo.c
index c69c316974..1c6132f297 100644
--- a/src/misc/fifo.c
+++ b/src/misc/fifo.c
@@ -71,7 +71,7 @@ void vlc_fifo_WaitCond(vlc_fifo_t *fifo, vlc_cond_t *condvar)
     vlc_cond_wait(condvar, &fifo->lock);
 }
 
-int vlc_fifo_TimedWaitCond(vlc_fifo_t *fifo, vlc_cond_t *condvar, mtime_t deadline)
+int vlc_fifo_TimedWaitCond(vlc_fifo_t *fifo, vlc_cond_t *condvar, vlc_tick_t deadline)
 {
     return vlc_cond_timedwait(condvar, &fifo->lock, deadline);
 }
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 61af86961e..08bbcb60f8 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -450,7 +450,7 @@ void filter_chain_VideoFlush( filter_chain_t *p_chain )
 }
 
 void filter_chain_SubSource( filter_chain_t *p_chain, spu_t *spu,
-                             mtime_t display_date )
+                             vlc_tick_t display_date )
 {
     for( chained_filter_t *f = p_chain->first; f != NULL; f = f->next )
     {
diff --git a/src/misc/interrupt.c b/src/misc/interrupt.c
index 2c3d359943..24f59ebfb7 100644
--- a/src/misc/interrupt.c
+++ b/src/misc/interrupt.c
@@ -225,7 +225,7 @@ static void vlc_mwait_i11e_cleanup(void *opaque)
     vlc_cond_destroy(cond);
 }
 
-int vlc_mwait_i11e(mtime_t deadline)
+int vlc_mwait_i11e(vlc_tick_t deadline)
 {
     vlc_interrupt_t *ctx = vlc_interrupt_var;
     if (ctx == NULL)
diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index 8f835e91eb..049cee520f 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -92,12 +92,12 @@ void date_Change( date_t *p_date, uint32_t i_divider_n, uint32_t i_divider_d )
     p_date->i_divider_den = i_divider_d;
 }
 
-mtime_t date_Increment( date_t *p_date, uint32_t i_nb_samples )
+vlc_tick_t date_Increment( date_t *p_date, uint32_t i_nb_samples )
 {
     if(unlikely(p_date->date == VLC_TS_INVALID))
         return VLC_TS_INVALID;
     assert( p_date->i_divider_num != 0 );
-    mtime_t i_dividend = i_nb_samples * CLOCK_FREQ * p_date->i_divider_den;
+    vlc_tick_t i_dividend = i_nb_samples * CLOCK_FREQ * p_date->i_divider_den;
     lldiv_t d = lldiv( i_dividend, p_date->i_divider_num );
 
     p_date->date += d.quot;
@@ -114,11 +114,11 @@ mtime_t date_Increment( date_t *p_date, uint32_t i_nb_samples )
     return p_date->date;
 }
 
-mtime_t date_Decrement( date_t *p_date, uint32_t i_nb_samples )
+vlc_tick_t date_Decrement( date_t *p_date, uint32_t i_nb_samples )
 {
     if(unlikely(p_date->date == VLC_TS_INVALID))
         return VLC_TS_INVALID;
-    mtime_t i_dividend = (mtime_t)i_nb_samples * CLOCK_FREQ * p_date->i_divider_den;
+    vlc_tick_t i_dividend = (vlc_tick_t)i_nb_samples * CLOCK_FREQ * p_date->i_divider_den;
     p_date->date -= i_dividend / p_date->i_divider_num;
     unsigned i_rem_adjust = i_dividend % p_date->i_divider_num;
 
diff --git a/src/misc/picture_fifo.c b/src/misc/picture_fifo.c
index 5e999926ec..f53cbcd899 100644
--- a/src/misc/picture_fifo.c
+++ b/src/misc/picture_fifo.c
@@ -102,7 +102,7 @@ picture_t *picture_fifo_Peek(picture_fifo_t *fifo)
 
     return picture;
 }
-void picture_fifo_Flush(picture_fifo_t *fifo, mtime_t date, bool flush_before)
+void picture_fifo_Flush(picture_fifo_t *fifo, vlc_tick_t date, bool flush_before)
 {
     picture_t *picture;
 
@@ -130,7 +130,7 @@ void picture_fifo_Flush(picture_fifo_t *fifo, mtime_t date, bool flush_before)
     while ((picture = PictureFifoPop(&tmp)) != NULL)
         picture_Release(picture);
 }
-void picture_fifo_OffsetDate(picture_fifo_t *fifo, mtime_t delta)
+void picture_fifo_OffsetDate(picture_fifo_t *fifo, vlc_tick_t delta)
 {
     vlc_mutex_lock(&fifo->lock);
     for (picture_t *picture = fifo->first; picture != NULL;) {
diff --git a/src/misc/subpicture.c b/src/misc/subpicture.c
index fdf111fb69..dd9fafe3eb 100644
--- a/src/misc/subpicture.c
+++ b/src/misc/subpicture.c
@@ -150,7 +150,7 @@ subpicture_t *subpicture_NewFromPicture( vlc_object_t *p_obj,
 void subpicture_Update( subpicture_t *p_subpicture,
                         const video_format_t *p_fmt_src,
                         const video_format_t *p_fmt_dst,
-                        mtime_t i_ts )
+                        vlc_tick_t i_ts )
 {
     subpicture_updater_t *p_upd = &p_subpicture->updater;
     subpicture_private_t *p_private = p_subpicture->p_private;
diff --git a/src/misc/threads.c b/src/misc/threads.c
index b1f16254fe..cf42ceb4e2 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -80,9 +80,9 @@ static void vlc_cancel_addr_finish(void *addr)
 #endif
 
 #ifdef LIBVLC_NEED_SLEEP
-void (mwait)(mtime_t deadline)
+void (mwait)(vlc_tick_t deadline)
 {
-    mtime_t delay;
+    vlc_tick_t delay;
     atomic_int value = ATOMIC_VAR_INIT(0);
 
     vlc_cancel_addr_prepare(&value);
@@ -96,7 +96,7 @@ void (mwait)(mtime_t deadline)
     vlc_cancel_addr_finish(&value);
 }
 
-void (msleep)(mtime_t delay)
+void (msleep)(vlc_tick_t delay)
 {
     mwait(mdate() + delay);
 }
@@ -180,7 +180,7 @@ void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex)
 }
 
 static int vlc_cond_wait_delay(vlc_cond_t *cond, vlc_mutex_t *mutex,
-                               mtime_t delay)
+                               vlc_tick_t delay)
 {
     unsigned value = atomic_load_explicit(vlc_cond_value(cond),
                                           memory_order_relaxed);
@@ -207,7 +207,7 @@ static int vlc_cond_wait_delay(vlc_cond_t *cond, vlc_mutex_t *mutex,
     return value ? 0 : ETIMEDOUT;
 }
 
-int vlc_cond_timedwait(vlc_cond_t *cond, vlc_mutex_t *mutex, mtime_t deadline)
+int vlc_cond_timedwait(vlc_cond_t *cond, vlc_mutex_t *mutex, vlc_tick_t deadline)
 {
     return vlc_cond_wait_delay(cond, mutex, deadline - mdate());
 }
diff --git a/src/missing.c b/src/missing.c
index a3e57e9d73..86536283a6 100644
--- a/src/missing.c
+++ b/src/missing.c
@@ -140,7 +140,7 @@ void sout_MuxDeleteStream (sout_mux_t *mux, sout_input_t *input)
     vlc_assert_unreachable ();
 }
 
-int sout_MuxGetStream (sout_mux_t *p_mux, unsigned int i_blocks, mtime_t *pi_dts)
+int sout_MuxGetStream (sout_mux_t *p_mux, unsigned int i_blocks, vlc_tick_t *pi_dts)
 {
     VLC_UNUSED (p_mux); VLC_UNUSED (i_blocks); VLC_UNUSED (pi_dts);
     vlc_assert_unreachable ();
diff --git a/src/network/httpd.c b/src/network/httpd.c
index acdf824580..782d35d48c 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -148,8 +148,8 @@ struct httpd_client_t
     bool    b_stream_mode;
     uint8_t i_state;
 
-    mtime_t i_activity_date;
-    mtime_t i_activity_timeout;
+    vlc_tick_t i_activity_date;
+    vlc_tick_t i_activity_timeout;
 
     /* buffer for reading header */
     int     i_buffer_size;
@@ -1176,7 +1176,7 @@ void httpd_MsgAdd(httpd_message_t *msg, const char *name, const char *psz_value,
     msg->i_headers++;
 }
 
-static void httpd_ClientInit(httpd_client_t *cl, mtime_t now)
+static void httpd_ClientInit(httpd_client_t *cl, vlc_tick_t now)
 {
     cl->i_state = HTTPD_CLIENT_RECEIVING;
     cl->i_activity_date = now;
@@ -1212,7 +1212,7 @@ static void httpd_ClientDestroy(httpd_client_t *cl)
     free(cl);
 }
 
-static httpd_client_t *httpd_ClientNew(vlc_tls_t *sock, mtime_t now)
+static httpd_client_t *httpd_ClientNew(vlc_tls_t *sock, vlc_tick_t now)
 {
     httpd_client_t *cl = malloc(sizeof(httpd_client_t));
 
@@ -1692,7 +1692,7 @@ static void httpdLoop(httpd_host_t *host)
         vlc_cleanup_pop();
     }
 
-    mtime_t now = mdate();
+    vlc_tick_t now = mdate();
     bool b_low_delay = false;
     httpd_client_t *cl;
 
diff --git a/src/network/tcp.c b/src/network/tcp.c
index f03a716899..32c6560c69 100644
--- a/src/network/tcp.c
+++ b/src/network/tcp.c
@@ -138,7 +138,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
     }
     free( psz_socks );
 
-    mtime_t timeout = var_InheritInteger(p_this, "ipv4-timeout")
+    vlc_tick_t timeout = var_InheritInteger(p_this, "ipv4-timeout")
                       * (CLOCK_FREQ / 1000);
 
     for (struct addrinfo *ptr = res; ptr != NULL; ptr = ptr->ai_next)
@@ -161,7 +161,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
             }
 
             struct pollfd ufd;
-            mtime_t deadline = VLC_TS_INVALID;
+            vlc_tick_t deadline = VLC_TS_INVALID;
 
             ufd.fd = fd;
             ufd.events = POLLOUT;
@@ -169,7 +169,7 @@ int net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
 
             do
             {
-                mtime_t now = mdate();
+                vlc_tick_t now = mdate();
 
                 if (vlc_killed())
                     goto next_ai;
diff --git a/src/network/tls.c b/src/network/tls.c
index 3c26c3d388..12bd53c7e7 100644
--- a/src/network/tls.c
+++ b/src/network/tls.c
@@ -167,7 +167,7 @@ vlc_tls_t *vlc_tls_ClientSessionCreate(vlc_tls_creds_t *crd, vlc_tls_t *sock,
         return NULL;
 
     int canc = vlc_savecancel();
-    mtime_t deadline = mdate ();
+    vlc_tick_t deadline = mdate ();
     deadline += var_InheritInteger (crd, "ipv4-timeout") * 1000;
 
     struct pollfd ufd[1];
@@ -186,7 +186,7 @@ error:
             break;
         }
 
-        mtime_t now = mdate ();
+        vlc_tick_t now = mdate ();
         if (now > deadline)
            now = deadline;
 
diff --git a/src/os2/thread.c b/src/os2/thread.c
index e4afb5bbe2..a01452f018 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -395,11 +395,11 @@ void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
 }
 
 int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
-                        mtime_t deadline)
+                        vlc_tick_t deadline)
 {
     ULONG ulTimeout;
 
-    mtime_t total = mdate();
+    vlc_tick_t total = mdate();
     total = (deadline - total) / 1000;
     if( total < 0 )
         total = 0;
@@ -413,7 +413,7 @@ int vlc_cond_timedwait_daytime (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
                                 time_t deadline)
 {
     ULONG ulTimeout;
-    mtime_t total;
+    vlc_tick_t total;
     struct timeval tv;
 
     gettimeofday (&tv, NULL);
@@ -898,7 +898,7 @@ int vlc_poll_os2( struct pollfd *fds, unsigned nfds, int timeout )
 #define Q2LL( q )   ( *( long long * )&( q ))
 
 /*** Clock ***/
-mtime_t mdate (void)
+vlc_tick_t mdate (void)
 {
     /* We don't need the real date, just the value of a high precision timer */
     QWORD counter;
@@ -914,9 +914,9 @@ mtime_t mdate (void)
 }
 
 #undef mwait
-void mwait (mtime_t deadline)
+void mwait (vlc_tick_t deadline)
 {
-    mtime_t delay;
+    vlc_tick_t delay;
 
     vlc_testcancel();
     while ((delay = (deadline - mdate())) > 0)
@@ -930,7 +930,7 @@ void mwait (mtime_t deadline)
 }
 
 #undef msleep
-void msleep (mtime_t delay)
+void msleep (vlc_tick_t delay)
 {
     mwait (mdate () + delay);
 }
@@ -1002,7 +1002,7 @@ void vlc_timer_destroy (vlc_timer_t timer)
 }
 
 void vlc_timer_schedule (vlc_timer_t timer, bool absolute,
-                         mtime_t value, mtime_t interval)
+                         vlc_tick_t value, vlc_tick_t interval)
 {
     if (timer->htimer != NULLHANDLE)
     {
diff --git a/src/playlist/item.c b/src/playlist/item.c
index deaedfe1e6..cdece423eb 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -714,9 +714,9 @@ void playlist_SendAddNotify( playlist_t *p_playlist, playlist_item_t *item )
 /**
  * Get the duration of all items in a node.
  */
-mtime_t playlist_GetNodeDuration( playlist_item_t* node )
+vlc_tick_t playlist_GetNodeDuration( playlist_item_t* node )
 {
-    mtime_t duration = input_item_GetDuration( node->p_input );
+    vlc_tick_t duration = input_item_GetDuration( node->p_input );
     if( duration == VLC_TS_INVALID )
         duration = 0;
 
diff --git a/src/playlist/sort.c b/src/playlist/sort.c
index b1eb17f9ce..674cec394c 100644
--- a/src/playlist/sort.c
+++ b/src/playlist/sort.c
@@ -267,8 +267,8 @@ SORTFN( SORT_DESCRIPTION, first, second )
 
 SORTFN( SORT_DURATION, first, second )
 {
-    mtime_t time1 = input_item_GetDuration( first->p_input );
-    mtime_t time2 = input_item_GetDuration( second->p_input );
+    vlc_tick_t time1 = input_item_GetDuration( first->p_input );
+    vlc_tick_t time2 = input_item_GetDuration( second->p_input );
     int i_ret = time1 > time2 ? +1 :
                     ( time1 == time2 ? 0 : -1 );
     return i_ret;
diff --git a/src/posix/thread.c b/src/posix/thread.c
index 3312050ce5..2781bd8245 100644
--- a/src/posix/thread.c
+++ b/src/posix/thread.c
@@ -61,7 +61,7 @@ static void vlc_clock_setup_once (void)
     vlc_clock_prec = (res.tv_nsec + 500) / 1000;
 }
 
-static struct timespec mtime_to_ts (mtime_t date)
+static struct timespec mtime_to_ts (vlc_tick_t date)
 {
     lldiv_t d = lldiv (date, CLOCK_FREQ);
     struct timespec ts = { d.quot, d.rem * (1000000000 / CLOCK_FREQ) };
@@ -225,7 +225,7 @@ void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
 }
 
 int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
-                        mtime_t deadline)
+                        vlc_tick_t deadline)
 {
     struct timespec ts = mtime_to_ts (deadline);
     int val = pthread_cond_timedwait (p_condvar, p_mutex, &ts);
@@ -578,7 +578,7 @@ void vlc_control_cancel (int cmd, ...)
     vlc_assert_unreachable ();
 }
 
-mtime_t mdate (void)
+vlc_tick_t mdate (void)
 {
     struct timespec ts;
 
@@ -590,7 +590,7 @@ mtime_t mdate (void)
 }
 
 #undef mwait
-void mwait (mtime_t deadline)
+void mwait (vlc_tick_t deadline)
 {
     static pthread_once_t vlc_clock_once = PTHREAD_ONCE_INIT;
 
@@ -605,7 +605,7 @@ void mwait (mtime_t deadline)
 }
 
 #undef msleep
-void msleep (mtime_t delay)
+void msleep (vlc_tick_t delay)
 {
     struct timespec ts = mtime_to_ts (delay);
 
diff --git a/src/posix/timer.c b/src/posix/timer.c
index 7cae7b957e..9926a06c94 100644
--- a/src/posix/timer.c
+++ b/src/posix/timer.c
@@ -46,7 +46,7 @@ struct vlc_timer
     vlc_mutex_t  lock;
     void       (*func) (void *);
     void        *data;
-    mtime_t      value, interval;
+    vlc_tick_t   value, interval;
     atomic_uint  overruns;
 };
 
@@ -67,7 +67,7 @@ noreturn static void *vlc_timer_thread (void *data)
 
         if (timer->interval != 0)
         {
-            mtime_t now = mdate();
+            vlc_tick_t now = mdate();
 
             if (now > timer->value)
             {   /* Update overrun counter */
@@ -80,7 +80,7 @@ noreturn static void *vlc_timer_thread (void *data)
             }
         }
 
-        mtime_t value = timer->value;
+        vlc_tick_t value = timer->value;
 
         if (vlc_cond_timedwait(&timer->reschedule, &timer->lock, value) == 0)
             continue;
@@ -144,7 +144,7 @@ void vlc_timer_destroy (vlc_timer_t timer)
 }
 
 void vlc_timer_schedule (vlc_timer_t timer, bool absolute,
-                         mtime_t value, mtime_t interval)
+                         vlc_tick_t value, vlc_tick_t interval)
 {
     if (value == 0)
         interval = 0;
diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c
index e81bb00ec4..f0d1a24742 100644
--- a/src/stream_output/sap.c
+++ b/src/stream_output/sap.c
@@ -142,7 +142,7 @@ noreturn static void *RunThread (void *self)
     for (;;)
     {
         session_descriptor_t *p_session;
-        mtime_t deadline;
+        vlc_tick_t deadline;
 
         while (addr->first == NULL)
             vlc_cond_wait (&addr->wait, &addr->lock);
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 292615119b..f12559ee32 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -532,12 +532,12 @@ void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input )
 int sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
                          block_t *p_buffer )
 {
-    mtime_t i_dts = p_buffer->i_dts;
+    vlc_tick_t i_dts = p_buffer->i_dts;
     block_FifoPut( p_input->p_fifo, p_buffer );
 
     if( p_mux->p_sout->i_out_pace_nocontrol )
     {
-        mtime_t current_date = mdate();
+        vlc_tick_t current_date = mdate();
         if ( current_date > i_dts )
             msg_Warn( p_mux, "late buffer for mux input (%"PRId64")",
                       current_date - i_dts );
@@ -568,9 +568,9 @@ void sout_MuxFlush( sout_mux_t *p_mux, sout_input_t *p_input )
 /*****************************************************************************
  * sout_MuxGetStream: find stream to be muxed
  *****************************************************************************/
-int sout_MuxGetStream( sout_mux_t *p_mux, unsigned i_blocks, mtime_t *pi_dts )
+int sout_MuxGetStream( sout_mux_t *p_mux, unsigned i_blocks, vlc_tick_t *pi_dts )
 {
-    mtime_t i_dts = 0;
+    vlc_tick_t i_dts = 0;
     int     i_stream = -1;
 
     assert( i_blocks > 0 );
diff --git a/src/test/timer.c b/src/test/timer.c
index fa0a4fda15..d789d5005c 100644
--- a/src/test/timer.c
+++ b/src/test/timer.c
@@ -52,7 +52,7 @@ static void callback (void *ptr)
 int main (void)
 {
     struct timer_data data;
-    mtime_t ts;
+    vlc_tick_t ts;
     int val;
 
     vlc_mutex_init (&data.lock);
diff --git a/src/text/strings.c b/src/text/strings.c
index 699a4c381d..8ae73d3027 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -511,7 +511,7 @@ char *vlc_strftime( const char *tformat )
     vlc_assert_unreachable ();
 }
 
-static void write_duration(struct vlc_memstream *stream, mtime_t duration)
+static void write_duration(struct vlc_memstream *stream, vlc_tick_t duration)
 {
     lldiv_t d;
     long long sec;
diff --git a/src/video_output/chrono.h b/src/video_output/chrono.h
index 594712e1cd..073f417fb4 100644
--- a/src/video_output/chrono.h
+++ b/src/video_output/chrono.h
@@ -28,16 +28,16 @@
 
 typedef struct {
     int     shift;
-    mtime_t avg;
-    mtime_t avg_initial;
+    vlc_tick_t avg;
+    vlc_tick_t avg_initial;
 
     int     shift_var;
-    mtime_t var;
+    vlc_tick_t var;
 
-    mtime_t start;
+    vlc_tick_t start;
 } vout_chrono_t;
 
-static inline void vout_chrono_Init(vout_chrono_t *chrono, int shift, mtime_t avg_initial)
+static inline void vout_chrono_Init(vout_chrono_t *chrono, int shift, vlc_tick_t avg_initial)
 {
     chrono->shift       = shift;
     chrono->avg_initial =
@@ -56,11 +56,11 @@ static inline void vout_chrono_Start(vout_chrono_t *chrono)
 {
     chrono->start = mdate();
 }
-static inline mtime_t vout_chrono_GetHigh(vout_chrono_t *chrono)
+static inline vlc_tick_t vout_chrono_GetHigh(vout_chrono_t *chrono)
 {
     return chrono->avg + 2 * chrono->var;
 }
-static inline mtime_t vout_chrono_GetLow(vout_chrono_t *chrono)
+static inline vlc_tick_t vout_chrono_GetLow(vout_chrono_t *chrono)
 {
     return __MAX(chrono->avg - 2 * chrono->var, 0);
 }
@@ -70,8 +70,8 @@ static inline void vout_chrono_Stop(vout_chrono_t *chrono)
     assert(chrono->start != VLC_TS_INVALID);
 
     /* */
-    const mtime_t duration = mdate() - chrono->start;
-    const mtime_t var = llabs( duration - chrono->avg );
+    const vlc_tick_t duration = mdate() - chrono->start;
+    const vlc_tick_t var = llabs( duration - chrono->avg );
 
     /* Update average only if the current point is 'valid' */
     if( duration < vout_chrono_GetHigh( chrono ) )
diff --git a/src/video_output/control.c b/src/video_output/control.c
index b2a1fba6d8..fff04dbc5a 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -141,7 +141,7 @@ void vout_control_PushInteger(vout_control_t *ctrl, int type, int integer)
     cmd.integer = integer;
     vout_control_Push(ctrl, &cmd);
 }
-void vout_control_PushTime(vout_control_t *ctrl, int type, mtime_t time)
+void vout_control_PushTime(vout_control_t *ctrl, int type, vlc_tick_t time)
 {
     vout_control_cmd_t cmd;
 
@@ -177,7 +177,7 @@ void vout_control_PushString(vout_control_t *ctrl, int type, const char *string)
 }
 
 int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
-                     mtime_t deadline)
+                     vlc_tick_t deadline)
 {
     vlc_mutex_lock(&ctrl->lock);
     if (ctrl->cmd.i_size <= 0) {
diff --git a/src/video_output/control.h b/src/video_output/control.h
index d02a5f1406..181e02082d 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -71,8 +71,8 @@ typedef struct {
 
     union {
         bool    boolean;
-        mtime_t time;
-        mtime_t *time_ptr;
+        vlc_tick_t time;
+        vlc_tick_t *time_ptr;
         char    *string;
         int     integer;
         struct {
@@ -81,7 +81,7 @@ typedef struct {
         } pair;
         struct {
             bool is_on;
-            mtime_t date;
+            vlc_tick_t date;
         } pause;
         struct {
             int channel;
@@ -132,14 +132,14 @@ void vout_control_Push(vout_control_t *, vout_control_cmd_t *);
 void vout_control_PushVoid(vout_control_t *, int type);
 void vout_control_PushBool(vout_control_t *, int type, bool boolean);
 void vout_control_PushInteger(vout_control_t *, int type, int integer);
-void vout_control_PushTime(vout_control_t *, int type, mtime_t time);
+void vout_control_PushTime(vout_control_t *, int type, vlc_tick_t time);
 void vout_control_PushMessage(vout_control_t *, int type, int channel, const char *string);
 void vout_control_PushPair(vout_control_t *, int type, int a, int b);
 void vout_control_PushString(vout_control_t *, int type, const char *string);
 void vout_control_Wake(vout_control_t *);
 
 /* control inside of the vout thread */
-int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, mtime_t deadline);
+int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, vlc_tick_t deadline);
 void vout_control_Dead(vout_control_t *);
 
 #endif
diff --git a/src/video_output/display.c b/src/video_output/display.c
index e06ad2ebe3..e4b4b9419d 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -364,7 +364,7 @@ typedef struct {
     struct {
         vlc_mouse_t state;
 
-        mtime_t last_pressed;
+        vlc_tick_t last_pressed;
     } mouse;
 
     atomic_bool reset_pictures;
@@ -511,7 +511,7 @@ static void VoutDisplayEventMouse(vout_display_t *vd, int event, va_list args)
     /* Emulate double-click if needed */
     if (!vd->info.has_double_click &&
         vlc_mouse_HasPressed(&osys->mouse.state, &m, MOUSE_BUTTON_LEFT)) {
-        const mtime_t i_date = mdate();
+        const vlc_tick_t i_date = mdate();
 
         if (i_date - osys->mouse.last_pressed < 3*CLOCK_FREQ/10 ) {
             m.b_double_click = true;
@@ -1110,7 +1110,7 @@ static picture_pool_t *SplitterPool(vout_display_t *vd, unsigned count)
 }
 static void SplitterPrepare(vout_display_t *vd,
                             picture_t *picture,
-                            subpicture_t *subpicture, mtime_t date)
+                            subpicture_t *subpicture, vlc_tick_t date)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/src/video_output/snapshot.c b/src/video_output/snapshot.c
index f9bc106d73..7cdaa5dd04 100644
--- a/src/video_output/snapshot.c
+++ b/src/video_output/snapshot.c
@@ -75,9 +75,9 @@ void vout_snapshot_End(vout_snapshot_t *snap)
 }
 
 /* */
-picture_t *vout_snapshot_Get(vout_snapshot_t *snap, mtime_t timeout)
+picture_t *vout_snapshot_Get(vout_snapshot_t *snap, vlc_tick_t timeout)
 {
-    const mtime_t deadline = mdate() + timeout;
+    const vlc_tick_t deadline = mdate() + timeout;
 
     vlc_mutex_lock(&snap->lock);
 
diff --git a/src/video_output/snapshot.h b/src/video_output/snapshot.h
index 3085d5038b..9b928d6cf0 100644
--- a/src/video_output/snapshot.h
+++ b/src/video_output/snapshot.h
@@ -43,7 +43,7 @@ void vout_snapshot_Clean(vout_snapshot_t *);
 void vout_snapshot_End(vout_snapshot_t *);
 
 /* */
-picture_t *vout_snapshot_Get(vout_snapshot_t *, mtime_t timeout);
+picture_t *vout_snapshot_Get(vout_snapshot_t *, vlc_tick_t timeout);
 
 /**
  * It tells if they are pending snapshot request
diff --git a/src/video_output/video_epg.c b/src/video_output/video_epg.c
index 5f9bac4f04..89da457526 100644
--- a/src/video_output/video_epg.c
+++ b/src/video_output/video_epg.c
@@ -499,7 +499,7 @@ static subpicture_region_t * vout_BuildOSDEpg(epg_spu_updater_sys_t *p_sys,
 static int OSDEpgValidate(subpicture_t *subpic,
                           bool has_src_changed, const video_format_t *fmt_src,
                           bool has_dst_changed, const video_format_t *fmt_dst,
-                          mtime_t ts)
+                          vlc_tick_t ts)
 {
     VLC_UNUSED(subpic); VLC_UNUSED(ts);
     VLC_UNUSED(fmt_src); VLC_UNUSED(has_src_changed);
@@ -513,7 +513,7 @@ static int OSDEpgValidate(subpicture_t *subpic,
 static void OSDEpgUpdate(subpicture_t *subpic,
                          const video_format_t *fmt_src,
                          const video_format_t *fmt_dst,
-                         mtime_t ts)
+                         vlc_tick_t ts)
 {
     epg_spu_updater_sys_t *sys = subpic->updater.p_sys;
     VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
@@ -636,7 +636,7 @@ int vout_OSDEpg(vout_thread_t *vout, input_item_t *input )
         .p_sys       = sys
     };
 
-    const mtime_t now = mdate();
+    const vlc_tick_t now = mdate();
     subpicture_t *subpic = subpicture_New(&updater);
     if (!subpic) {
         vlc_epg_Delete(sys->epg);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 8de1b6fcf3..3f115b5b64 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -314,7 +314,7 @@ void vout_Cancel(vout_thread_t *vout, bool canceled)
     vout_control_WaitEmpty(&vout->p->control);
 }
 
-void vout_ChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
+void vout_ChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
 {
     vout_control_cmd_t cmd;
     vout_control_cmd_Init(&cmd, VOUT_CONTROL_PAUSE);
@@ -331,7 +331,7 @@ void vout_GetResetStatistic(vout_thread_t *vout, unsigned *restrict displayed,
     vout_statistic_GetReset( &vout->p->statistic, displayed, lost );
 }
 
-void vout_Flush(vout_thread_t *vout, mtime_t date)
+void vout_Flush(vout_thread_t *vout, vlc_tick_t date)
 {
     vout_control_PushTime(&vout->p->control, VOUT_CONTROL_FLUSH, date);
     vout_control_WaitEmpty(&vout->p->control);
@@ -346,7 +346,7 @@ bool vout_IsEmpty(vout_thread_t *vout)
     return !picture;
 }
 
-void vout_NextPicture(vout_thread_t *vout, mtime_t *duration)
+void vout_NextPicture(vout_thread_t *vout, vlc_tick_t *duration)
 {
     vout_control_cmd_t cmd;
     vout_control_cmd_Init(&cmd, VOUT_CONTROL_STEP);
@@ -446,7 +446,7 @@ void vout_PutPicture(vout_thread_t *vout, picture_t *picture)
 int vout_GetSnapshot(vout_thread_t *vout,
                      block_t **image_dst, picture_t **picture_dst,
                      video_format_t *fmt,
-                     const char *type, mtime_t timeout)
+                     const char *type, vlc_tick_t timeout)
 {
     picture_t *picture = vout_snapshot_Get(&vout->p->snapshot, timeout);
     if (!picture) {
@@ -846,13 +846,13 @@ static int ThreadDisplayPreparePicture(vout_thread_t *vout, bool reuse, bool fra
             decoded = picture_fifo_Pop(vout->p->decoder_fifo);
             if (decoded) {
                 if (is_late_dropped && !decoded->b_force) {
-                    mtime_t late_threshold;
+                    vlc_tick_t late_threshold;
                     if (decoded->format.i_frame_rate && decoded->format.i_frame_rate_base)
                         late_threshold = ((CLOCK_FREQ/2) * decoded->format.i_frame_rate_base) / decoded->format.i_frame_rate;
                     else
                         late_threshold = VOUT_DISPLAY_LATE_THRESHOLD;
-                    const mtime_t predicted = mdate() + 0; /* TODO improve */
-                    const mtime_t late = predicted - decoded->date;
+                    const vlc_tick_t predicted = mdate() + 0; /* TODO improve */
+                    const vlc_tick_t late = predicted - decoded->date;
                     if (late > late_threshold) {
                         msg_Warn(vout, "picture is too late to be displayed (missing %"PRId64" ms)", late/1000);
                         picture_Release(decoded);
@@ -972,12 +972,12 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
      * Get the subpicture to be displayed
      */
     const bool do_snapshot = vout_snapshot_IsRequested(&vout->p->snapshot);
-    mtime_t render_subtitle_date;
+    vlc_tick_t render_subtitle_date;
     if (vout->p->pause.is_on)
         render_subtitle_date = vout->p->pause.date;
     else
         render_subtitle_date = filtered->date > 1 ? filtered->date : mdate();
-    mtime_t render_osd_date = mdate(); /* FIXME wrong */
+    vlc_tick_t render_osd_date = mdate(); /* FIXME wrong */
 
     /*
      * Get the subpicture to be displayed
@@ -1152,7 +1152,7 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
 
     /* Wait the real date (for rendering jitter) */
 #if 0
-    mtime_t delay = todisplay->date - mdate();
+    vlc_tick_t delay = todisplay->date - mdate();
     if (delay < 1000)
         msg_Warn(vout, "picture is late (%lld ms)", delay / 1000);
 #endif
@@ -1168,7 +1168,7 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
     return VLC_SUCCESS;
 }
 
-static int ThreadDisplayPicture(vout_thread_t *vout, mtime_t *deadline)
+static int ThreadDisplayPicture(vout_thread_t *vout, vlc_tick_t *deadline)
 {
     bool frame_by_frame = !deadline;
     bool paused = vout->p->pause.is_on;
@@ -1182,11 +1182,11 @@ static int ThreadDisplayPicture(vout_thread_t *vout, mtime_t *deadline)
         while (!vout->p->displayed.next && !ThreadDisplayPreparePicture(vout, false, frame_by_frame))
             ;
 
-    const mtime_t date = mdate();
-    const mtime_t render_delay = vout_chrono_GetHigh(&vout->p->render) + VOUT_MWAIT_TOLERANCE;
+    const vlc_tick_t date = mdate();
+    const vlc_tick_t render_delay = vout_chrono_GetHigh(&vout->p->render) + VOUT_MWAIT_TOLERANCE;
 
     bool drop_next_frame = frame_by_frame;
-    mtime_t date_next = VLC_TS_INVALID;
+    vlc_tick_t date_next = VLC_TS_INVALID;
     if (!paused && vout->p->displayed.next) {
         date_next = vout->p->displayed.next->date - render_delay;
         if (date_next /* + 0 FIXME */ <= date)
@@ -1204,7 +1204,7 @@ static int ThreadDisplayPicture(vout_thread_t *vout, mtime_t *deadline)
      */
     bool refresh = false;
 
-    mtime_t date_refresh = VLC_TS_INVALID;
+    vlc_tick_t date_refresh = VLC_TS_INVALID;
     if (vout->p->displayed.date != VLC_TS_INVALID) {
         date_refresh = vout->p->displayed.date + VOUT_REDISPLAY_DELAY - render_delay;
         refresh = date_refresh <= date;
@@ -1272,12 +1272,12 @@ static void ThreadChangeSubMargin(vout_thread_t *vout, int margin)
     spu_ChangeMargin(vout->p->spu, margin);
 }
 
-static void ThreadChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
+static void ThreadChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
 {
     assert(!vout->p->pause.is_on || !is_paused);
 
     if (vout->p->pause.is_on) {
-        const mtime_t duration = date - vout->p->pause.date;
+        const vlc_tick_t duration = date - vout->p->pause.date;
 
         if (vout->p->step.timestamp != VLC_TS_INVALID)
             vout->p->step.timestamp += duration;
@@ -1301,7 +1301,7 @@ static void ThreadChangePause(vout_thread_t *vout, bool is_paused, mtime_t date)
         vout_window_SetInhibition(window, !is_paused);
 }
 
-static void ThreadFlush(vout_thread_t *vout, bool below, mtime_t date)
+static void ThreadFlush(vout_thread_t *vout, bool below, vlc_tick_t date)
 {
     vout->p->step.timestamp = VLC_TS_INVALID;
     vout->p->step.last      = VLC_TS_INVALID;
@@ -1324,7 +1324,7 @@ static void ThreadFlush(vout_thread_t *vout, bool below, mtime_t date)
     vout_FilterFlush(vout->p->display.vd);
 }
 
-static void ThreadStep(vout_thread_t *vout, mtime_t *duration)
+static void ThreadStep(vout_thread_t *vout, vlc_tick_t *duration)
 {
     *duration = 0;
 
@@ -1773,14 +1773,14 @@ static void *Thread(void *object)
     vout_thread_t *vout = object;
     vout_thread_sys_t *sys = vout->p;
 
-    mtime_t deadline = VLC_TS_INVALID;
+    vlc_tick_t deadline = VLC_TS_INVALID;
     bool wait = false;
     for (;;) {
         vout_control_cmd_t cmd;
 
         if (wait)
         {
-            const mtime_t max_deadline = mdate() + CLOCK_FREQ/10;
+            const vlc_tick_t max_deadline = mdate() + CLOCK_FREQ/10;
             deadline = deadline == VLC_TS_INVALID ? max_deadline : __MIN(deadline, max_deadline);
         } else {
             deadline = VLC_TS_INVALID;
diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c
index a9e976739a..dc9a4e1c39 100644
--- a/src/video_output/video_text.c
+++ b/src/video_output/video_text.c
@@ -39,7 +39,7 @@ typedef struct {
 static int OSDTextValidate(subpicture_t *subpic,
                            bool has_src_changed, const video_format_t *fmt_src,
                            bool has_dst_changed, const video_format_t *fmt_dst,
-                           mtime_t ts)
+                           vlc_tick_t ts)
 {
     VLC_UNUSED(subpic); VLC_UNUSED(ts);
     VLC_UNUSED(fmt_src); VLC_UNUSED(has_src_changed);
@@ -53,7 +53,7 @@ static int OSDTextValidate(subpicture_t *subpic,
 static void OSDTextUpdate(subpicture_t *subpic,
                           const video_format_t *fmt_src,
                           const video_format_t *fmt_dst,
-                          mtime_t ts)
+                          vlc_tick_t ts)
 {
     osd_spu_updater_sys_t *sys = subpic->updater.p_sys;
     VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
@@ -109,7 +109,7 @@ static void OSDTextDestroy(subpicture_t *subpic)
 }
 
 void vout_OSDText(vout_thread_t *vout, int channel,
-                   int position, mtime_t duration, const char *text)
+                   int position, vlc_tick_t duration, const char *text)
 {
     assert( (position & ~SUBPICTURE_ALIGN_MASK) == 0);
     if (!var_InheritBool(vout, "osd") || duration <= 0)
diff --git a/src/video_output/video_widgets.c b/src/video_output/video_widgets.c
index ccb695ace6..a24d71b8a5 100644
--- a/src/video_output/video_widgets.c
+++ b/src/video_output/video_widgets.c
@@ -254,7 +254,7 @@ typedef struct {
 static int OSDWidgetValidate(subpicture_t *subpic,
                            bool has_src_changed, const video_format_t *fmt_src,
                            bool has_dst_changed, const video_format_t *fmt_dst,
-                           mtime_t ts)
+                           vlc_tick_t ts)
 {
     VLC_UNUSED(subpic); VLC_UNUSED(ts);
     VLC_UNUSED(fmt_src); VLC_UNUSED(has_src_changed);
@@ -268,7 +268,7 @@ static int OSDWidgetValidate(subpicture_t *subpic,
 static void OSDWidgetUpdate(subpicture_t *subpic,
                           const video_format_t *fmt_src,
                           const video_format_t *fmt_dst,
-                          mtime_t ts)
+                          vlc_tick_t ts)
 {
     osdwidget_spu_updater_sys_t *sys = subpic->updater.p_sys;
     VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 5f1bf01e34..feacb10a61 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -93,8 +93,8 @@ struct vout_thread_sys_t
     } display;
 
     struct {
-        mtime_t     date;
-        mtime_t     timestamp;
+        vlc_tick_t  date;
+        vlc_tick_t  timestamp;
         bool        is_interlaced;
         picture_t   *decoded;
         picture_t   *current;
@@ -102,25 +102,25 @@ struct vout_thread_sys_t
     } displayed;
 
     struct {
-        mtime_t     last;
-        mtime_t     timestamp;
+        vlc_tick_t  last;
+        vlc_tick_t  timestamp;
     } step;
 
     struct {
         bool        is_on;
-        mtime_t     date;
+        vlc_tick_t  date;
     } pause;
 
     /* OSD title configuration */
     struct {
         bool        show;
-        mtime_t     timeout;
+        vlc_tick_t  timeout;
         int         position;
     } title;
 
     struct {
         bool        is_interlaced;
-        mtime_t     date;
+        vlc_tick_t  date;
     } interlacing;
 
     /* */
@@ -224,7 +224,7 @@ void spu_ChangeMargin(spu_t *, int);
  * This function will (un)pause the display of pictures.
  * It is thread safe
  */
-void vout_ChangePause( vout_thread_t *, bool b_paused, mtime_t i_date );
+void vout_ChangePause( vout_thread_t *, bool b_paused, vlc_tick_t i_date );
 
 /**
  * Updates the pointing device state.
@@ -234,7 +234,7 @@ void vout_MouseState(vout_thread_t *, const vlc_mouse_t *);
 /**
  * This function will apply an offset on subtitle subpicture.
  */
-void spu_OffsetSubtitleDate( spu_t *p_spu, mtime_t i_duration );
+void spu_OffsetSubtitleDate( spu_t *p_spu, vlc_tick_t i_duration );
 
 /**
  * This function will return and reset internal statistics.
@@ -246,7 +246,7 @@ void vout_GetResetStatistic( vout_thread_t *p_vout, unsigned *pi_displayed,
  * This function will ensure that all ready/displayed pictures have at most
  * the provided date.
  */
-void vout_Flush( vout_thread_t *p_vout, mtime_t i_date );
+void vout_Flush( vout_thread_t *p_vout, vlc_tick_t i_date );
 
 /*
  * Cancel the vout, if cancel is true, it won't return any pictures after this
@@ -257,7 +257,7 @@ void vout_Cancel( vout_thread_t *p_vout, bool b_canceled );
 /**
  * This function will force to display the next picture while paused
  */
-void vout_NextPicture( vout_thread_t *p_vout, mtime_t *pi_duration );
+void vout_NextPicture( vout_thread_t *p_vout, vlc_tick_t *pi_duration );
 
 /**
  * This function will ask the display of the input title
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 779982bde7..5cf57be7b4 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -94,7 +94,7 @@ struct spu_private_t {
     filter_chain_t *filter_chain;
 
     /* */
-    mtime_t             last_sort_date;
+    vlc_tick_t          last_sort_date;
     vout_thread_t       *vout;
 };
 
@@ -251,7 +251,7 @@ static filter_t *SpuRenderCreateAndLoadScale(vlc_object_t *object,
 static void SpuRenderText(spu_t *spu, bool *rerender_text,
                           subpicture_region_t *region,
                           const vlc_fourcc_t *chroma_list,
-                          mtime_t elapsed_time)
+                          vlc_tick_t elapsed_time)
 {
     filter_t *text = spu->p->text;
 
@@ -527,8 +527,8 @@ static int SubpictureCmp(const void *s0, const void *s1)
 static void SpuSelectSubpictures(spu_t *spu,
                                  unsigned int *subpicture_count,
                                  subpicture_t **subpicture_array,
-                                 mtime_t render_subtitle_date,
-                                 mtime_t render_osd_date,
+                                 vlc_tick_t render_subtitle_date,
+                                 vlc_tick_t render_osd_date,
                                  bool ignore_osd)
 {
     spu_private_t *sys = spu->p;
@@ -560,9 +560,9 @@ static void SpuSelectSubpictures(spu_t *spu,
         bool         is_available_late[VOUT_MAX_SUBPICTURES];
         int          available_count = 0;
 
-        mtime_t      start_date = render_subtitle_date;
-        mtime_t      ephemer_subtitle_date = 0;
-        mtime_t      ephemer_osd_date = 0;
+        vlc_tick_t   start_date = render_subtitle_date;
+        vlc_tick_t   ephemer_subtitle_date = 0;
+        vlc_tick_t   ephemer_osd_date = 0;
         int64_t      ephemer_subtitle_order = INT64_MIN;
         int64_t      ephemer_system_order = INT64_MIN;
 
@@ -583,14 +583,14 @@ static void SpuSelectSubpictures(spu_t *spu,
                (ignore_osd && !current->b_subtitle))
                 continue;
 
-            const mtime_t render_date = current->b_subtitle ? render_subtitle_date : render_osd_date;
+            const vlc_tick_t render_date = current->b_subtitle ? render_subtitle_date : render_osd_date;
             if (render_date &&
                 render_date < current->i_start) {
                 /* Too early, come back next monday */
                 continue;
             }
 
-            mtime_t *ephemer_date_ptr  = current->b_subtitle ? &ephemer_subtitle_date  : &ephemer_osd_date;
+            vlc_tick_t *ephemer_date_ptr  = current->b_subtitle ? &ephemer_subtitle_date  : &ephemer_osd_date;
             int64_t *ephemer_order_ptr = current->b_subtitle ? &ephemer_subtitle_order : &ephemer_system_order;
             if (current->i_start >= *ephemer_date_ptr) {
                 *ephemer_date_ptr = current->i_start;
@@ -625,8 +625,8 @@ static void SpuSelectSubpictures(spu_t *spu,
             subpicture_t *current = available_subpic[index];
             bool is_late = is_available_late[index];
 
-            const mtime_t stop_date = current->b_subtitle ? __MAX(start_date, sys->last_sort_date) : render_osd_date;
-            const mtime_t ephemer_date  = current->b_subtitle ? ephemer_subtitle_date  : ephemer_osd_date;
+            const vlc_tick_t stop_date = current->b_subtitle ? __MAX(start_date, sys->last_sort_date) : render_osd_date;
+            const vlc_tick_t ephemer_date  = current->b_subtitle ? ephemer_subtitle_date  : ephemer_osd_date;
             const int64_t ephemer_order = current->b_subtitle ? ephemer_subtitle_order : ephemer_system_order;
 
             /* Destroy late and obsolete ephemer subpictures */
@@ -661,7 +661,7 @@ static void SpuRenderRegion(spu_t *spu,
                             const vlc_fourcc_t *chroma_list,
                             const video_format_t *fmt,
                             const spu_area_t *subtitle_area, int subtitle_area_count,
-                            mtime_t render_date)
+                            vlc_tick_t render_date)
 {
     spu_private_t *sys = spu->p;
 
@@ -963,7 +963,7 @@ static void SpuRenderRegion(spu_t *spu,
         dst->p_picture = picture_Hold(region_picture);
         int fade_alpha = 255;
         if (subpic->b_fade) {
-            mtime_t fade_start = subpic->i_start + 3 * (subpic->i_stop - subpic->i_start) / 4;
+            vlc_tick_t fade_start = subpic->i_start + 3 * (subpic->i_stop - subpic->i_start) / 4;
 
             if (fade_start <= render_date && fade_start < subpic->i_stop)
                 fade_alpha = 255 * (subpic->i_stop - render_date) /
@@ -1000,8 +1000,8 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
                                           const vlc_fourcc_t *chroma_list,
                                           const video_format_t *fmt_dst,
                                           const video_format_t *fmt_src,
-                                          mtime_t render_subtitle_date,
-                                          mtime_t render_osd_date)
+                                          vlc_tick_t render_subtitle_date,
+                                          vlc_tick_t render_osd_date)
 {
     spu_private_t *sys = spu->p;
 
@@ -1523,8 +1523,8 @@ subpicture_t *spu_Render(spu_t *spu,
                          const vlc_fourcc_t *chroma_list,
                          const video_format_t *fmt_dst,
                          const video_format_t *fmt_src,
-                         mtime_t render_subtitle_date,
-                         mtime_t render_osd_date,
+                         vlc_tick_t render_subtitle_date,
+                         vlc_tick_t render_osd_date,
                          bool ignore_osd)
 {
     spu_private_t *sys = spu->p;
@@ -1615,7 +1615,7 @@ subpicture_t *spu_Render(spu_t *spu,
     return render;
 }
 
-void spu_OffsetSubtitleDate(spu_t *spu, mtime_t duration)
+void spu_OffsetSubtitleDate(spu_t *spu, vlc_tick_t duration)
 {
     spu_private_t *sys = spu->p;
 
diff --git a/src/video_output/window.c b/src/video_output/window.c
index 97f19ff055..ad8d61c0ba 100644
--- a/src/video_output/window.c
+++ b/src/video_output/window.c
@@ -131,7 +131,7 @@ typedef struct vout_display_window
 {
     vout_display_t *vd;
     vlc_mouse_t mouse;
-    mtime_t last_left_press;
+    vlc_tick_t last_left_press;
 } vout_display_window_t;
 
 static void vout_display_window_ResizeNotify(vout_window_t *window,
@@ -201,7 +201,7 @@ static void vout_display_window_MouseEvent(vout_window_t *window,
              && ev->button_mask == MOUSE_BUTTON_LEFT
              && !vlc_mouse_IsLeftPressed(m))
             {
-                const mtime_t now = mdate();
+                const vlc_tick_t now = mdate();
 
                 if (state->last_left_press != INT64_MIN
                  && now - state->last_left_press < DOUBLE_CLICK_TIME)
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 25ff6e39dd..a96d6b64c0 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -420,7 +420,7 @@ void vlc_addr_wait(void *addr, unsigned val)
     WaitOnAddress(addr, &val, sizeof (val), -1);
 }
 
-bool vlc_addr_timedwait(void *addr, unsigned val, mtime_t delay)
+bool vlc_addr_timedwait(void *addr, unsigned val, vlc_tick_t delay)
 {
     delay = (delay + 999) / 1000;
 
@@ -699,7 +699,7 @@ static union
 #endif
 } clk;
 
-static mtime_t mdate_interrupt (void)
+static vlc_tick_t mdate_interrupt (void)
 {
     ULONGLONG ts;
     BOOL ret;
@@ -713,7 +713,7 @@ static mtime_t mdate_interrupt (void)
     return ts / (10000000 / CLOCK_FREQ);
 }
 
-static mtime_t mdate_tick (void)
+static vlc_tick_t mdate_tick (void)
 {
     ULONGLONG ts = GetTickCount64 ();
 
@@ -722,7 +722,7 @@ static mtime_t mdate_tick (void)
     return ts * (CLOCK_FREQ / 1000);
 }
 #if !VLC_WINSTORE_APP
-static mtime_t mdate_multimedia (void)
+static vlc_tick_t mdate_multimedia (void)
 {
     DWORD ts = clk.multimedia.timeGetTime ();
 
@@ -732,7 +732,7 @@ static mtime_t mdate_multimedia (void)
 }
 #endif
 
-static mtime_t mdate_perf (void)
+static vlc_tick_t mdate_perf (void)
 {
     /* We don't need the real date, just the value of a high precision timer */
     LARGE_INTEGER counter;
@@ -746,7 +746,7 @@ static mtime_t mdate_perf (void)
     return (d.quot * CLOCK_FREQ) + ((d.rem * CLOCK_FREQ) / clk.perf.freq.QuadPart);
 }
 
-static mtime_t mdate_wall (void)
+static vlc_tick_t mdate_wall (void)
 {
     FILETIME ts;
     ULARGE_INTEGER s;
@@ -763,23 +763,23 @@ static mtime_t mdate_wall (void)
     return s.QuadPart / (10000000 / CLOCK_FREQ);
 }
 
-static mtime_t mdate_default(void)
+static vlc_tick_t mdate_default(void)
 {
     vlc_threads_setup(NULL);
     return mdate_perf();
 }
 
-static mtime_t (*mdate_selected) (void) = mdate_default;
+static vlc_tick_t (*mdate_selected) (void) = mdate_default;
 
-mtime_t mdate (void)
+vlc_tick_t mdate (void)
 {
     return mdate_selected ();
 }
 
 #if (_WIN32_WINNT < _WIN32_WINNT_WIN8)
-void (mwait)(mtime_t deadline)
+void (mwait)(vlc_tick_t deadline)
 {
-    mtime_t delay;
+    vlc_tick_t delay;
 
     vlc_testcancel();
     while ((delay = (deadline - mdate())) > 0)
@@ -793,7 +793,7 @@ void (mwait)(mtime_t deadline)
     }
 }
 
-void (msleep)(mtime_t delay)
+void (msleep)(vlc_tick_t delay)
 {
     mwait (mdate () + delay);
 }
diff --git a/src/win32/timer.c b/src/win32/timer.c
index 707e9f581e..a76ad88ab9 100644
--- a/src/win32/timer.c
+++ b/src/win32/timer.c
@@ -63,7 +63,7 @@ void vlc_timer_destroy (vlc_timer_t timer)
 }
 
 void vlc_timer_schedule (vlc_timer_t timer, bool absolute,
-                         mtime_t value, mtime_t interval)
+                         vlc_tick_t value, vlc_tick_t interval)
 {
     if (timer->handle != INVALID_HANDLE_VALUE)
     {
diff --git a/test/src/input/demux-run.c b/test/src/input/demux-run.c
index b0bd573567..f00da77e70 100644
--- a/test/src/input/demux-run.c
+++ b/test/src/input/demux-run.c
@@ -314,8 +314,8 @@ static int demux_process_stream(const struct vlc_run_args *args, stream_t *s)
 
             int seekpoint = 0;
             double position = 0.0;
-            mtime_t time = 0;
-            mtime_t length = 0;
+            vlc_tick_t time = 0;
+            vlc_tick_t length = 0;
 
             /* Call controls for increased code coverage */
             demux_Control(demux, DEMUX_GET_SEEKPOINT, &seekpoint);
diff --git a/test/src/interface/dialog.c b/test/src/interface/dialog.c
index d47ea80e63..15f5c7aa85 100644
--- a/test/src/interface/dialog.c
+++ b/test/src/interface/dialog.c
@@ -135,7 +135,7 @@ set_answer(struct cb_answer *p_ans, bool b_dismiss, const char *psz_username,
 
 static void
 test_dialogs(vlc_object_t *p_obj, struct cb_answer *p_ans,
-             mtime_t i_dialog_wait)
+             vlc_tick_t i_dialog_wait)
 {
     set_answer(p_ans, false, NULL, 0);
     int i_ret = vlc_dialog_display_error(p_obj, TITLE,
-- 
2.17.0




More information about the vlc-devel mailing list