[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#859459: marked as done (unblock: vlc/2.2.5-1)



Your message dated Tue, 04 Apr 2017 12:21:00 +0000
with message-id <59fbc51f-1105-48a3-f070-67f8ea1e73cc@thykier.net>
and subject line Re: Bug#859459: unblock: vlc/2.2.5-1
has caused the Debian Bug report #859459,
regarding unblock: vlc/2.2.5-1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
859459: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859459
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Similarly to what we have done for jessie, I'd like to keep vlc up-to-date with
the current stable branch during the lifetime of stretch. So please unblock
package vlc 2.2.5-1. This upstream release is the next bug fix release in vlc's
2.2.x series. Most importantly, it fixes various integer and buffer overflows,
NULL pointer dereferences, division by zero errors, heap corruptions that can be
triggered during playback.

Note that the next bug fix release 2.2.5.1 is expected to be released soon. But
until that happens I'd like to get 2.2.5 into stretch.

The upstream changelog is:

Decoder:
 * Fix mp3 playback quality regression in libmad
 * Fix video scaling in VDPAU
 * Fix playback of palettized codecs
 * Fix ADPCM heap corruption (FG-VD-16-067)
 * Fix AES3 16bps decoding
 * Fix DVD/LPCM heap corruption (FG-VD-16-090)
 * Fix SCTE-27 colors

Demuxer:
 * Fix possible ASF integer overflow
 * Fix MP4, VOC, XA, SMF divide-by-zero errors
 * Fix MP4 heap buffer overflows
 * Fix Flac metadata integer overflow
 * Fix NSVf and AIFF infinite loops
 * Fix flac null-pointer dereference
 * Fix vorbis and opus comments integer overflows and leaks

Video output:
 * Fix green line on Windows with AMD drivers
 * Fix screenshots size

Access:
 * Fix crash in screen recording on Windows
 * Fix FTP scan string injection
 * Fix HTTP size handling

Mux:
 * Fix mp4 drift

Lua:
 * Fix vimeo, youtube, dailymotion, cli, appletrailers, http,
   soundcloud scripts

Audio filter:
 * Fix heap write in stereo_widen audio filter

Windows:
 * The plugins loading will not load external DLLs by default.
   Plugins will need to LoadLibrary explicitely.
 * Fix uninstaller path handling
 * Fix taskbar buttons behavior

MacOS:
 * Fix scrolling sensitivity on Sierra
 * Resume points are deleted now if the user clears the list of
   recent items


The debian changelog is:

vlc (2.2.5-1) unstable; urgency=medium

  * New upstream releases. (Closes: #850529)
  * debian/patches:
    - fix-translation.patch: Refreshed.
    - Removed patches taken from upstream included in 2.2.5.
  * debian/*.maintscript: Bump all versions to 2.2.5-1~z. This is necessary to
    properly handle symlink to directory conversions once 2.2.5 is available
    in stretch.

(Note that "... in stretch." should read as "... in jessie." I will fix that in
a future upload which most likely will be an upload of 2.2.5.1 for stretch.)

The diff between 2.2.4 and 2.2.5 contains a lot of changes, but most of them can
be filtered out. The following changes were filtered from the diff:

 Makefile.in                                        |    99 +-
 aclocal.m4                                         |   272 +-
 autotools/compile                                  |     2 +-
 autotools/config.guess                             |    47 +-
 autotools/config.sub                               |    36 +-
 autotools/depcomp                                  |     2 +-
 autotools/install-sh                               |   373 +-
 autotools/missing                                  |     2 +-
 autotools/test-driver                              |    15 +-
 bin/Makefile.in                                    |    25 +-
 compat/Makefile.in                                 |    37 +-
 config.h.in                                        |     2 -
 configure                                          |   154 +-
 doc/Makefile.in                                    |    24 +-
 lib/Makefile.in                                    |    30 +-
 m4/Makefile.in                                     |    23 +-
 modules/Makefile.in                                |    63 +-
 modules/access_output/Makefile.in                  |    33 +-
 modules/audio_filter/Makefile.in                   |    33 +-
 modules/control/Makefile.in                        |    33 +-
 modules/gui/Makefile.in                            |    33 +-
 modules/gui/ios_dialog_provider/Makefile.in        |    33 +-
 modules/gui/macosx/Makefile.in                     |    46 +-
 modules/gui/macosx_dialog_provider/Makefile.in     |    34 +-
 modules/gui/minimal_macosx/Makefile.in             |    34 +-
 modules/gui/qt4/Makefile.in                        |    32 +-
 modules/gui/skins2/Makefile.in                     |    33 +-
 modules/hw/vdpau/Makefile.in                       |    32 +-
 modules/hw/vdpau/chroma.c                          |     3 +-
 modules/misc/Makefile.in                           |    33 +-
 modules/module.rc.in                               |     2 +-
 modules/mux/Makefile.in                            |    33 +-
 modules/packetizer/Makefile.in                     |    34 +-
 modules/stream_out/Makefile.in                     |    33 +-
 modules/text_renderer/Makefile.in                  |    33 +-
 modules/video_filter/Makefile.in                   |    34 +-
 modules/video_output/Makefile.in                   |    33 +-
 modules/visualization/Makefile.in                  |    33 +-
 share/Makefile.in                                  |    50 +-
 src/Makefile.in                                    |    35 +-
 test/Makefile.in                                   |    30 +-

Not for us since dh-autoreconf is used.

 contrib/src/SDL_image/rules.mak                    |     2 +-
 contrib/src/a52/rules.mak                          |     2 +-
 contrib/src/asdcplib/rules.mak                     |     2 +-
 contrib/src/ass/rules.mak                          |     2 +-
 contrib/src/caca/rules.mak                         |     2 +-
 contrib/src/cddb/rules.mak                         |     4 +-
 contrib/src/chromaprint/rules.mak                  |     2 +-
 contrib/src/crystalhd/rules.mak                    |     2 +-
 contrib/src/dshow/rules.mak                        |     2 +-
 contrib/src/ebml/rules.mak                         |     3 +-
 contrib/src/faad2/rules.mak                        |     2 +-
 contrib/src/ffi/rules.mak                          |     2 +-
 contrib/src/ffmpeg/rules.mak                       |     1 +
 ...-8431629dd112874293380a6d8a852459fc1a76b6.patch |    31 +
 contrib/src/flac/rules.mak                         |     2 +-
 contrib/src/fluid/rules.mak                        |     2 +-
 contrib/src/fontconfig/rules.mak                   |     2 +-
 contrib/src/freetype2/rules.mak                    |     2 +-
 contrib/src/fribidi/rules.mak                      |     2 +-
 contrib/src/gcrypt/rules.mak                       |     2 +-
 contrib/src/gettext/rules.mak                      |     2 +-
 contrib/src/glew/rules.mak                         |     2 +-
 contrib/src/glib/rules.mak                         |     2 +-
 contrib/src/gme/rules.mak                          |     2 +-
 contrib/src/gmp/rules.mak                          |     2 +-
 contrib/src/gnutls/rules.mak                       |     2 +-
 contrib/src/goom/rules.mak                         |     2 +-
 contrib/src/gpg-error/rules.mak                    |     2 +-
 contrib/src/growl/rules.mak                        |     2 +-
 contrib/src/gsm/rules.mak                          |     4 +-
 contrib/src/harfbuzz/rules.mak                     |     2 +-
 contrib/src/iconv/rules.mak                        |     2 +-
 contrib/src/jpeg/rules.mak                         |     5 +-
 contrib/src/kate/rules.mak                         |     2 +-
 contrib/src/lame/rules.mak                         |     2 +-
 contrib/src/libmpeg2/rules.mak                     |     3 +-
 contrib/src/libxml2/rules.mak                      |     2 +-
 contrib/src/live555/rules.mak                      |     5 +-
 contrib/src/mad/check-bitstream-length.patch       |  1094 +-
 contrib/src/mad/rules.mak                          |     2 +-
 contrib/src/main.mak                               |    11 +-
 contrib/src/matroska/rules.mak                     |     3 +-
 contrib/src/modplug/rules.mak                      |     2 +-
 contrib/src/mpcdec/rules.mak                       |     4 +-
 contrib/src/ncurses/rules.mak                      |     2 +-
 contrib/src/nettle/rules.mak                       |     2 +-
 contrib/src/ogg/rules.mak                          |     3 +-
 contrib/src/openjpeg/rules.mak                     |     2 +-
 contrib/src/opus/rules.mak                         |     2 +-
 contrib/src/orc/rules.mak                          |     5 +-
 contrib/src/png/rules.mak                          |     2 +-
 contrib/src/projectM/cpp11.patch                   |    47 +
 contrib/src/projectM/rules.mak                     |     3 +-
 contrib/src/pthreads/rules.mak                     |     2 +-
 contrib/src/qt/rules.mak                           |     2 +-
 contrib/src/qt4/itemviews.patch                    |    11 +
 contrib/src/qt4/rules.mak                          |     1 +
 contrib/src/regex/rules.mak                        |     2 +-
 contrib/src/samplerate/rules.mak                   |     2 +-
 contrib/src/schroedinger/rules.mak                 |     5 +-
 contrib/src/sdl/rules.mak                          |     2 +-
 contrib/src/shout/rules.mak                        |     2 +-
 contrib/src/sidplay2/rules.mak                     |     2 +-
 contrib/src/sparkle/rules.mak                      |     2 +-
 contrib/src/speex/rules.mak                        |     2 +-
 contrib/src/speexdsp/rules.mak                     |     2 +-
 contrib/src/sqlite/rules.mak                       |     2 +-
 contrib/src/ssh2/rules.mak                         |     2 +-
 .../0002-Rewrote-ByteVector-replace-simpler.patch  |   131 -
 contrib/src/taglib/SHA512SUMS                      |     2 +-
 contrib/src/taglib/rules.mak                       |    11 +-
 contrib/src/taglib/taglib-pc.patch                 |    13 -
 contrib/src/theora/rules.mak                       |     3 +-
 contrib/src/tiff/rules.mak                         |     2 +-
 contrib/src/tiger/rules.mak                        |     2 +-
 contrib/src/twolame/rules.mak                      |     2 +-
 contrib/src/upnp/rules.mak                         |     2 +-
 contrib/src/vncserver/rules.mak                    |     2 +-
 contrib/src/vorbis/rules.mak                       |     3 +-
 contrib/src/x265/gcc6-build.patch                  |    22 +
 contrib/src/x265/rules.mak                         |     1 +
 contrib/src/zlib/rules.mak                         |     2 +-
 contrib/src/zvbi/rules.mak                         |     2 +-

Not for us. We do not use vlc's contrib build system.

 ChangeLog                                          |     8 +-
 doc/ChangeLog-2000                                 |    42 +-
 doc/ChangeLog-2001                                 |    12 +-
 doc/ChangeLog-2002                                 |     2 +-
 doc/ChangeLog-2003                                 |   200 +-
 doc/ChangeLog-2004                                 |    81 +-
 doc/ChangeLog-2005                                 |    38 +-
 doc/ChangeLog-2006                                 |    14 +-
 doc/ChangeLog-2007                                 |    40 +-
 doc/ChangeLog-2008                                 |   208 +-
 doc/ChangeLog-2009                                 |   162 +-
 doc/ChangeLog-2010                                 |    91 +-
 doc/ChangeLog-2011                                 |    12 +-
 doc/ChangeLog-2012                                 |    29 +-
 doc/ChangeLog-2013                                 |    48 +-
 doc/ChangeLog-2014                                 |   108 +-
 doc/ChangeLog-2015                                 |     8 +-
 doc/ChangeLog-2016                                 |  1318 +-
 doc/ChangeLog-2017                                 |     0

Auto-generated changelog from git. Digest of the changes is in NEWS, so I
filtered them out.

 .../package/macosx/vlc.xcodeproj/project.pbxproj   |     4 +
 extras/package/win32/NSIS/vlc.win32.nsi.in         |     2 +-
 extras/package/win32/package.mak                   |    11 -
 extras/tools/packages.mak                          |     4 +-
 extras/tools/tools.mak                             |    29 +-
 modules/common.am                                  |     3 +-
 lib/Makefile.am                                    |     3 +-
 modules/gui/macosx/ConvertAndSave.m                |     8 +-
 modules/gui/macosx/MainWindow.m                    |     8 +-
 modules/gui/macosx/Modules.am                      |     2 +
 modules/gui/macosx/VLCDocumentController.h         |    28 +
 modules/gui/macosx/VLCDocumentController.m         |    39 +
 modules/gui/macosx/VideoView.h                     |     9 +-
 modules/gui/macosx/VideoView.m                     |    80 +-
 modules/gui/macosx/intf.m                          |     8 +-
 modules/gui/macosx/playlist.m                      |     7 +-
 modules/gui/macosx/playlistinfo.h                  |     4 +-
 modules/gui/macosx/playlistinfo.m                  |    43 +-
 modules/gui/qt4/main_interface.cpp                 |     4 +-
 modules/gui/qt4/main_interface.hpp                 |     5 +-
 modules/gui/qt4/main_interface_win32.cpp           |    29 +-
 modules/video_output/msw/direct3d.c                |     4 +-
 src/Makefile.am                                    |     3 +-
 src/libvlc_win32_rc.rc.in                          |     2 +-
 src/win32/plugin.c                                 |     4 +-
 src/win32/specific.c                               |    17 +

Not for us. macOS/Windows specific changes or code.

 po/ach.gmo                                         |   Bin 56044 -> 56044 bytes
 po/ach.po                                          |   648 +-
 po/af.gmo                                          |   Bin 121865 -> 121865 bytes
 po/af.po                                           |   648 +-
 po/am.gmo                                          |   Bin 72522 -> 72522 bytes
 po/am.po                                           |   648 +-
 po/an.gmo                                          |   Bin 461722 -> 461722 bytes
 po/an.po                                           |   648 +-
 po/ar.gmo                                          |   Bin 352264 -> 352264 bytes
 po/ar.po                                           |   648 +-
 po/ast.gmo                                         |   Bin 466160 -> 466160 bytes
 po/ast.po                                          |   648 +-
 po/az.gmo                                          |   Bin 6611 -> 6611 bytes
 po/az.po                                           |   648 +-
 po/be.gmo                                          |   Bin 748950 -> 748950 bytes
 po/be.po                                           |   648 +-
 po/bg.gmo                                          |   Bin 630304 -> 630304 bytes
 po/bg.po                                           |   648 +-
 po/bn.gmo                                          |   Bin 666022 -> 666022 bytes
 po/bn.po                                           |   648 +-
 po/bn_IN.gmo                                       |   Bin 795722 -> 795722 bytes
 po/bn_IN.po                                        |   648 +-
 po/br.gmo                                          |   Bin 79760 -> 79760 bytes
 po/br.po                                           |   648 +-
 po/bs.gmo                                          |   Bin 173444 -> 173444 bytes
 po/bs.po                                           |   648 +-
 po/ca.gmo                                          |   Bin 632682 -> 632682 bytes
 po/ca.po                                           |   648 +-
 po/cgg.gmo                                         |   Bin 41777 -> 41777 bytes
 po/cgg.po                                          |   648 +-
 po/ckb.gmo                                         |   Bin 86340 -> 86340 bytes
 po/ckb.po                                          |   648 +-
 po/co.gmo                                          |   Bin 104453 -> 104453 bytes
 po/co.po                                           |   648 +-
 po/cs.gmo                                          |   Bin 252455 -> 252455 bytes
 po/cs.po                                           |   648 +-
 po/cy.gmo                                          |   Bin 297097 -> 297097 bytes
 po/cy.po                                           |   648 +-
 po/da.gmo                                          |   Bin 609236 -> 609236 bytes
 po/da.po                                           |   648 +-
 po/de.gmo                                          |   Bin 630460 -> 630460 bytes
 po/de.po                                           |   648 +-
 po/el.gmo                                          |   Bin 876015 -> 876015 bytes
 po/el.po                                           |   648 +-
 po/en_GB.gmo                                       |   Bin 55380 -> 55380 bytes
 po/en_GB.po                                        |   648 +-
 po/es.gmo                                          |   Bin 631711 -> 631711 bytes
 po/es.po                                           |   648 +-
 po/es_MX.gmo                                       |   Bin 621545 -> 621545 bytes
 po/es_MX.po                                        |   648 +-
 po/et.gmo                                          |   Bin 464053 -> 464053 bytes
 po/et.po                                           |   648 +-
 po/eu.gmo                                          |   Bin 637675 -> 637675 bytes
 po/eu.po                                           |   648 +-
 po/fa.gmo                                          |   Bin 170437 -> 170437 bytes
 po/fa.po                                           |   648 +-
 po/ff.gmo                                          |   Bin 83266 -> 83266 bytes
 po/ff.po                                           |   648 +-
 po/fi.gmo                                          |   Bin 575611 -> 575611 bytes
 po/fi.po                                           |   648 +-
 po/fr.gmo                                          |   Bin 632243 -> 632243 bytes
 po/fr.po                                           |   648 +-
 po/fur.gmo                                         |   Bin 38660 -> 38660 bytes
 po/fur.po                                          |   648 +-
 po/ga.gmo                                          |   Bin 143386 -> 143386 bytes
 po/ga.po                                           |   648 +-
 po/gd.gmo                                          |   Bin 190543 -> 190543 bytes
 po/gd.po                                           |   648 +-
 po/gl.gmo                                          |   Bin 622560 -> 622560 bytes
 po/gl.po                                           |   648 +-
 po/gu.gmo                                          |   Bin 924359 -> 924359 bytes
 po/gu.po                                           |   648 +-
 po/he.gmo                                          |   Bin 234710 -> 234710 bytes
 po/he.po                                           |   648 +-
 po/hi.gmo                                          |   Bin 148031 -> 148031 bytes
 po/hi.po                                           |   648 +-
 po/hr.gmo                                          |   Bin 556631 -> 556631 bytes
 po/hr.po                                           |   648 +-
 po/hu.gmo                                          |   Bin 642207 -> 642207 bytes
 po/hu.po                                           |   648 +-
 po/hy.gmo                                          |   Bin 135847 -> 135847 bytes
 po/hy.po                                           |   648 +-
 po/ia.gmo                                          |   Bin 11156 -> 11156 bytes
 po/ia.po                                           |   648 +-
 po/id.gmo                                          |   Bin 426945 -> 426945 bytes
 po/id.po                                           |   648 +-
 po/is.gmo                                          |   Bin 194551 -> 194551 bytes
 po/is.po                                           |   648 +-
 po/it.gmo                                          |   Bin 631171 -> 631171 bytes
 po/it.po                                           |   648 +-
 po/ja.gmo                                          |   Bin 701303 -> 701303 bytes
 po/ja.po                                           |   648 +-
 po/ka.gmo                                          |   Bin 58548 -> 58548 bytes
 po/ka.po                                           |   648 +-
 po/kk.gmo                                          |   Bin 253732 -> 253732 bytes
 po/kk.po                                           |   648 +-
 po/km.gmo                                          |   Bin 1011849 -> 1011849 bytes
 po/km.po                                           |   648 +-
 po/kn.gmo                                          |   Bin 827850 -> 827850 bytes
 po/kn.po                                           |   648 +-
 po/ko.gmo                                          |   Bin 637461 -> 637461 bytes
 po/ko.po                                           |   648 +-
 po/ks_IN.gmo                                       |   Bin 796960 -> 796960 bytes
 po/ks_IN.po                                        |   648 +-
 po/ky.gmo                                          |   Bin 38646 -> 38646 bytes
 po/ky.po                                           |   648 +-
 po/lg.gmo                                          |   Bin 55141 -> 55141 bytes
 po/lg.po                                           |   648 +-
 po/lt.gmo                                          |   Bin 346587 -> 346587 bytes
 po/lt.po                                           |   648 +-
 po/lv.gmo                                          |   Bin 633894 -> 633894 bytes
 po/lv.po                                           |   648 +-
 po/mai.gmo                                         |   Bin 941125 -> 941125 bytes
 po/mai.po                                          |   648 +-
 po/mk.gmo                                          |   Bin 10685 -> 10685 bytes
 po/mk.po                                           |   648 +-
 po/ml.gmo                                          |   Bin 1161723 -> 1161723 bytes
 po/ml.po                                           |   648 +-
 po/mn.gmo                                          |   Bin 80904 -> 80904 bytes
 po/mn.po                                           |   648 +-
 po/mr.gmo                                          |   Bin 1028378 -> 1028378 bytes
 po/mr.po                                           |   648 +-
 po/ms.gmo                                          |   Bin 598045 -> 598045 bytes
 po/ms.po                                           |   648 +-
 po/my.gmo                                          |   Bin 14938 -> 14938 bytes
 po/my.po                                           |   648 +-
 po/nb.gmo                                          |   Bin 177889 -> 177889 bytes
 po/nb.po                                           |   648 +-
 po/ne.gmo                                          |   Bin 364649 -> 364649 bytes
 po/ne.po                                           |   648 +-
 po/nl.gmo                                          |   Bin 614977 -> 614977 bytes
 po/nl.po                                           |   648 +-
 po/nn.gmo                                          |   Bin 117993 -> 117993 bytes
 po/nn.po                                           |   648 +-
 po/oc.gmo                                          |   Bin 627912 -> 627912 bytes
 po/oc.po                                           |   648 +-
 po/or.gmo                                          |   Bin 25414 -> 25414 bytes
 po/or.po                                           |   648 +-
 po/pa.gmo                                          |   Bin 287789 -> 287789 bytes
 po/pa.po                                           |   648 +-
 po/pl.gmo                                          |   Bin 627299 -> 627299 bytes
 po/pl.po                                           |   648 +-
 po/ps.gmo                                          |   Bin 42859 -> 42859 bytes
 po/ps.po                                           |   648 +-
 po/pt_BR.gmo                                       |   Bin 632235 -> 632235 bytes
 po/pt_BR.po                                        |   648 +-
 po/pt_PT.gmo                                       |   Bin 629218 -> 629218 bytes
 po/pt_PT.po                                        |   648 +-
 po/ro.gmo                                          |   Bin 421574 -> 421574 bytes
 po/ro.po                                           |   648 +-
 po/ru.gmo                                          |   Bin 798036 -> 798036 bytes
 po/ru.po                                           |   648 +-
 po/si.gmo                                          |   Bin 281537 -> 281537 bytes
 po/si.po                                           |   648 +-
 po/sk.gmo                                          |   Bin 651431 -> 651431 bytes
 po/sk.po                                           |   648 +-
 po/sl.gmo                                          |   Bin 601328 -> 601328 bytes
 po/sl.po                                           |   648 +-
 po/sq.gmo                                          |   Bin 68478 -> 68478 bytes
 po/sq.po                                           |   648 +-
 po/sr.gmo                                          |   Bin 359056 -> 359056 bytes
 po/sr.po                                           |   648 +-
 po/sv.gmo                                          |   Bin 481243 -> 481243 bytes
 po/sv.po                                           |   648 +-
 po/ta.gmo                                          |   Bin 153159 -> 153159 bytes
 po/ta.po                                           |   648 +-
 po/te.gmo                                          |   Bin 147576 -> 147576 bytes
 po/te.po                                           |   648 +-
 po/tet.gmo                                         |   Bin 484 -> 484 bytes
 po/tet.po                                          |   648 +-
 po/th.gmo                                          |   Bin 357399 -> 357399 bytes
 po/th.po                                           |   648 +-
 po/tl.gmo                                          |   Bin 461 -> 461 bytes
 po/tl.po                                           |   648 +-
 po/tr.gmo                                          |   Bin 637497 -> 637497 bytes
 po/tr.po                                           |   648 +-
 po/uk.gmo                                          |   Bin 807692 -> 807692 bytes
 po/uk.po                                           |   648 +-
 po/uz.gmo                                          |   Bin 58367 -> 58367 bytes
 po/uz.po                                           |   648 +-
 po/vi.gmo                                          |   Bin 555978 -> 555978 bytes
 po/vi.po                                           |   648 +-
 po/vlc.pot                                         |   652 +-
 po/wa.gmo                                          |   Bin 286261 -> 286261 bytes
 po/wa.po                                           |   648 +-
 po/zh_CN.gmo                                       |   Bin 570529 -> 570529 bytes
 po/zh_CN.po                                        |   648 +-
 po/zh_TW.gmo                                       |   Bin 280132 -> 280132 bytes
 po/zh_TW.po                                        |   648 +-
 po/zu.gmo                                          |   Bin 61307 -> 61307 bytes
 po/zu.po                                           |   648 +-

Translation updates.

So we end up with the following upstream changes (vlc.updstream.diff):

 NEWS                                               |    52 +
 configure.ac                                       |    36 +-
 doc/Makefile.am                                    |     1 +
 include/vlc_atomic.h                               |     4 +-
 include/vlc_picture.h                              |     6 +-
 m4/flags.m4                                        |    12 +
 modules/access/dvb/access.c                        |     4 +-
 modules/access/ftp.c                               |     7 +-
 modules/access/http.c                              |    89 +-
 modules/access/rdp.c                               |     4 +-
 modules/access/rtp/rtp.c                           |     3 +
 modules/access/screen/screen.c                     |     5 +-
 modules/audio_filter/stereo_widen.c                |    71 +-
 modules/audio_output/directsound.c                 |     4 +-
 modules/codec/adpcm.c                              |    87 +-
 modules/codec/aes3.c                               |     4 +-
 modules/codec/avcodec/fourcc.c                     |     2 +-
 modules/codec/avcodec/video.c                      |    23 +-
 modules/codec/lpcm.c                               |    16 +-
 modules/codec/opus_header.c                        |     3 +
 modules/codec/scte27.c                             |     4 +-
 modules/demux/aiff.c                               |    32 +-
 modules/demux/asf/libasf.c                         |     3 +
 modules/demux/avi/avi.c                            |    12 +-
 modules/demux/mp4/libmp4.c                         |    41 +-
 modules/demux/mp4/libmp4.h                         |     2 +-
 modules/demux/mp4/mp4.c                            |    17 +-
 modules/demux/nsv.c                                |    13 +-
 modules/demux/smf.c                                |     8 +-
 modules/demux/voc.c                                |     4 +-
 modules/demux/xa.c                                 |     8 +-
 modules/demux/xiph_metadata.c                      |   192 +-
 modules/demux/xiph_metadata.h                      |     6 +-
 modules/gui/qt4/actions_manager.cpp                |     4 +-
 modules/gui/qt4/adapters/seekpoints.cpp            |     4 +-
 modules/gui/qt4/adapters/seekpoints.hpp            |     4 +-
 modules/gui/qt4/components/controller.cpp          |    17 +-
 modules/gui/qt4/components/controller.hpp          |     6 +-
 .../gui/qt4/components/playlist/playlist_model.hpp |     6 +-
 modules/gui/qt4/components/playlist/views.cpp      |     8 +-
 modules/gui/qt4/components/simple_preferences.cpp  |     4 +-
 modules/gui/qt4/dialogs/epg.cpp                    |    29 +-
 modules/gui/qt4/dialogs/epg.hpp                    |     7 +-
 modules/gui/qt4/dialogs/messages.cpp               |     4 +-
 modules/gui/qt4/dialogs/plugins.hpp                |     2 +-
 modules/gui/qt4/dialogs/vlm.cpp                    |     6 +-
 modules/gui/qt4/dialogs/vlm.hpp                    |     6 +-
 modules/gui/qt4/input_manager.cpp                  |     4 +-
 modules/gui/qt4/input_manager.hpp                  |     5 +-
 modules/gui/qt4/menus.cpp                          |     4 +-
 modules/gui/qt4/qt4.hpp                            |    34 +-
 modules/gui/qt4/ui/sprefs_interface.ui             |    21 +-
 modules/gui/qt4/util/pictureflow.cpp               |     2 +
 modules/mux/mp4.c                                  |   120 +-
 modules/packetizer/h264.c                          |    16 +-
 modules/text_renderer/quartztext.c                 |     2 +-
 modules/video_splitter/Makefile.am                 |     4 +-
 modules/visualization/projectm.cpp                 |     6 +-
 share/Makefile.am                                  |    16 +-
 share/lua/extensions/VLSub.lua                     |     4 +-
 share/lua/http/index.html                          |     2 +-
 share/lua/intf/cli.lua                             |     3 +-
 share/lua/playlist/appletrailers.lua               |   136 +-
 share/lua/playlist/dailymotion.lua                 |    87 +-
 share/lua/playlist/soundcloud.lua                  |     4 +-
 share/lua/playlist/vimeo.lua                       |    16 +-
 share/lua/playlist/youtube.lua                     |    30 +-
 share/lua/sd/metachannels.lua                      |    75 -
 share/vlc.desktop.in                               |     6 +-
 src/misc/picture.c                                 |    33 +-
 src/playlist/fetcher.c                             |     4 +-
 src/playlist/preparser.c                           |     6 +-
 src/revision.c                                     |     2 +-
 src/revision.txt                                   |     2 +-
 src/text/unicode.c                                 |    14 +-
 test/run_vlc.sh                                    |     2 +-

debian/ contains the following changes (vlc.debian.diff):

 debian/changelog                                   |  12 +
 debian/libvlc-dev.maintscript                      |   4 +-
 debian/libvlc5.maintscript                         |   4 +-
 debian/libvlccore-dev.maintscript                  |   4 +-
 debian/libvlccore8.maintscript                     |   2 +-
 .../Fix-build-using-old-GCC-intrinsics.patch       | 292 ---------------------
 ...d-default.vlt-in-a-reproducible-fashion-f.patch |  29 --
 .../VLSub-don-t-pretend-to-support-HTTP-1.1.patch  |  39 ---
 debian/patches/fix-translation.patch               |  18 +-
 debian/patches/series                              |  10 -
 .../patches/skins-implement-silent-mode-make.patch |  23 --
 ...ove-timestamp-from-default.vlt-fixes-4562.patch |  20 --
 ...-not-generate-broken-default.vlt-on-error.patch |  26 --
 ...ot-save-user-and-group-names-in-the-defau.patch |  24 --
 ...ideo_splliter-Add-XCB-flags-for-panoramix.patch |  41 ---
 ...atomic_compare_exchange_strong_explicit-t.patch |  27 --
 ...atomic_compare_exchange_weak_explicit-tak.patch |  31 ---
 debian/vlc-nox.maintscript                         |   2 +-
 debian/vlc-plugin-fluidsynth.maintscript           |   2 +-
 debian/vlc-plugin-jack.maintscript                 |   2 +-
 debian/vlc-plugin-notify.maintscript               |   2 +-
 debian/vlc-plugin-samba.maintscript                |   2 +-
 debian/vlc-plugin-sdl.maintscript                  |   2 +-
 debian/vlc-plugin-svg.maintscript                  |   2 +-
 debian/vlc-plugin-zvbi.maintscript                 |   2 +-
 debian/vlc.maintscript                             |   4 +-

In short: The removed patches in debian/patches were all backported from the
2.2.x branch and were included in 2.2.5. The version changes in the maintscript
files accommodate a future jessie update of vlc to 2.2.5.

unblock vlc/2.2.5-1

Cheers
-- 
Sebastian Ramacher
diff --git a/NEWS b/NEWS
index 1af86bef03..247d7477e1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,55 @@
+Changes between 2.2.4 and 2.2.5:
+--------------------------------
+
+Decoder:
+ * Fix mp3 playback quality regression in libmad
+ * Fix video scaling in VDPAU
+ * Fix playback of palettized codecs
+ * Fix ADPCM heap corruption (FG-VD-16-067)
+ * Fix AES3 16bps decoding
+ * Fix DVD/LPCM heap corruption (FG-VD-16-090)
+ * Fix SCTE-27 colors
+
+Demuxer:
+ * Fix possible ASF integer overflow
+ * Fix MP4, VOC, XA, SMF divide-by-zero errors
+ * Fix MP4 heap buffer overflows
+ * Fix Flac metadata integer overflow
+ * Fix NSVf and AIFF infinite loops
+ * Fix flac null-pointer dereference
+ * Fix vorbis and opus comments integer overflows and leaks
+
+Video output:
+ * Fix green line on Windows with AMD drivers
+ * Fix screenshots size
+
+Access:
+ * Fix crash in screen recording on Windows
+ * Fix FTP scan string injection
+ * Fix HTTP size handling
+
+Mux:
+ * Fix mp4 drift
+
+Lua:
+ * Fix vimeo, youtube, dailymotion, cli, appletrailers, http,
+   soundcloud scripts
+
+Audio filter:
+ * Fix heap write in stereo_widen audio filter
+
+Windows:
+ * The plugins loading will not load external DLLs by default.
+   Plugins will need to LoadLibrary explicitely.
+ * Fix uninstaller path handling
+ * Fix taskbar buttons behavior
+
+MacOS:
+ * Fix scrolling sensitivity on Sierra
+ * Resume points are deleted now if the user clears the list of
+   recent items
+
+
 Changes between 2.2.3 and 2.2.4:
 --------------------------------
 
diff --git a/configure.ac b/configure.ac
index e021546e28..e68ce88618 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,11 @@
 dnl Autoconf settings for vlc
 
-AC_COPYRIGHT([Copyright 1999-2016 VLC authors and VideoLAN])
+AC_COPYRIGHT([Copyright 1999-2017 VLC authors and VideoLAN])
 
-AC_INIT(vlc, 2.2.4)
+AC_INIT(vlc, 2.2.5)
 VERSION_MAJOR=2
 VERSION_MINOR=2
-VERSION_REVISION=4
+VERSION_REVISION=5
 VERSION_EXTRA=0
 VERSION_DEV=
 
@@ -14,7 +14,7 @@ AC_SUBST(PKGDIR)
 
 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
 CODENAME="Weatherwax"
-COPYRIGHT_YEARS="1996-2016"
+COPYRIGHT_YEARS="1996-2017"
 
 AC_CONFIG_SRCDIR(src/libvlc.c)
 AC_CONFIG_AUX_DIR(autotools)
@@ -222,6 +222,9 @@ case "${host_os}" in
     fi
     ;;
   *mingw32* | *cygwin* | *wince* | *mingwce*)
+    dnl Force libtool to not link to (shared) libgcc_s when detecting C++ dependencies
+    dnl When doing this test with -static-libgcc it will link on (static) libgcc_eh
+    CXXFLAGS="${CXXFLAGS} -static-libgcc"
     AC_CHECK_TOOL(WINDRES, windres, :)
     AC_CHECK_TOOL(OBJCOPY, objcopy, :)
     AH_TOP([#if defined(_WIN32) && !defined(_WIN32_WINNT)])
@@ -978,24 +981,15 @@ AS_IF([test "${enable_optimizations}" != "no"], [
     ])
   ])
 
-  dnl Check for -ffast-math
-  VLC_SAVE_FLAGS
-  CFLAGS="${CFLAGS} -ffast-math"
-  CXXFLAGS="${CXXFLAGS} -ffast-math"
-  OBJCFLAGS="${OBJCFLAGS} -ffast-math"
-  AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
-      ac_cv_c_fast_math=yes
-    ], [
-      ac_cv_c_fast_math=no
-    ])
-  ])
-  AS_IF([test "${ac_cv_c_fast_math}" = "no"], [VLC_RESTORE_FLAGS])
-  AH_BOTTOM([
-#ifndef __FAST_MATH__
+  dnl Check for fast maths
+  RDC_PROG_CC_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
+  AC_LANG_PUSH(C++)
+  RDC_PROG_CXX_FFLAGS([no-math-errno unsafe-math-optimizations no-rounding-math no-signaling-nans cx-limited-range])
+  AC_LANG_POP
+
+AH_BOTTOM([
 # pragma STDC FENV_ACCESS OFF
 # pragma STDC FP_CONTRACT ON
-#endif
 ])
 
   dnl Check for -funroll-loops
@@ -1436,7 +1430,7 @@ AS_IF([test "${enable_altivec}" = "yes"], [
     CPPFLAGS="${CPPFLAGS} ${ac_cv_c_altivec}"
     AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, [Define to 1 if C AltiVec extensions are available.])
     VLC_ADD_CFLAGS([libvlccore],[${ac_cv_c_altivec}])
-    ALTIVEC_CFLAGS="$ALTIVEC_FLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
+    ALTIVEC_CFLAGS="$ALTIVEC_CFLAGS ${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}"
     VLC_ADD_CFLAGS([deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
     have_altivec="yes"
   ])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index cc65315091..342463f500 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -39,6 +39,7 @@ CHANGELOGS = \
 	ChangeLog-2014 \
 	ChangeLog-2015 \
 	ChangeLog-2016 \
+	ChangeLog-2017 \
 	$(NULL)
 
 man1_MANS = \
diff --git a/include/vlc_atomic.h b/include/vlc_atomic.h
index af88eabb5e..15ccf8c9ad 100644
--- a/include/vlc_atomic.h
+++ b/include/vlc_atomic.h
@@ -152,13 +152,13 @@ typedef         uintmax_t atomic_uintmax_t;
 #  define atomic_compare_exchange_strong(object,expected,desired) \
     atomic_compare_exchange(object, expected, desired)
 
-#  define atomic_compare_exchange_strong_explicit(object,expected,desired,order) \
+#  define atomic_compare_exchange_strong_explicit(object,expected,desired,order,order_different) \
     atomic_compare_exchange_strong(object, expected, desired)
 
 #  define atomic_compare_exchange_weak(object,expected,desired) \
     atomic_compare_exchange(object, expected, desired)
 
-#  define atomic_compare_exchange_weak_explicit(object,expected,desired,order) \
+#  define atomic_compare_exchange_weak_explicit(object,expected,desired,order_equal,order_different) \
     atomic_compare_exchange_weak(object, expected, desired)
 
 #  define atomic_fetch_add(object,operand) \
diff --git a/include/vlc_picture.h b/include/vlc_picture.h
index 8edbb5e086..0dc2b08b69 100644
--- a/include/vlc_picture.h
+++ b/include/vlc_picture.h
@@ -2,7 +2,7 @@
  * vlc_picture.h: picture definitions
  *****************************************************************************
  * Copyright (C) 1999 - 2009 VLC authors and VideoLAN
- * $Id: dea3f7f0c608416e89b75197430dd66db61e0639 $
+ * $Id: e45374ba04791df4b80ebda3987d4897757b5663 $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -32,7 +32,9 @@
  */
 
 #include <vlc_es.h>
-#include <vlc_atomic.h>
+#if (defined (__LIBVLC__) && !defined (__PLUGIN__))
+# include <vlc_atomic.h>
+#endif
 
 /** Description of a planar graphic field */
 typedef struct plane_t
diff --git a/m4/flags.m4 b/m4/flags.m4
index 920fd45bdb..d531ebe1e2 100644
--- a/m4/flags.m4
+++ b/m4/flags.m4
@@ -37,6 +37,12 @@ AC_DEFUN([RDC_PROG_CC_WFLAGS],
   done
 ])
 
+AC_DEFUN([RDC_PROG_CC_FFLAGS],
+[ for a in $1; do
+    RDC_PROG_CC_FLAGS([-f$a])
+  done
+])
+
 AC_DEFUN([RDC_PROG_CXX_FLAGS_IFELSE],
 [AC_LANG_ASSERT(C++)
   CXXFLAGS_save="${CXXFLAGS}"
@@ -66,6 +72,12 @@ AC_DEFUN([RDC_PROG_CXX_WFLAGS],
   done
 ])
 
+AC_DEFUN([RDC_PROG_CXX_FFLAGS],
+[ for a in $1; do
+    RDC_PROG_CXX_FLAGS([-f$a])
+  done
+])
+
 AC_DEFUN([RDC_PROG_LINK_FLAGS_IFELSE],
 [AC_LANG_ASSERT(C)
   LDFLAGS_save="${LDFLAGS}"
diff --git a/modules/access/dvb/access.c b/modules/access/dvb/access.c
index 6932ab4ea7..b8551a0c78 100644
--- a/modules/access/dvb/access.c
+++ b/modules/access/dvb/access.c
@@ -548,7 +548,7 @@ static int ParseMRL( access_t *p_access )
                 val.i_int = 18;
             else
             {
-                msg_Err( p_access, "illegal polarization %c", *psz_parser );
+                msg_Warn( p_access, "illegal polarization %c", *psz_parser );
                 free( psz_dup );
                 return VLC_EGENERIC;
             }
@@ -556,7 +556,7 @@ static int ParseMRL( access_t *p_access )
         }
         else
         {
-            msg_Err( p_access, "unknown option (%s)", psz_parser );
+            msg_Warn( p_access, "unknown option (%s)", psz_parser );
             free( psz_dup );
             return VLC_EGENERIC;
         }
diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index ff641b8b18..9c140d86d4 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2001-2006 VLC authors and VideoLAN
  * Copyright © 2006 Rémi Denis-Courmont
- * $Id: ce3cc795a3993b127cc9b2296fb8a6a3ab857109 $
+ * $Id: 54a2aa487814b1a1c1df23b71025f894bb84e917 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr> - original code
  *          Rémi Denis-Courmont <rem # videolan.org> - EPSV support
@@ -939,10 +939,7 @@ static int ftp_StartStream( vlc_object_t *p_access, access_sys_t *p_sys,
 
     if( *psz_ip )
     {
-        char psz_fmt[7] = "(|||%u";
-        psz_fmt[1] = psz_fmt[2] = psz_fmt[3] = psz_parser[1];
-
-        if( sscanf( psz_parser, psz_fmt, &i_port ) < 1 )
+        if( sscanf( psz_parser, "(%*3c%u", &i_port ) < 1 )
         {
             free( psz_arg );
             msg_Err( p_access, "cannot parse passive mode response" );
diff --git a/modules/access/http.c b/modules/access/http.c
index d2ba26b7bc..7ac1095be5 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -2,7 +2,7 @@
  * http.c: HTTP input module
  *****************************************************************************
  * Copyright (C) 2001-2008 VLC authors and VideoLAN
- * $Id: 0abe269b6297e20e573a8a36b6caf23d9743d263 $
+ * $Id: 1ccd8fd9d08173351b96f0a8b0a7b3303f6f3993 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -175,7 +175,7 @@ struct access_sys_t
     char       *psz_icy_genre;
     char       *psz_icy_title;
 
-    uint64_t i_remaining;
+    uintmax_t i_remaining;
     uint64_t size;
 
     bool b_seekable;
@@ -183,7 +183,6 @@ struct access_sys_t
     bool b_continuous;
     bool b_pace_control;
     bool b_persist;
-    bool b_has_size;
 
     vlc_array_t * cookies;
 };
@@ -275,10 +274,9 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
     p_sys->psz_icy_name = NULL;
     p_sys->psz_icy_genre = NULL;
     p_sys->psz_icy_title = NULL;
-    p_sys->i_remaining = 0;
+    p_sys->i_remaining = -1;
     p_sys->b_persist = false;
-    p_sys->b_has_size = false;
-    p_sys->size = 0;
+    p_sys->size = -1;
     p_access->info.i_pos  = 0;
     p_access->info.b_eof  = false;
 
@@ -724,15 +722,9 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
     if( p_sys->fd == -1 )
         goto fatal;
 
-    if( p_sys->b_has_size )
-    {
-        /* Remaining bytes in the file */
-        uint64_t remainder = p_sys->size - p_access->info.i_pos;
-        if( remainder < i_len )
-            i_len = remainder;
-
-        /* Remaining bytes in the response */
-        if( p_sys->i_remaining < i_len )
+    if( p_sys->i_remaining != UINTMAX_MAX )
+    {   /* Remaining bytes in the response */
+        if( i_len > p_sys->i_remaining )
             i_len = p_sys->i_remaining;
     }
     if( i_len == 0 )
@@ -798,9 +790,8 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
 
     assert( i_read >= 0 );
     p_access->info.i_pos += i_read;
-    if( p_sys->b_has_size )
+    if( p_sys->i_remaining != UINTMAX_MAX )
     {
-        assert( p_access->info.i_pos <= p_sys->size );
         assert( (unsigned)i_read <= p_sys->i_remaining );
         p_sys->i_remaining -= i_read;
     }
@@ -936,7 +927,7 @@ static int Seek( access_t *p_access, uint64_t i_pos )
     msg_Dbg( p_access, "trying to seek to %"PRId64, i_pos );
     Disconnect( p_access );
 
-    if( p_sys->size && i_pos >= p_sys->size )
+    if( p_sys->size != UINT64_MAX && i_pos >= p_sys->size )
     {
         msg_Err( p_access, "seek too far" );
         int retval = Seek( p_access, p_sys->size - 1 );
@@ -996,9 +987,10 @@ static int Control( access_t *p_access, int i_query, va_list args )
             break;
 
         case ACCESS_GET_SIZE:
-            pi_64 = (int64_t*)va_arg( args, int64_t * );
-            *pi_64 = p_sys->size;
-           break;
+            if( p_sys->size == UINT64_MAX )
+                return VLC_EGENERIC;
+            *va_arg( args, int64_t * ) = p_sys->size;
+            break;
 
         /* */
         case ACCESS_SET_PAUSE_STATE:
@@ -1045,10 +1037,9 @@ static int Connect( access_t *p_access, uint64_t i_tell )
     p_sys->psz_icy_name = NULL;
     p_sys->psz_icy_genre = NULL;
     p_sys->psz_icy_title = NULL;
-    p_sys->i_remaining = 0;
+    p_sys->i_remaining = -1;
     p_sys->b_persist = false;
-    p_sys->b_has_size = false;
-    p_sys->size = 0;
+    p_sys->size = -1;
     p_access->info.i_pos  = i_tell;
     p_access->info.b_eof  = false;
 
@@ -1149,7 +1140,7 @@ static int Request( access_t *p_access, uint64_t i_tell )
     v_socket_t     *pvs = p_sys->p_vs;
     p_sys->b_persist = false;
 
-    p_sys->i_remaining = 0;
+    p_sys->i_remaining = -1;
 
     const char *psz_path = p_sys->url.psz_path;
     if( !psz_path || !*psz_path )
@@ -1326,30 +1317,36 @@ static int Request( access_t *p_access, uint64_t i_tell )
 
         if( !strcasecmp( psz, "Content-Length" ) )
         {
-            uint64_t i_size = i_tell + (p_sys->i_remaining = (uint64_t)atoll( p ));
-            if(i_size > p_sys->size) {
-                p_sys->b_has_size = true;
-                p_sys->size = i_size;
+            if( sscanf( p, "%"SCNuMAX, &p_sys->i_remaining ) < 1 )
+            {
+                free( psz );
+                goto error;
             }
-            msg_Dbg( p_access, "this frame size=%"PRIu64, p_sys->i_remaining );
+
+            msg_Dbg( p_access, "response body size=%"PRIuMAX,
+                     p_sys->i_remaining );
+            if( p_sys->size == UINT64_MAX )
+                p_sys->size = i_tell + p_sys->i_remaining;
         }
         else if( !strcasecmp( psz, "Content-Range" ) ) {
-            uint64_t i_ntell = i_tell;
-            uint64_t i_nend = (p_sys->size > 0) ? (p_sys->size - 1) : i_tell;
-            uint64_t i_nsize = p_sys->size;
-            sscanf(p,"bytes %"SCNu64"-%"SCNu64"/%"SCNu64,&i_ntell,&i_nend,&i_nsize);
-            if(i_nend > i_ntell ) {
-                p_access->info.i_pos = i_ntell;
-                p_sys->i_icy_offset  = i_ntell;
-                p_sys->i_remaining = i_nend+1-i_ntell;
-                uint64_t i_size = (i_nsize > i_nend) ? i_nsize : (i_nend + 1);
-                if(i_size > p_sys->size) {
-                    p_sys->b_has_size = true;
-                    p_sys->size = i_size;
-                }
-                msg_Dbg( p_access, "stream size=%"PRIu64",pos=%"PRIu64",remaining=%"PRIu64,
-                         i_nsize, i_ntell, p_sys->i_remaining);
+            uint64_t end, size;
+
+            p_sys->size = -1;
+
+            switch( sscanf( p, "bytes %*u-%"SCNu64"/%"SCNu64, &end, &size ) )
+            {
+                case 1:
+                    if( unlikely(size == UINT64_MAX) )
+                        break;
+                    size = end + 1;
+                    /* fall through */
+                case 2:
+                    p_sys->size = size;
+                    msg_Dbg( p_access, "resource size=%"PRIu64, size );
+                    break;
             }
+
+            p_sys->i_icy_offset  = i_tell;
         }
         else if( !strcasecmp( psz, "Connection" ) ) {
             msg_Dbg( p_access, "Connection: %s",p );
@@ -1557,7 +1554,7 @@ static int Request( access_t *p_access, uint64_t i_tell )
     /* We close the stream for zero length data, unless of course the
      * server has already promised to do this for us.
      */
-    if( p_sys->b_has_size && p_sys->i_remaining == 0 && p_sys->b_persist ) {
+    if( p_sys->i_remaining == 0 && p_sys->b_persist ) {
         Disconnect( p_access );
     }
     return VLC_SUCCESS;
diff --git a/modules/access/rdp.c b/modules/access/rdp.c
index 0a11f4217a..744788be66 100644
--- a/modules/access/rdp.c
+++ b/modules/access/rdp.c
@@ -46,7 +46,7 @@
 #endif
 
 #if !defined(FREERDP_VERSION_MAJOR) || \
-    (defined(FREERDP_VERSION_MAJOR) && !(FREERDP_VERSION_MAJOR >= 1 && FREERDP_VERSION_MINOR >= 1 ))
+    (defined(FREERDP_VERSION_MAJOR) && !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1)))
 # define SoftwareGdi sw_gdi
 # define Fullscreen fullscreen
 # define ServerHostname hostname
@@ -233,7 +233,7 @@ static bool postConnectHandler( freerdp *p_instance )
     vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context;
 
     msg_Dbg( p_vlccontext->p_demux, "connected to desktop %dx%d (%d bpp)",
-#if (FREERDP_VERSION_MAJOR >= 1 && FREERDP_VERSION_MINOR >= 1 )
+#if defined(FREERDP_VERSION_MAJOR) && (FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1))
              p_instance->settings->DesktopWidth,
              p_instance->settings->DesktopHeight,
              p_instance->settings->ColorDepth
diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 455c0e82f7..c5620e9b3f 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -744,6 +744,9 @@ void rtp_autodetect (demux_t *demux, rtp_session_t *session,
                 pt.destroy = xiph_destroy;
                 pt.decode = xiph_decode;
                 pt.frequency = 90000;
+
+                free (dynamic);
+                break;
             }
             else
                 msg_Err (demux, "unknown dynamic payload format `%s' "
diff --git a/modules/access/screen/screen.c b/modules/access/screen/screen.c
index 506ce7bded..d2842643e2 100644
--- a/modules/access/screen/screen.c
+++ b/modules/access/screen/screen.c
@@ -2,7 +2,7 @@
  * screen.c: Screen capture module.
  *****************************************************************************
  * Copyright (C) 2004-2008 VLC authors and VideoLAN
- * $Id: 4b1f4f528b3c7b894a1c194fbba9d0e91e58dfde $
+ * $Id: 862dbb42cae2a1b7ddeea2a203cea8c4ce7dc8ca $
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *          Antoine Cellerier <dionoea at videolan dot org>
@@ -179,6 +179,9 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    p_sys->fmt.video.i_frame_rate      = 1000000;
+    p_sys->fmt.video.i_frame_rate_base = p_sys->i_incr;
+
     msg_Dbg( p_demux, "screen width: %i, height: %i, depth: %i",
              p_sys->fmt.video.i_width, p_sys->fmt.video.i_height,
              p_sys->fmt.video.i_bits_per_pixel );
diff --git a/modules/audio_filter/stereo_widen.c b/modules/audio_filter/stereo_widen.c
index 796468acbf..9cc652a58d 100644
--- a/modules/audio_filter/stereo_widen.c
+++ b/modules/audio_filter/stereo_widen.c
@@ -41,15 +41,13 @@ static int paramCallback( vlc_object_t *, char const *, vlc_value_t ,
 
 struct filter_sys_t
 {
-    float *pf_begin;    /* circular buffer to store samples */
+    float *pf_ringbuf;  /* circular buffer to store samples */
     float *pf_write;    /* where to write current sample    */
-    int   i_len;        /* delay in number of samples       */
+    size_t i_len;       /* delay in number of samples       */
     float f_delay;      /* delay in milliseconds            */
     float f_feedback;
     float f_crossfeed;
     float f_dry_mix;
-    bool  b_free_buf;   /* used if callback to delay fails to       *
-                         * allocate buffer, then dont free it twice */
 };
 
 #define HELP_TEXT N_("This filter enhances the stereo effect by "\
@@ -82,7 +80,8 @@ vlc_module_begin ()
     set_capability( "audio filter", 0 )
     set_callbacks( Open, Close )
 
-    add_float( "delay", 20, DELAY_TEXT, DELAY_LONGTEXT, true )
+    add_float_with_range( "delay", 20, 1, 100,
+        DELAY_TEXT, DELAY_LONGTEXT, true )
     add_float_with_range( "feedback", 0.3, 0.0, 0.9,
         FEEDBACK_TEXT, FEEDBACK_LONGTEXT, true )
     add_float_with_range( "crossfeed", 0.3, 0.0, 0.8,
@@ -94,6 +93,25 @@ vlc_module_end ()
 /*****************************************************************************
  * Open: Allocate buffer
  *****************************************************************************/
+static int MakeRingBuffer( float **pp_buffer, size_t *pi_buffer,
+                           float **pp_write, float f_delay, unsigned i_rate )
+{
+    const size_t i_size = (2 * (size_t)(1 + f_delay * i_rate / 1000));
+
+    if( unlikely(SIZE_MAX / sizeof(float) < i_size) )
+        return VLC_EGENERIC;
+
+    float *p_realloc = realloc( *pp_buffer, i_size * sizeof(float) );
+    if( !p_realloc )
+        return VLC_ENOMEM;
+
+    memset( p_realloc, 0, i_size * sizeof(float) );
+    *pp_write = *pp_buffer = p_realloc;
+    *pi_buffer = i_size;
+
+    return VLC_SUCCESS;
+}
+
 static int Open( vlc_object_t *obj )
 {
     filter_t *p_filter  = (filter_t *)obj;
@@ -123,20 +141,19 @@ static int Open( vlc_object_t *obj )
     CREATE_VAR( f_dry_mix, "dry-mix" )
 
     /* Compute buffer length and allocate space */
-    p_sys->i_len = 2 * p_sys->f_delay * p_filter->fmt_in.audio.i_rate / 1000;
-    p_sys->pf_begin = calloc( p_sys->i_len + 2, sizeof(float) );
-    if( unlikely(!p_sys->pf_begin) )
+    p_sys->pf_ringbuf = NULL;
+    p_sys->i_len = 0;
+    if( MakeRingBuffer( &p_sys->pf_ringbuf, &p_sys->i_len, &p_sys->pf_write,
+                        p_sys->f_delay, p_filter->fmt_in.audio.i_rate ) != VLC_SUCCESS )
     {
         free( p_sys );
         return VLC_ENOMEM;
     }
-    p_sys->b_free_buf = true;
-    p_sys->pf_write = p_sys->pf_begin;
+
     p_filter->pf_audio_filter = Filter;
     return VLC_SUCCESS;
 }
 
-
 /*****************************************************************************
  * Filter: process each sample
  *****************************************************************************/
@@ -150,8 +167,8 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
     {
         pf_read = p_sys->pf_write + 2;
         /* if at end of buffer put read ptr at begin */
-        if( pf_read > p_sys->pf_begin + p_sys->i_len )
-            pf_read = p_sys->pf_begin;
+        if( pf_read >= p_sys->pf_ringbuf + p_sys->i_len )
+            pf_read = p_sys->pf_ringbuf;
 
         float left  = p_out[0];
         float right = p_out[1];
@@ -160,14 +177,12 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
                         - p_sys->f_feedback * pf_read[1];
         *(p_out++) = p_sys->f_dry_mix * right - p_sys->f_crossfeed * left
                         - p_sys->f_feedback * pf_read[0];
-        p_sys->pf_write[0] = left ;
-        p_sys->pf_write[1] = right;
+        *(p_sys->pf_write++) = left ;
+        *(p_sys->pf_write++) = right;
 
         /* if at end of buffer place pf_write at begin */
-        if( p_sys->pf_write  == p_sys->pf_begin + p_sys->i_len )
-            p_sys->pf_write  =  p_sys->pf_begin;
-        else
-            p_sys->pf_write += 2;
+        if( p_sys->pf_write  == p_sys->pf_ringbuf + p_sys->i_len )
+            p_sys->pf_write  =  p_sys->pf_ringbuf;
     }
 
     return p_block;
@@ -189,8 +204,8 @@ static void Close( vlc_object_t *obj )
     DEL_VAR( "crossfeed" );
     DEL_VAR( "dry-mix" );
     var_Destroy( p_filter, "delay" );
-    if( p_sys->b_free_buf )
-        free( p_sys->pf_begin );
+
+    free( p_sys->pf_ringbuf );
     free( p_sys );
 }
 
@@ -210,16 +225,14 @@ static int paramCallback( vlc_object_t *p_this, char const *psz_var,
 
     if( !strcmp( psz_var, "delay" ) )
     {
-        p_sys->f_delay = newval.f_float;
-        /* Free previous buffer and allocate new circular buffer */
-        free( p_sys->pf_begin );
-        p_sys->i_len = 2 * p_sys->f_delay * p_filter->fmt_in.audio.i_rate /1000;
-        p_sys->pf_begin = calloc( p_sys->i_len + 2, sizeof(float) );
-        if( unlikely(!p_sys->pf_begin) )
+        if( MakeRingBuffer( &p_sys->pf_ringbuf, &p_sys->i_len, &p_sys->pf_write,
+                            newval.f_float, p_filter->fmt_in.audio.i_rate ) != VLC_SUCCESS )
         {
-            p_sys->b_free_buf = false;
             msg_Dbg( p_filter, "Couldnt allocate buffer for delay" );
-            Close( p_this );
+        }
+        else
+        {
+            p_sys->f_delay = newval.f_float;
         }
     }
     else if( !strcmp( psz_var, "feedback" ) )
diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c
index d51368be80..6c4324172e 100644
--- a/modules/audio_output/directsound.c
+++ b/modules/audio_output/directsound.c
@@ -2,7 +2,7 @@
  * directsound.c: DirectSound audio output plugin for VLC
  *****************************************************************************
  * Copyright (C) 2001-2009 VLC authors and VideoLAN
- * $Id: 51788f5b6a4d0da78a8ce4503578b4f60e56344e $
+ * $Id: ed11194cb44a1007981c7c2b7b08a0580ada957f $
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *
@@ -87,7 +87,7 @@ vlc_module_begin ()
         change_string_list( speaker_list, speaker_list )
     add_float( "directx-volume", 1.0f,
                  VOLUME_TEXT, VOLUME_LONGTEXT, true )
-        change_integer_range( DSBVOLUME_MIN, DSBVOLUME_MAX )
+        change_float_range( 0.f, 2.f )
 
     set_callbacks( Open, Close )
 
diff --git a/modules/codec/adpcm.c b/modules/codec/adpcm.c
index 8b7f7f2ebf..0d2e4b4d5b 100644
--- a/modules/codec/adpcm.c
+++ b/modules/codec/adpcm.c
@@ -2,7 +2,7 @@
  * adpcm.c : adpcm variant audio decoder
  *****************************************************************************
  * Copyright (C) 2001, 2002 VLC authors and VideoLAN
- * $Id: 0071077bdc8a6a922fdf1421c9f66e2bbe5068cb $
+ * $Id: 61a5d654e62bd00c8f8bd278734492b45da4c518 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Rémi Denis-Courmont <rem # videolan.org>
@@ -150,14 +150,6 @@ static int OpenDecoder( vlc_object_t *p_this )
             return VLC_EGENERIC;
     }
 
-    if( p_dec->fmt_in.audio.i_channels <= 0 ||
-        p_dec->fmt_in.audio.i_channels > 5 )
-    {
-        msg_Err( p_dec, "invalid number of channel (not between 1 and 5): %i",
-                 p_dec->fmt_in.audio.i_channels );
-        return VLC_EGENERIC;
-    }
-
     if( p_dec->fmt_in.audio.i_rate <= 0 )
     {
         msg_Err( p_dec, "bad samplerate" );
@@ -170,29 +162,30 @@ static int OpenDecoder( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     p_sys->prev = NULL;
+    p_sys->i_samplesperblock = 0;
 
+    uint8_t i_max_channels = 5;
     switch( p_dec->fmt_in.i_codec )
     {
         case VLC_FOURCC('i','m','a', '4'): /* IMA ADPCM */
-            if (p_dec->fmt_in.audio.i_channels > 2) {
-                free(p_sys);
-                msg_Err(p_dec, "Invalid number of channels %i",
-                        p_dec->fmt_in.audio.i_channels );
-                return VLC_EGENERIC;
-            }
             p_sys->codec = ADPCM_IMA_QT;
+            i_max_channels = 2;
             break;
         case VLC_CODEC_ADPCM_IMA_WAV: /* IMA ADPCM */
             p_sys->codec = ADPCM_IMA_WAV;
+            i_max_channels = 2;
             break;
         case VLC_CODEC_ADPCM_MS: /* MS ADPCM */
             p_sys->codec = ADPCM_MS;
+            i_max_channels = 2;
             break;
         case VLC_CODEC_ADPCM_DK4: /* Duck DK4 ADPCM */
             p_sys->codec = ADPCM_DK4;
+            i_max_channels = 2;
             break;
         case VLC_CODEC_ADPCM_DK3: /* Duck DK3 ADPCM */
             p_sys->codec = ADPCM_DK3;
+            i_max_channels = 2;
             break;
         case VLC_FOURCC('X','A','J', 0): /* EA ADPCM */
             p_sys->codec = ADPCM_EA;
@@ -206,6 +199,15 @@ static int OpenDecoder( vlc_object_t *p_this )
             break;
     }
 
+    if (p_dec->fmt_in.audio.i_channels > i_max_channels ||
+        p_dec->fmt_in.audio.i_channels == 0)
+    {
+        free(p_sys->prev);
+        free(p_sys);
+        msg_Err( p_dec, "Invalid number of channels %i", p_dec->fmt_in.audio.i_channels );
+        return VLC_EGENERIC;
+    }
+
     if( p_dec->fmt_in.audio.i_blockalign <= 0 )
     {
         p_sys->i_block = (p_sys->codec == ADPCM_IMA_QT) ?
@@ -224,28 +226,41 @@ static int OpenDecoder( vlc_object_t *p_this )
         p_sys->i_samplesperblock = 64;
         break;
     case ADPCM_IMA_WAV:
-        p_sys->i_samplesperblock =
-            2 * ( p_sys->i_block - 4 * p_dec->fmt_in.audio.i_channels ) /
-            p_dec->fmt_in.audio.i_channels;
+        if( p_sys->i_block >= 4 * p_dec->fmt_in.audio.i_channels )
+        {
+            p_sys->i_samplesperblock =
+                2 * ( p_sys->i_block - 4 * p_dec->fmt_in.audio.i_channels ) /
+                p_dec->fmt_in.audio.i_channels;
+        }
         break;
     case ADPCM_MS:
-        p_sys->i_samplesperblock =
-            2 * (p_sys->i_block - 7 * p_dec->fmt_in.audio.i_channels) /
-            p_dec->fmt_in.audio.i_channels + 2;
+        if( p_sys->i_block >= 7 * p_dec->fmt_in.audio.i_channels )
+        {
+            p_sys->i_samplesperblock =
+                2 * (p_sys->i_block - 7 * p_dec->fmt_in.audio.i_channels) /
+                p_dec->fmt_in.audio.i_channels + 2;
+        }
         break;
     case ADPCM_DK4:
-        p_sys->i_samplesperblock =
-            2 * (p_sys->i_block - 4 * p_dec->fmt_in.audio.i_channels) /
-            p_dec->fmt_in.audio.i_channels + 1;
+        if( p_sys->i_block >= 4 * p_dec->fmt_in.audio.i_channels )
+        {
+            p_sys->i_samplesperblock =
+                2 * (p_sys->i_block - 4 * p_dec->fmt_in.audio.i_channels) /
+                p_dec->fmt_in.audio.i_channels + 1;
+        }
         break;
     case ADPCM_DK3:
         p_dec->fmt_in.audio.i_channels = 2;
-        p_sys->i_samplesperblock = ( 4 * ( p_sys->i_block - 16 ) + 2 )/ 3;
+        if( p_sys->i_block >= 16 )
+            p_sys->i_samplesperblock = ( 4 * ( p_sys->i_block - 16 ) + 2 )/ 3;
         break;
     case ADPCM_EA:
-        p_sys->i_samplesperblock =
-            2 * (p_sys->i_block - p_dec->fmt_in.audio.i_channels) /
-            p_dec->fmt_in.audio.i_channels;
+        if( p_sys->i_block >= p_dec->fmt_in.audio.i_channels )
+        {
+            p_sys->i_samplesperblock =
+                2 * (p_sys->i_block - p_dec->fmt_in.audio.i_channels) /
+                p_dec->fmt_in.audio.i_channels;
+        }
     }
 
     msg_Dbg( p_dec, "format: samplerate:%d Hz channels:%d bits/sample:%d "
@@ -254,6 +269,14 @@ static int OpenDecoder( vlc_object_t *p_this )
              p_dec->fmt_in.audio.i_bitspersample, p_sys->i_block,
              p_sys->i_samplesperblock );
 
+    if (p_sys->i_samplesperblock == 0)
+    {
+        free(p_sys->prev);
+        free(p_sys);
+        msg_Err( p_dec, "Error computing number of samples per block");
+        return VLC_EGENERIC;
+    }
+
     p_dec->p_sys = p_sys;
     p_dec->fmt_out.i_cat = AUDIO_ES;
     p_dec->fmt_out.i_codec = VLC_CODEC_S16N;
@@ -422,10 +445,13 @@ static void DecodeAdpcmMs( decoder_t *p_dec, int16_t *p_sample,
 {
     decoder_sys_t *p_sys  = p_dec->p_sys;
     adpcm_ms_channel_t channel[2];
-    int i_nibbles;
     int b_stereo;
     int i_block_predictor;
 
+    size_t i_total_samples = p_sys->i_samplesperblock;
+    if(i_total_samples < 2)
+        return;
+
     b_stereo = p_dec->fmt_in.audio.i_channels == 2 ? 1 : 0;
 
     GetByte( i_block_predictor );
@@ -471,8 +497,7 @@ static void DecodeAdpcmMs( decoder_t *p_dec, int16_t *p_sample,
         *p_sample++ = channel[0].i_sample1;
     }
 
-    for( i_nibbles = 2 * (p_sys->i_block - 7 * p_dec->fmt_in.audio.i_channels);
-         i_nibbles > 0; i_nibbles -= 2, p_buffer++ )
+    for( i_total_samples -= 2; i_total_samples >= 2; i_total_samples -= 2, p_buffer++ )
     {
         *p_sample++ = AdpcmMsExpandNibble( &channel[0], (*p_buffer) >> 4);
         *p_sample++ = AdpcmMsExpandNibble( &channel[b_stereo ? 1 : 0],
diff --git a/modules/codec/aes3.c b/modules/codec/aes3.c
index 4a72714694..37aa9dde95 100644
--- a/modules/codec/aes3.c
+++ b/modules/codec/aes3.c
@@ -2,7 +2,7 @@
  * aes3.c: aes3 decoder/packetizer module
  *****************************************************************************
  * Copyright (C) 2008 VLC authors and VideoLAN
- * $Id: 61feef47b338feb81864d51f18da6313c13f2d51 $
+ * $Id: 0a39d1a95c47fbebed5b10cd9be36af9bf9aca4b $
  *
  * Authors: Laurent Aimar <fenrir@videolan.org>
  *
@@ -202,7 +202,7 @@ static block_t *Decode( decoder_t *p_dec, block_t **pp_block )
         while( p_block->i_buffer / 5 )
         {
             *(p_out++) =  reverse[p_block->p_buffer[0]]
-                        | reverse[p_block->p_buffer[1]];
+                        |(reverse[p_block->p_buffer[1]] <<  8);
             *(p_out++) = (reverse[p_block->p_buffer[2]] >>  4)
                        | (reverse[p_block->p_buffer[3]] <<  4)
                        | (reverse[p_block->p_buffer[4]] << 12);
diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c
index 5cb9ed9760..e32ddb1d56 100644
--- a/modules/codec/avcodec/fourcc.c
+++ b/modules/codec/avcodec/fourcc.c
@@ -2,7 +2,7 @@
  * fourcc.c: libavcodec <-> libvlc conversion routines
  *****************************************************************************
  * Copyright (C) 1999-2009 VLC authors and VideoLAN
- * $Id: f88a75fec1fd67ec99689528dde5e1d1ffd5a3b3 $
+ * $Id: a3e8adf374b97dc09e3cedbe4236bbc804d8e20e $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index a4b5a6007e..a19e7f6e4e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -2,7 +2,7 @@
  * video.c: video decoder using the libavcodec library
  *****************************************************************************
  * Copyright (C) 1999-2001 VLC authors and VideoLAN
- * $Id: ae600e8d05e37cf8a726f193c2cb43946802fc5c $
+ * $Id: 971238612c9cb5f57edd0fa9d35af48070a250ec $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -681,6 +681,27 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
             continue;
         }
 
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+        if( p_context->pix_fmt == AV_PIX_FMT_PAL8
+         && !p_dec->fmt_out.video.p_palette && p_sys->p_ff_pic->data[1] )
+        {
+            video_palette_t *p_palette;
+            p_palette = p_dec->fmt_out.video.p_palette
+                      = malloc( sizeof(video_palette_t) );
+            if( !p_palette )
+            {
+                if( p_block )
+                    block_Release( p_block );
+                return NULL;
+            }
+            static_assert( sizeof(p_palette->palette) == AVPALETTE_SIZE,
+                           "Palette size mismatch between vlc and libavutil" );
+            memcpy( p_palette->palette, p_sys->p_ff_pic->data[1],
+                    AVPALETTE_SIZE );
+            p_palette->i_entries = AVPALETTE_COUNT;
+        }
+#endif
+
         /* Sanity check (seems to be needed for some streams) */
         if( p_sys->p_ff_pic->pict_type == AV_PICTURE_TYPE_B)
         {
diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c
index 54bbaaae54..f0a7304eb5 100644
--- a/modules/codec/lpcm.c
+++ b/modules/codec/lpcm.c
@@ -2,7 +2,7 @@
  * lpcm.c: lpcm decoder/packetizer module
  *****************************************************************************
  * Copyright (C) 1999-2008 VLC authors and VideoLAN
- * $Id: e040133d96548037b9ddd19f0d3f5221c41f178b $
+ * $Id: d158ad37ebc054010be1827de04b83390d9bb246 $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Henri Fallon <henri@videolan.org>
@@ -434,6 +434,20 @@ static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
         p_block->p_buffer += p_sys->i_header_size + i_padding;
         p_block->i_buffer -= p_sys->i_header_size + i_padding;
 
+        const unsigned block_nb_frames = p_block->i_buffer / ( i_bits * 4 / 8 );
+        const unsigned aout_nb_frames = p_aout_buffer->i_nb_samples
+            / ( p_dec->fmt_out.audio.i_bitspersample / 8 );
+
+        if( block_nb_frames > aout_nb_frames )
+        {
+            msg_Warn( p_dec, "invalid block size" );
+
+            block_Release( p_block );
+            block_Release( p_aout_buffer );
+
+            return NULL;
+        }
+
         switch( p_sys->i_type )
         {
         case LPCM_WIDI:
diff --git a/modules/codec/opus_header.c b/modules/codec/opus_header.c
index 101a33da61..4d16599e89 100644
--- a/modules/codec/opus_header.c
+++ b/modules/codec/opus_header.c
@@ -285,6 +285,9 @@ static int comment_pad(char **comments, size_t *length)
 {
     const unsigned padding = 512; /* default from opus-tools */
 
+    if(SIZE_MAX - *length < padding + 255)
+        return 1;
+
     char *p = *comments;
     /* Make sure there is at least "padding" worth of padding free, and
        round up to the maximum that fits in the current ogg segments. */
diff --git a/modules/codec/scte27.c b/modules/codec/scte27.c
index 6954124ccc..b8a56e3e62 100644
--- a/modules/codec/scte27.c
+++ b/modules/codec/scte27.c
@@ -2,7 +2,7 @@
  * scte27.c : SCTE-27 subtitles decoder
  *****************************************************************************
  * Copyright (C) Laurent Aimar
- * $Id: 527e4e45048217fcb2e2157928c02036ef37d00a $
+ * $Id: edf5d500d7146da872b9f611416786831bc785a9 $
  *
  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *
@@ -76,8 +76,8 @@ static scte27_color_t bs_read_color(bs_t *bs)
     /* XXX it's unclear if a value of 0 in Y/U/V means a transparent pixel */
     color.y     = bs_read(bs, 5) << 3;
     color.alpha = bs_read1(bs) ? 0xff : 0x80;
-    color.u     = bs_read(bs, 5) << 3;
     color.v     = bs_read(bs, 5) << 3;
+    color.u     = bs_read(bs, 5) << 3;
 
     return color;
 }
diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c
index f9b1a4064b..9f6a6ade8d 100644
--- a/modules/demux/aiff.c
+++ b/modules/demux/aiff.c
@@ -2,7 +2,7 @@
  * aiff.c: Audio Interchange File Format demuxer
  *****************************************************************************
  * Copyright (C) 2004-2007 VLC authors and VideoLAN
- * $Id: 8a7dd28b1828ae798395f79e167c7a09a56ef90b $
+ * $Id: 5d8e18fd802554179802eb22a813678f5cfd85c6 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -32,6 +32,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_demux.h>
+#include <limits.h>
 
 /* TODO:
  *  - ...
@@ -123,14 +124,14 @@ static int Open( vlc_object_t *p_this )
 
     for( ;; )
     {
-        uint32_t i_size;
-
         if( stream_Peek( p_demux->s, &p_peek, 8 ) < 8 )
             goto error;
 
-        i_size = GetDWBE( &p_peek[4] );
+        uint32_t i_data_size = GetDWBE( &p_peek[4] );
+        uint64_t i_chunk_size = UINT64_C( 8 ) + i_data_size + ( i_data_size & 1 );
 
-        msg_Dbg( p_demux, "chunk fcc=%4.4s size=%d", p_peek, i_size );
+        msg_Dbg( p_demux, "chunk fcc=%4.4s size=%" PRIu64 " data_size=%" PRIu32,
+            p_peek, i_chunk_size, i_data_size );
 
         if( !memcmp( p_peek, "COMM", 4 ) )
         {
@@ -152,7 +153,7 @@ static int Open( vlc_object_t *p_this )
                 goto error;
 
             p_sys->i_ssnd_pos = stream_Tell( p_demux->s );
-            p_sys->i_ssnd_size = i_size;
+            p_sys->i_ssnd_size = i_data_size;
             p_sys->i_ssnd_offset = GetDWBE( &p_peek[8] );
             p_sys->i_ssnd_blocksize = GetDWBE( &p_peek[12] );
 
@@ -165,14 +166,19 @@ static int Open( vlc_object_t *p_this )
             break;
         }
 
-        /* Skip this chunk */
-        i_size += 8;
-        if( (i_size % 2) != 0 )
-            i_size++;
-        if( stream_Read( p_demux->s, NULL, i_size ) != (int)i_size )
+        /* consume chunk data */
+        for( ssize_t i_req; i_chunk_size; i_chunk_size -= i_req )
         {
-            msg_Warn( p_demux, "incomplete file" );
-            goto error;
+#if SSIZE_MAX < UINT64_MAX
+            i_req = __MIN( SSIZE_MAX, i_chunk_size );
+#else
+            i_req = i_chunk_size;
+#endif
+            if( stream_Read( p_demux->s, NULL, i_req ) != i_req )
+            {
+                msg_Warn( p_demux, "incomplete file" );
+                goto error;
+            }
         }
     }
 
diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index 7171549d2d..b6f3e48ea4 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -162,6 +162,9 @@ static int ASF_NextObject( stream_t *s, asf_object_t *p_obj, uint64_t i_boundary
     if( p_obj->common.i_object_size <= 0 )
         return VLC_EGENERIC;
 
+    if( ( UINT64_MAX - p_obj->common.i_object_pos ) < p_obj->common.i_object_size )
+        return VLC_EGENERIC;
+
     if( p_obj->common.p_father &&
         p_obj->common.p_father->common.i_object_size != 0 )
     {
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index efb78cd5d4..0de554bf13 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -2,7 +2,7 @@
  * avi.c : AVI file Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2009 VLC authors and VideoLAN
- * $Id: 3a3170214d309b96374893222a3f21a190462d89 $
+ * $Id: d60d7b693a3da7c77b3875ad9a30071146d211c1 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -464,7 +464,7 @@ static int Open( vlc_object_t * p_this )
                 {
                     int i_chunk = AVIFOURCC_IAS1 + ((i - 1) << 24);
                     avi_chunk_STRING_t *p_lang = AVI_ChunkFind( p_info, i_chunk, 0 );
-                    if( p_lang != NULL )
+                    if( p_lang != NULL && p_lang->p_str != NULL )
                         fmt.psz_language = FromACP( p_lang->p_str );
                 }
 
@@ -669,7 +669,7 @@ static int Open( vlc_object_t * p_this )
                 free( tk );
                 continue;
         }
-        if( p_strn )
+        if( p_strn && p_strn->p_str )
             fmt.psz_description = FromACP( p_strn->p_str );
         tk->p_es = es_out_Add( p_demux->out, &fmt );
         TAB_APPEND( p_sys->i_track, p_sys->track, tk );
@@ -2699,7 +2699,7 @@ static void AVI_MetaLoad( demux_t *p_demux,
     for( int i = 0; p_dsc[i].i_id != 0; i++ )
     {
         avi_chunk_STRING_t *p_strz = AVI_ChunkFind( p_info, p_dsc[i].i_id, 0 );
-        if( !p_strz )
+        if( !p_strz || !p_strz->p_str )
             continue;
         char *psz_value = FromACP( p_strz->p_str );
         if( !psz_value )
@@ -2723,7 +2723,7 @@ static void AVI_MetaLoad( demux_t *p_demux,
     for( int i = 0; p_extra[i] != 0; i++ )
     {
         avi_chunk_STRING_t *p_strz = AVI_ChunkFind( p_info, p_extra[i], 0 );
-        if( !p_strz )
+        if( !p_strz || !p_strz->p_str )
             continue;
         char *psz_value = FromACP( p_strz->p_str );
         if( !psz_value )
@@ -2871,7 +2871,7 @@ static void AVI_ExtractSubtitle( demux_t *p_demux,
     i_size -= 6;
 
     if( !psz_description )
-        psz_description = p_strn ? FromACP( p_strn->p_str ) : NULL;
+        psz_description = p_strn && p_strn->p_str ? FromACP( p_strn->p_str ) : NULL;
     char *psz_name;
     if( asprintf( &psz_name, "subtitle%d.srt", p_sys->i_attachment ) <= 0 )
         psz_name = NULL;
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index d05abe64f0..7f992bacae 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -105,6 +105,8 @@ int MP4_ReadBoxCommon( stream_t *p_stream, MP4_Box_t *p_box )
 
     if( p_box->i_shortsize == 1 )
     {
+        if( i_read < 8 )
+            return 0;
         /* get the true size on 64 bits */
         MP4_GET8BYTES( p_box->i_size );
     }
@@ -114,8 +116,13 @@ int MP4_ReadBoxCommon( stream_t *p_stream, MP4_Box_t *p_box )
         /* XXX size of 0 means that the box extends to end of file */
     }
 
-    if( p_box->i_type == ATOM_uuid && i_read >= 16 )
+    if( UINT64_MAX - p_box->i_size < p_box->i_pos )
+        return 0;
+
+    if( p_box->i_type == ATOM_uuid )
     {
+        if( i_read < 16 )
+            return 0;
         /* get extented type on 16 bytes */
         GetUUID( &p_box->i_uuid, p_peek );
     }
@@ -164,8 +171,8 @@ static int MP4_NextBox( stream_t *p_stream, MP4_Box_t *p_box )
          * and we skip the followong check */
         if( p_box->p_father->i_size > 0 )
         {
-            const off_t i_box_end = p_box->i_size + p_box->i_pos;
-            const off_t i_father_end = p_box->p_father->i_size + p_box->p_father->i_pos;
+            const uint64_t i_box_end = p_box->i_size + p_box->i_pos;
+            const uint64_t i_father_end = p_box->p_father->i_size + p_box->p_father->i_pos;
 
             /* check if it's within p-father */
             if( i_box_end >= i_father_end )
@@ -197,9 +204,12 @@ int MP4_ReadBoxContainerChildren( stream_t *p_stream,
 
     /* Size of root container is set to 0 when unknown, for exemple
      * with a DASH stream. In that case, we skip the following check */
-    if( p_container->i_size
-            && ( stream_Tell( p_stream ) + 8 >
-        (off_t)(p_container->i_pos + p_container->i_size) )
+    int64_t i_tell = stream_Tell( p_stream );
+    if( unlikely(i_tell < 0 || (UINT64_MAX - 8 < (uint64_t)i_tell)) )
+        return 0;
+
+    if( p_container->i_size && ( (uint64_t)i_tell + 8 >
+        p_container->i_pos + p_container->i_size )
       )
     {
         /* there is no box to load */
@@ -1230,20 +1240,21 @@ static int MP4_ReadBox_esds( stream_t *p_stream, MP4_Box_t *p_box )
         {
             MP4_GET2BYTES( es_descriptor.i_depend_on_ES_ID );
         }
-        if( es_descriptor.b_url )
+        if( es_descriptor.b_url && i_read > 0 )
         {
-            unsigned int i_len;
+            uint8_t i_url;
 
-            MP4_GET1BYTE( i_len );
-            i_len = __MIN(i_read, i_len);
-            es_descriptor.psz_URL = malloc( i_len + 1 );
+            MP4_GET1BYTE( i_url );
+            if( i_url > i_read )
+                MP4_READBOX_EXIT( 1 );
+            es_descriptor.psz_URL = malloc( (unsigned) i_url + 1 );
             if( es_descriptor.psz_URL )
             {
-                memcpy( es_descriptor.psz_URL, p_peek, i_len );
-                es_descriptor.psz_URL[i_len] = 0;
+                memcpy( es_descriptor.psz_URL, p_peek, i_url );
+                es_descriptor.psz_URL[i_url] = 0;
             }
-            p_peek += i_len;
-            i_read -= i_len;
+            p_peek += i_url;
+            i_read -= i_url;
         }
         else
         {
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 7eb8939acf..3312257a46 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -1283,7 +1283,7 @@ typedef union MP4_Box_data_s
 /* the most basic structure */
 typedef struct MP4_Box_s
 {
-    off_t        i_pos;      /* absolute position */
+    uint64_t     i_pos;  /* absolute position */
 
     uint32_t     i_type;
     uint32_t     i_shortsize;
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 944d39bdbb..e9d0023969 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -277,6 +277,7 @@ static inline int64_t MP4_TrackGetPTSDelta( demux_t *p_demux, mp4_track_t *p_tra
 
         i_sample -= ck->p_sample_count_pts[i_index];
     }
+    return -1;
 }
 
 static inline int64_t MP4_GetMoviePTS(demux_sys_t *p_sys )
@@ -874,6 +875,8 @@ static int Demux( demux_t *p_demux )
         }
     }
 
+    uint32_t i_nb_samples = 0;
+    uint32_t i_samplessize = 0;
     if ( !tk )
     {
         msg_Dbg( p_demux, "Could not select track by data position" );
@@ -896,8 +899,7 @@ static int Demux( demux_t *p_demux )
              MP4_GetMoviePTS( p_sys ), i_candidate_pos );
 #endif
 
-    uint32_t i_nb_samples = 0;
-    uint32_t i_samplessize = MP4_TrackGetReadSize( tk, &i_nb_samples );
+    i_samplessize = MP4_TrackGetReadSize( tk, &i_nb_samples );
     if( i_samplessize > 0 )
     {
         block_t *p_block;
@@ -4395,7 +4397,7 @@ static MP4_Box_t * LoadNextChunk( demux_t *p_demux )
     return p_chunk;
 }
 
-static bool BoxExistsInRootTree( MP4_Box_t *p_root, uint32_t i_type, off_t i_pos )
+static bool BoxExistsInRootTree( MP4_Box_t *p_root, uint32_t i_type, uint64_t i_pos )
 {
     while ( p_root )
     {
@@ -4428,6 +4430,12 @@ static bool AddFragment( demux_t *p_demux, MP4_Box_t *p_moox )
                 p_sys->i_timescale = BOXDATA(p_mvhd)->i_timescale;
                 p_sys->i_overall_duration = BOXDATA(p_mvhd)->i_duration;
             }
+            else
+            {
+                p_sys->i_timescale = CLOCK_FREQ;
+                p_sys->i_overall_duration = CLOCK_FREQ;
+                msg_Warn( p_demux, "No valid mvhd found" );
+            }
 
             if ( MP4_BoxCount( p_moox, "mvex" ) || !p_mvhd )
             { /* duration might be wrong an be set to whole duration :/ */
@@ -5427,7 +5435,8 @@ static int DemuxAsLeaf( demux_t *p_demux )
 
         if ( p_sys->context.i_current_box_type != ATOM_mdat )
         {
-            if ( ! BoxExistsInRootTree( p_sys->p_root, p_sys->context.i_current_box_type, stream_Tell( p_demux->s ) ) )
+            const int64_t i_tell = stream_Tell( p_demux->s );
+            if ( i_tell >= 0 && ! BoxExistsInRootTree( p_sys->p_root, p_sys->context.i_current_box_type, (uint64_t) i_tell ) )
             {// only if !b_probed ??
                 MP4_Box_t *p_vroot = LoadNextChunk( p_demux );
                 switch( p_sys->context.i_current_box_type )
diff --git a/modules/demux/nsv.c b/modules/demux/nsv.c
index 9beb2ce42c..8f87e7b414 100644
--- a/modules/demux/nsv.c
+++ b/modules/demux/nsv.c
@@ -2,7 +2,7 @@
  * nsv.c: NullSoft Video demuxer.
  *****************************************************************************
  * Copyright (C) 2004-2007 VLC authors and VideoLAN
- * $Id: 049b06819ede996e1f8789525f40d685b2a807ab $
+ * $Id: 140f14ea5f88a73d1ca86a812ebfe532a2e27137 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -445,7 +445,6 @@ static int ReadNSVf( demux_t *p_demux )
 {
     /* demux_sys_t *p_sys = p_demux->p_sys; */
     const uint8_t     *p;
-    int         i_size;
 
     msg_Dbg( p_demux, "new NSVf chunk" );
     if( stream_Peek( p_demux->s, &p, 8 ) < 8 )
@@ -453,10 +452,14 @@ static int ReadNSVf( demux_t *p_demux )
         return VLC_EGENERIC;
     }
 
-    i_size = GetDWLE( &p[4] );
-    msg_Dbg( p_demux, "    - size=%d", i_size );
+    uint32_t i_header_size = GetDWLE( &p[4] );
+    msg_Dbg( p_demux, "    - size=%" PRIu32, i_header_size );
+
+    if( i_header_size == 0 || i_header_size == UINT32_MAX )
+        return VLC_EGENERIC;
+
 
-    return stream_Read( p_demux->s, NULL, i_size ) == i_size ? VLC_SUCCESS : VLC_EGENERIC;
+    return stream_Read( p_demux->s, NULL, i_header_size ) == i_header_size ? VLC_SUCCESS : VLC_EGENERIC;
 }
 /*****************************************************************************
  * ReadNSVs:
diff --git a/modules/demux/smf.c b/modules/demux/smf.c
index dc42ae99ba..9ddf4d6b26 100644
--- a/modules/demux/smf.c
+++ b/modules/demux/smf.c
@@ -2,7 +2,7 @@
  * smf.c : Standard MIDI File (.mid) demux module for vlc
  *****************************************************************************
  * Copyright © 2007 Rémi Denis-Courmont
- * $Id: 02fdfdd077dc254e0a667c9aba1b745d86e92330 $
+ * $Id: 32ca805d91730b277969962613be4c8a64a2a079 $
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published by
@@ -336,6 +336,7 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr, es_out_t *out)
         if (datalen == 0)
         {
             msg_Err (p_demux, "malformatted MIDI event");
+            block_Release(block);
             return -1; /* implicit running status requires non-empty payload */
         }
 
@@ -612,6 +613,11 @@ static int Open (vlc_object_t *obj)
     }
     else
     {
+        if (ppqn == 0)
+        {
+            msg_Err(demux, "invalid SMF file PPQN: %u", ppqn);
+            return VLC_EGENERIC;
+        }
         msg_Dbg (demux, " %u pulses per quarter note", ppqn);
     }
 
diff --git a/modules/demux/voc.c b/modules/demux/voc.c
index 2eb8afe53f..9f3d944a09 100644
--- a/modules/demux/voc.c
+++ b/modules/demux/voc.c
@@ -2,7 +2,7 @@
  * voc.c : Creative Voice File (.VOC) demux module for vlc
  *****************************************************************************
  * Copyright (C) 2005 Rémi Denis-Courmont
- * $Id: af4f1633daa07e418d6818d19fb78dce833dba04 $
+ * $Id: 87b1059002ac7b140c2dc3d868401aa72e711f15 $
  *
  * Authors: Rémi Denis-Courmont <rem # videolan.org>
  *
@@ -270,6 +270,8 @@ static int ReadBlockHeader( demux_t *p_demux )
             }
 
             new_fmt.i_codec = VLC_CODEC_U8;
+            if (buf[3] >= 32)
+                goto corrupt;
             new_fmt.audio.i_channels = buf[3] + 1; /* can't be nul */
             new_fmt.audio.i_rate = 256000000L /
                           ((65536L - GetWLE(buf)) * new_fmt.audio.i_channels);
diff --git a/modules/demux/xa.c b/modules/demux/xa.c
index ec2f94a425..e7383733cd 100644
--- a/modules/demux/xa.c
+++ b/modules/demux/xa.c
@@ -2,7 +2,7 @@
  * xa.c : xa file demux module for vlc
  *****************************************************************************
  * Copyright (C) 2005 Rémi Denis-Courmont
- * $Id: b11ed79cda999cc494e7b69b6ea183ecb59927dc $
+ * $Id: 850352543c303d5a2e547d953394294c64201e5a $
  *
  * Authors: Rémi Denis-Courmont <rem # videolan.org>
  *
@@ -142,6 +142,12 @@ static int Open( vlc_object_t * p_this )
              (char *)&fmt.i_codec, fmt.audio.i_channels, fmt.audio.i_rate,
              fmt.i_bitrate / 8192, fmt.audio.i_blockalign );
 
+    if( fmt.audio.i_rate == 0 || fmt.audio.i_channels == 0 )
+    {
+        free( p_sys );
+        return VLC_EGENERIC;
+    }
+
     p_sys->p_es = es_out_Add( p_demux->out, &fmt );
 
     date_Init( &p_sys->pts, fmt.audio.i_rate, 1 );
diff --git a/modules/demux/xiph_metadata.c b/modules/demux/xiph_metadata.c
index ec59eeb792..4566d0c30a 100644
--- a/modules/demux/xiph_metadata.c
+++ b/modules/demux/xiph_metadata.c
@@ -2,7 +2,7 @@
  * xiph_metadata.h: Vorbis Comment parser
  *****************************************************************************
  * Copyright © 2008-2013 VLC authors and VideoLAN
- * $Id: e4ef7674c2c9c781866a60aaddb15707f892dcd8 $
+ * $Id: 4175c564d169a0c882e7b9dad1fadca3f7ec9f13 $
  *
  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -26,13 +26,15 @@
 # include "config.h"
 #endif
 
+#include <assert.h>
+
 #include <vlc_common.h>
 #include <vlc_charset.h>
 #include <vlc_strings.h>
 #include <vlc_input.h>
 #include "xiph_metadata.h"
 
-input_attachment_t* ParseFlacPicture( const uint8_t *p_data, int i_data,
+input_attachment_t* ParseFlacPicture( const uint8_t *p_data, size_t size,
     int i_attachments, int *i_cover_score, int *i_cover_idx )
 {
     /* TODO: Merge with ID3v2 copy in modules/meta_engine/taglib.cpp. */
@@ -60,58 +62,100 @@ input_attachment_t* ParseFlacPicture( const uint8_t *p_data, int i_data,
         2   /* Logo of the publisher (record company). */
     };
 
-    int i_len;
-    int i_type;
-    char *psz_mime = NULL;
-    char psz_name[128];
-    char *psz_description = NULL;
-    input_attachment_t *p_attachment = NULL;
+    uint32_t type, len;
+
+    if( size < 8 )
+        return NULL;
+#define RM(x) \
+    do { \
+        assert(size >= (x)); \
+        size -= (x); \
+        p_data += (x); \
+    } while (0)
+
+    type = GetDWBE( p_data );
+    RM(4);
+    len = GetDWBE( p_data );
+    RM(4);
+
+    if( size < len )
+        return NULL;
 
-    if( i_data < 4 + 3*4 )
+    char *mime = strndup( (const char *)p_data, len );
+    if( unlikely(mime == NULL) )
         return NULL;
-#define RM(x) do { i_data -= (x); p_data += (x); } while(0)
+    RM(len);
 
-    i_type = GetDWBE( p_data ); RM(4);
-    i_len = GetDWBE( p_data ); RM(4);
+    if( size < 4 )
+    {
+        free( mime );
+        return NULL;
+    }
+
+    len = GetDWBE( p_data );
+    RM(4);
+
+    if( size < len )
+    {
+        free( mime );
+        return NULL;
+    }
 
-    if( i_len < 0 || i_data < i_len + 4 )
+    input_attachment_t *p_attachment = NULL;
+    char *description = strndup( (const char *)p_data, len );
+    if( unlikely(description == NULL) )
         goto error;
-    psz_mime = strndup( (const char*)p_data, i_len ); RM(i_len);
-    i_len = GetDWBE( p_data ); RM(4);
-    if( i_len < 0 || i_data < i_len + 4*4 + 4)
+    RM(len);
+
+    EnsureUTF8( description );
+
+    if( size < 20 )
         goto error;
-    psz_description = strndup( (const char*)p_data, i_len ); RM(i_len);
-    EnsureUTF8( psz_description );
-    RM(4*4);
-    i_len = GetDWBE( p_data ); RM(4);
-    if( i_len < 0 || i_len > i_data )
+
+    RM(4 * 4); /* skip */
+
+    len = GetDWBE( p_data );
+    RM(4);
+
+    if( size < len )
         goto error;
 
-    /* printf( "Picture type=%d mime=%s description='%s' file length=%d\n",
-             i_type, psz_mime, psz_description, i_len ); */
+    /* printf( "Picture type=%"PRIu32" mime=%s description='%s' "
+               "file length=%zu\n", type, mime, description, len ); */
+
+    char name[7 + (sizeof (i_attachments) * 3) + 4 + 1];
 
-    snprintf( psz_name, sizeof(psz_name), "picture%d", i_attachments );
-    if( !strcasecmp( psz_mime, "image/jpeg" ) )
-        strcat( psz_name, ".jpg" );
-    else if( !strcasecmp( psz_mime, "image/png" ) )
-        strcat( psz_name, ".png" );
+    snprintf( name, sizeof (name), "picture%u", i_attachments );
 
-    p_attachment = vlc_input_attachment_New( psz_name, psz_mime,
-            psz_description, p_data, i_data );
+    if( !strcasecmp( mime, "image/jpeg" ) )
+        strcat( name, ".jpg" );
+    else if( !strcasecmp( mime, "image/png" ) )
+        strcat( name, ".png" );
 
-    if( i_type >= 0 && (unsigned int)i_type < sizeof(pi_cover_score)/sizeof(pi_cover_score[0]) &&
-        *i_cover_score < pi_cover_score[i_type] )
+    p_attachment = vlc_input_attachment_New( name, mime, description, p_data,
+                                             size /* XXX: len instead? */ );
+
+    if( type < sizeof(pi_cover_score)/sizeof(pi_cover_score[0]) &&
+        *i_cover_score < pi_cover_score[type] )
     {
         *i_cover_idx = i_attachments;
-        *i_cover_score = pi_cover_score[i_type];
+        *i_cover_score = pi_cover_score[type];
     }
 
 error:
-    free( psz_mime );
-    free( psz_description );
+    free( mime );
+    free( description );
     return p_attachment;
 }
 
+#undef RM
+#define RM(x) \
+    do { \
+        i_data -= (x); \
+        p_data += (x); \
+    } while (0)
+
+
 typedef struct chapters_array_t
 {
     unsigned int i_size;
@@ -146,44 +190,37 @@ static seekpoint_t * getChapterEntry( unsigned int i_index, chapters_array_t *p_
 }
 
 void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
-        const uint8_t *p_data, int i_data,
+        const uint8_t *p_data, size_t i_data,
         int *i_attachments, input_attachment_t ***attachments,
         int *i_cover_score, int *i_cover_idx,
         int *i_seekpoint, seekpoint_t ***ppp_seekpoint,
         float (* ppf_replay_gain)[AUDIO_REPLAY_GAIN_MAX],
         float (* ppf_replay_peak)[AUDIO_REPLAY_GAIN_MAX] )
 {
-    int n;
-    int i_comment;
-
     if( i_data < 8 )
         return;
 
-    n = GetDWLE(p_data); RM(4);
-    if( n < 0 || n > i_data )
-        return;
-#if 0
-    if( n > 0 )
-    {
-        /* TODO report vendor string ? */
-        char *psz_vendor = psz_vendor = strndup( p_data, n );
-        free( psz_vendor );
-    }
-#endif
-    RM(n);
+    uint32_t vendor_length = GetDWLE(p_data); RM(4);
+
+    if( vendor_length > i_data )
+        return; /* invalid length */
+
+    RM(vendor_length); /* TODO: handle vendor payload */
 
     if( i_data < 4 )
         return;
 
-    i_comment = GetDWLE(p_data); RM(4);
-    if( i_comment <= 0 )
-        return;
+    uint32_t i_comment = GetDWLE(p_data); RM(4);
+
+    if( i_comment > i_data || i_comment == 0 )
+        return; /* invalid length */
 
     /* */
     vlc_meta_t *p_meta = *pp_meta;
     if( !p_meta )
         *pp_meta = p_meta = vlc_meta_New();
-    if( !p_meta )
+
+    if( unlikely( !p_meta ) )
         return;
 
     /* */
@@ -203,19 +240,23 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
 
     chapters_array_t chapters_array = { 0, NULL };
 
-    for( ; i_comment > 0; i_comment-- )
+    for( ; i_comment > 0 && i_data >= 4; i_comment-- )
     {
-        char *psz_comment;
-        if( i_data < 4 )
-            break;
-        n = GetDWLE(p_data); RM(4);
-        if( n > i_data )
+        uint32_t comment_size = GetDWLE(p_data); RM(4);
+
+        if( comment_size > i_data )
             break;
-        if( n <= 0 )
+
+        if( comment_size == 0 )
             continue;
 
-        psz_comment = strndup( (const char*)p_data, n );
-        RM(n);
+        char* psz_comment = malloc( comment_size + 1 );
+
+        if( unlikely( !psz_comment ) )
+            goto next_comment;
+
+        memcpy( psz_comment, p_data, comment_size );
+        psz_comment[comment_size] = '\0';
 
         EnsureUTF8( psz_comment );
 
@@ -290,7 +331,7 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
         else if( !strncasecmp( psz_comment, "METADATA_BLOCK_PICTURE=", strlen("METADATA_BLOCK_PICTURE=")))
         {
             if( attachments == NULL )
-                continue;
+                goto next_comment;
 
             uint8_t *p_picture;
             size_t i_size = vlc_b64_decode_binary( &p_picture, &psz_comment[strlen("METADATA_BLOCK_PICTURE=")]);
@@ -306,8 +347,9 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
         else if ( ppf_replay_gain && ppf_replay_peak && !strncmp(psz_comment, "REPLAYGAIN_", 11) )
         {
             char *p = strchr( psz_comment, '=' );
+            if (!p) goto next_comment;
+
             char *psz_val;
-            if (!p) continue;
             if ( !strncasecmp(psz_comment, "REPLAYGAIN_TRACK_GAIN=", 22) )
             {
                 psz_val = malloc( strlen(p+1) + 1 );
@@ -351,7 +393,7 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
             {
                 char *p = strchr( psz_comment, '=' );
                 p_seekpoint = getChapterEntry( i_chapt, &chapters_array );
-                if ( !p || ! p_seekpoint ) continue;
+                if ( !p || ! p_seekpoint ) goto next_comment;
                 if ( ! p_seekpoint->psz_name )
                     p_seekpoint->psz_name = strdup( ++p );
             }
@@ -362,7 +404,7 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
                 if( p && sscanf( ++p, "%u:%u:%u.%u", &h, &m, &s, &ms ) == 4 )
                 {
                     p_seekpoint = getChapterEntry( i_chapt, &chapters_array );
-                    if ( ! p_seekpoint ) continue;
+                    if ( ! p_seekpoint ) goto next_comment;
                     p_seekpoint->i_time_offset =
                       (((int64_t)h * 3600 + (int64_t)m * 60 + (int64_t)s) * 1000 + ms) * 1000;
                 }
@@ -382,16 +424,22 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
             vlc_meta_AddExtra( p_meta, psz_comment, p );
         }
 #undef IF_EXTRACT
+next_comment:
         free( psz_comment );
+        RM( comment_size );
     }
 #undef RM
 
-    for ( unsigned int i=0; i<chapters_array.i_size; i++ )
+    if( i_seekpoint && ppp_seekpoint )
     {
-        if ( !chapters_array.pp_chapters[i] ) continue;
-        TAB_APPEND_CAST( (seekpoint_t**), *i_seekpoint, *ppp_seekpoint,
-                         chapters_array.pp_chapters[i] );
+        for ( unsigned int i=0; i<chapters_array.i_size; i++ )
+        {
+            if ( !chapters_array.pp_chapters[i] ) continue;
+            TAB_APPEND_CAST( (seekpoint_t**), *i_seekpoint, *ppp_seekpoint,
+                chapters_array.pp_chapters[i] );
+        }
     }
+
     free( chapters_array.pp_chapters );
 }
 
diff --git a/modules/demux/xiph_metadata.h b/modules/demux/xiph_metadata.h
index d96e7e0649..55c399b5e2 100644
--- a/modules/demux/xiph_metadata.h
+++ b/modules/demux/xiph_metadata.h
@@ -2,7 +2,7 @@
  * xiph_metadata.h: Vorbis Comment parser
  *****************************************************************************
  * Copyright © 2008-2013 VLC authors and VideoLAN
- * $Id: 7a152b12f1927f2abd1ca9df5e9a113270f1435b $
+ * $Id: f465243b3eb101e633927be0e42bf5e53dadfcb1 $
  *
  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -29,11 +29,11 @@
 extern "C" {
 # endif
 
-input_attachment_t* ParseFlacPicture( const uint8_t *p_data, int i_data,
+input_attachment_t* ParseFlacPicture( const uint8_t *p_data, size_t i_data,
     int i_attachments, int *i_cover_score, int *i_cover_idx );
 
 void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
-        const uint8_t *p_data, int i_data,
+        const uint8_t *p_data, size_t i_data,
         int *i_attachments, input_attachment_t ***attachments,
         int *i_cover_score, int *i_cover_idx,
         int *i_seekpoint, seekpoint_t ***ppp_seekpoint,
diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
index 5e1b9628d3..a88c972da2 100644
--- a/modules/gui/qt4/actions_manager.cpp
+++ b/modules/gui/qt4/actions_manager.cpp
@@ -2,7 +2,7 @@
  * actions_manager.cpp : Controller for the main interface
  ****************************************************************************
  * Copyright © 2009-2014 VideoLAN and VLC authors
- * $Id: eff40d9039f79c4e89f0ca75c665d5d0018880f1 $
+ * $Id: b7ca9673447036201cd26e85eb1144b756de5ca0 $
  *
  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
  *
@@ -25,6 +25,8 @@
 # include "config.h"
 #endif
 
+#include "qt4.hpp"
+
 #include <vlc_vout.h>
 #include <vlc_keys.h>
 
diff --git a/modules/gui/qt4/adapters/seekpoints.cpp b/modules/gui/qt4/adapters/seekpoints.cpp
index fbf2957ac3..a3564bb776 100644
--- a/modules/gui/qt4/adapters/seekpoints.cpp
+++ b/modules/gui/qt4/adapters/seekpoints.cpp
@@ -19,14 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#include "seekpoints.hpp"
 
 #include "recents.hpp"
 #include "dialogs_provider.hpp"
 #include "menus.hpp"
 
-#include "seekpoints.hpp"
-
-#include "qt4.hpp"
 #include "input_manager.hpp"
 
 SeekPoints::SeekPoints( QObject *parent, intf_thread_t *p_intf_ ) :
diff --git a/modules/gui/qt4/adapters/seekpoints.hpp b/modules/gui/qt4/adapters/seekpoints.hpp
index 008398990a..bbb921487a 100644
--- a/modules/gui/qt4/adapters/seekpoints.hpp
+++ b/modules/gui/qt4/adapters/seekpoints.hpp
@@ -22,9 +22,7 @@
 #ifndef SEEKPOINTS_HPP
 #define SEEKPOINTS_HPP
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "qt4.hpp"
 
 #include <vlc_common.h>
 #include <vlc_interface.h>
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 9c42c2bde1..3143f75e91 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -2,7 +2,7 @@
  * controller.cpp : Controller for the main interface
  ****************************************************************************
  * Copyright (C) 2006-2009 the VideoLAN team
- * $Id: d93e0dbfd17162d7c0f3869a3c2517467fd7baed $
+ * $Id: 59f348a41ff5743857ed3ea9b73f2bcb35fe6509 $
  *
  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
  *          Ilkka Ollakka <ileoo@videolan.org>
@@ -26,6 +26,8 @@
 # include "config.h"
 #endif
 
+#include "qt4.hpp"
+
 #include <vlc_vout.h>                       /* vout_thread_t for FSC */
 
 /* Widgets */
@@ -818,6 +820,8 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWi
     screenRes = getSettings()->value( "FullScreen/screen" ).toRect();
     isWideFSC = getSettings()->value( "FullScreen/wide" ).toBool();
     i_screennumber = var_InheritInteger( p_intf, "qt-fullscreen-screennumber" );
+
+    CONNECT( this, fullscreenChanged( bool ), THEMIM, changeFullscreen( bool ) );
 }
 
 FullscreenControllerWidget::~FullscreenControllerWidget()
@@ -1089,7 +1093,7 @@ void FullscreenControllerWidget::keyPressEvent( QKeyEvent *event )
 }
 
 /* */
-static int FullscreenControllerWidgetFullscreenChanged( vlc_object_t *vlc_object,
+int FullscreenControllerWidget::FullscreenChanged( vlc_object_t *vlc_object,
                 const char *variable, vlc_value_t old_val,
                 vlc_value_t new_val,  void *data )
 {
@@ -1101,6 +1105,7 @@ static int FullscreenControllerWidgetFullscreenChanged( vlc_object_t *vlc_object
     FullscreenControllerWidget *p_fs = (FullscreenControllerWidget *)data;
 
     p_fs->fullscreenChanged( p_vout, new_val.b_bool, var_GetInteger( p_vout, "mouse-hide-timeout" ) );
+    p_fs->emit fullscreenChanged( new_val.b_bool );
 
     return VLC_SUCCESS;
 }
@@ -1146,7 +1151,7 @@ void FullscreenControllerWidget::setVoutList( vout_thread_t **pp_vout, int i_vou
     foreach( vout_thread_t *p_vout, del )
     {
         var_DelCallback( p_vout, "fullscreen",
-                         FullscreenControllerWidgetFullscreenChanged, this );
+                         FullscreenControllerWidget::FullscreenChanged, this );
         vlc_mutex_lock( &lock );
         fullscreenChanged( p_vout, false, 0 );
         vout.removeAll( p_vout );
@@ -1171,10 +1176,9 @@ void FullscreenControllerWidget::setVoutList( vout_thread_t **pp_vout, int i_vou
         vlc_mutex_lock( &lock );
         vout.append( p_vout );
         var_AddCallback( p_vout, "fullscreen",
-                         FullscreenControllerWidgetFullscreenChanged, this );
-	CONNECT( this, fullscreenChanged( bool ), THEMIM, changeFullscreen( bool ) );
+                         FullscreenControllerWidget::FullscreenChanged, this );
         /* I miss a add and fire */
-        fullscreenChanged( p_vout, var_GetBool( p_vout, "fullscreen" ),
+        fullscreenChanged( p_vout, var_GetBool( THEPL, "fullscreen" ),
                            var_GetInteger( p_vout, "mouse-hide-timeout" ) );
         vlc_mutex_unlock( &lock );
     }
@@ -1210,7 +1214,6 @@ void FullscreenControllerWidget::fullscreenChanged( vout_thread_t *p_vout,
         IMEvent *eHide = new IMEvent( IMEvent::FullscreenControlHide, 0 );
         QApplication::postEvent( this, eHide );
     }
-    emit fullscreenChanged( b_fullscreen );
     vlc_mutex_unlock( &lock );
 }
 
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index e3c348bb78..8e09ff21a6 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -2,7 +2,7 @@
  * controller.hpp : Controller for the main interface
  ****************************************************************************
  * Copyright (C) 2006-2008 the VideoLAN team
- * $Id: 2a65e19bfd34e3f6fdf82c518c064b5717c1de4f $
+ * $Id: 20865a23964b6834409c0f5138f2c7d9408a2541 $
  *
  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
  *
@@ -266,6 +266,10 @@ public:
     void updateFullwidthGeometry( int number );
     int targetScreen();
 
+private:
+    static int FullscreenChanged( vlc_object_t *obj,
+                    const char *, vlc_value_t, vlc_value_t new_val, void *data );
+
 signals:
     void keyPressed( QKeyEvent * );
     void fullscreenChanged( bool );
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index 661c011e9d..dc748cedc5 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -2,7 +2,7 @@
  * playlist_model.hpp : Model for a playlist tree
  ****************************************************************************
  * Copyright (C) 2006-2011 the VideoLAN team
- * $Id: f9d1d0c3b32bae40c8ba1ed255bbf7bbecbc2339 $
+ * $Id: 1f71ac9d2a0dcb9b1179c4b599e807a81b5280f2 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jakob Leben <jleben@videolan.org>
@@ -25,9 +25,7 @@
 #ifndef _PLAYLIST_MODEL_H_
 #define _PLAYLIST_MODEL_H_
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "qt4.hpp"
 
 #include <vlc_input.h>
 #include <vlc_playlist.h>
diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
index a662a57502..2115b0b8d1 100644
--- a/modules/gui/qt4/components/playlist/views.cpp
+++ b/modules/gui/qt4/components/playlist/views.cpp
@@ -2,7 +2,7 @@
  * views.cpp : Views for the Playlist
  ****************************************************************************
  * Copyright © 2010 the VideoLAN team
- * $Id: 59f6535d7ccf01c7e44d3cf05bc8449953db2a36 $
+ * $Id: 00662051294b010755a7c6ed953b340efa96f464 $
  *
  * Authors:         Jean-Baptiste Kempf <jb@videolan.org>
  *
@@ -21,6 +21,12 @@
  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "qt4.hpp"
+
 #include "components/playlist/views.hpp"
 #include "components/playlist/vlc_model.hpp"      /* VLCModel */
 #include "components/playlist/sorting.h"          /* Columns List */
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 26647471c1..eca0a452e4 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -2,7 +2,7 @@
  * simple_preferences.cpp : "Simple preferences"
  ****************************************************************************
  * Copyright (C) 2006-2010 the VideoLAN team
- * $Id: 1a717662a08fc8167c9609603437d072065b543a $
+ * $Id: 56a08895c911dcef57ef487deb8412c962e108d0 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Antoine Cellerier <dionoea@videolan.org>
@@ -870,7 +870,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                      ui.recentlyPlayedFilters, setEnabled( bool ) );
             ui.recentlyPlayedFilters->setEnabled( false );
             CONFIG_BOOL( "qt-recentplay", saveRecentlyPlayed );
-            CONFIG_BOOL( "qt-continue", continueBox );
+            CONFIG_GENERIC( "qt-continue", IntegerList, ui.continuePlaybackLabel, continuePlaybackComboBox );
             CONFIG_GENERIC( "qt-recentplay-filter", String, ui.filterLabel,
                     recentlyPlayedFilters );
 
diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index bf2c1fbc3e..396ab3acce 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -74,8 +74,8 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     layout->addWidget( descBox );
 
     CONNECT( epg, itemSelectionChanged( EPGItem *), this, displayEvent( EPGItem *) );
-    CONNECT( THEMIM->getIM(), epgChanged(), this, updateInfos() );
-    CONNECT( THEMIM, inputChanged( ), this, updateInfos() );
+    CONNECT( THEMIM->getIM(), epgChanged(), this, scheduleUpdate() );
+    CONNECT( THEMIM, inputChanged( bool ), this, updateInfos() );
 
     QDialogButtonBox *buttonsBox = new QDialogButtonBox( this );
 
@@ -92,8 +92,8 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
 
     timer = new QTimer( this );
     timer->setSingleShot( true );
-    timer->setInterval( 1000 * 60 );
-    CONNECT( timer, timeout(), this, updateInfos() );
+    timer->setInterval( 5000 );
+    CONNECT( timer, timeout(), this, timeout() );
 
     updateInfos();
     restoreWidgetPosition( "EPGDialog", QSize( 650, 450 ) );
@@ -104,6 +104,25 @@ EpgDialog::~EpgDialog()
     saveWidgetPosition( "EPGDialog" );
 }
 
+void EpgDialog::showEvent(QShowEvent *)
+{
+    scheduleUpdate();
+}
+
+void EpgDialog::timeout()
+{
+    if( !isVisible() )
+        scheduleUpdate();
+    else
+        updateInfos();
+}
+
+void EpgDialog::scheduleUpdate()
+{
+    if( !timer->isActive() )
+        timer->start( 5000 );
+}
+
 void EpgDialog::displayEvent( EPGItem *epgItem )
 {
     if( !epgItem ) return;
@@ -122,7 +141,6 @@ void EpgDialog::displayEvent( EPGItem *epgItem )
 
 void EpgDialog::updateInfos()
 {
-    timer->stop();
     input_item_t *p_input_item = NULL;
     playlist_t *p_playlist = THEPL;
     input_thread_t *p_input_thread = playlist_CurrentInput( p_playlist ); /* w/hold */
@@ -137,7 +155,6 @@ void EpgDialog::updateInfos()
         {
             epg->updateEPG( p_input_item );
             vlc_gc_decref( p_input_item );
-            if ( isVisible() ) timer->start();
         }
     }
 }
diff --git a/modules/gui/qt4/dialogs/epg.hpp b/modules/gui/qt4/dialogs/epg.hpp
index 88bbd26fac..9efabbb66a 100644
--- a/modules/gui/qt4/dialogs/epg.hpp
+++ b/modules/gui/qt4/dialogs/epg.hpp
@@ -36,6 +36,9 @@ class EPGWidget;
 class EpgDialog : public QVLCFrame, public Singleton<EpgDialog>
 {
     Q_OBJECT
+protected:
+    virtual void showEvent(QShowEvent * event);
+
 private:
     EpgDialog( intf_thread_t * );
     virtual ~EpgDialog();
@@ -48,8 +51,10 @@ private:
     friend class    Singleton<EpgDialog>;
 
 private slots:
-    void displayEvent( EPGItem * );
+    void scheduleUpdate();
     void updateInfos();
+    void timeout();
+    void displayEvent( EPGItem * );
 };
 
 #endif
diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
index a11126780a..cfe51dd20a 100644
--- a/modules/gui/qt4/dialogs/messages.cpp
+++ b/modules/gui/qt4/dialogs/messages.cpp
@@ -2,7 +2,7 @@
  * messages.cpp : Information about an item
  ****************************************************************************
  * Copyright (C) 2006-2011 the VideoLAN team
- * $Id: 30793a20d4b51526728b8441335c1681e997800a $
+ * $Id: 9c79c9972721a63a11a97018e2421dbc6813c9cf $
  *
  * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
  *
@@ -24,6 +24,8 @@
 # include "config.h"
 #endif
 
+#include "qt4.hpp"
+
 #include "dialogs/messages.hpp"
 
 #include <QPlainTextEdit>
diff --git a/modules/gui/qt4/dialogs/plugins.hpp b/modules/gui/qt4/dialogs/plugins.hpp
index 48cf58adfa..f07bd3097e 100644
--- a/modules/gui/qt4/dialogs/plugins.hpp
+++ b/modules/gui/qt4/dialogs/plugins.hpp
@@ -2,7 +2,7 @@
  * plugins.hpp : Plug-ins and extensions listing
  ****************************************************************************
  * Copyright (C) 2008 the VideoLAN team
- * $Id: 26ee90ad15d3798c07d0fe06f15a580f3d3b2212 $
+ * $Id: 91bc94e0ddaac0e2535a3e07212495712ddd9c13 $
  *
  * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
  *
diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp
index cf83fdfc32..57f717e040 100644
--- a/modules/gui/qt4/dialogs/vlm.cpp
+++ b/modules/gui/qt4/dialogs/vlm.cpp
@@ -2,7 +2,7 @@
  * vlm.cpp : VLM Management
  ****************************************************************************
  * Copyright © 2008 the VideoLAN team
- * $Id: 0da88ccf2bbd7ef9c84688b384382bc301d7481d $
+ * $Id: 595f015af4fd6857420a0ab6fdc0c8872e45dcca $
  *
  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
  *          Jean-François Massol <jf.massol -at- gmail.com>
@@ -23,10 +23,6 @@
  * Foundation, Inc., 51 Franklin street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
 #include "dialogs/vlm.hpp"
 
 #ifdef ENABLE_VLM
diff --git a/modules/gui/qt4/dialogs/vlm.hpp b/modules/gui/qt4/dialogs/vlm.hpp
index cc1c78b14f..c7d1336e1c 100644
--- a/modules/gui/qt4/dialogs/vlm.hpp
+++ b/modules/gui/qt4/dialogs/vlm.hpp
@@ -2,7 +2,7 @@
  * vlm.hpp : VLM Management
  ****************************************************************************
  * Copyright ( C ) 2006 the VideoLAN team
- * $Id: a3c6e5df84174a3955edcaefc38feb4203215c0f $
+ * $Id: dcf7110fe163dc8d0980c899b73dc8c2c8d45d4d $
  *
  * Authors: Jean-François Massol <jf.massol@gmail.com>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -25,8 +25,10 @@
 #ifndef QVLC_VLM_DIALOG_H_
 #define QVLC_VLM_DIALOG_H_ 1
 
+#include "qt4.hpp"
+
 #ifdef HAVE_CONFIG_H
-# include "config.h"
+#include "config.h"
 #endif
 
 #ifdef ENABLE_VLM
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 941641cbda..fcf42485cd 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -2,7 +2,7 @@
  * input_manager.cpp : Manage an input and interact with its GUI elements
  ****************************************************************************
  * Copyright (C) 2006-2008 the VideoLAN team
- * $Id: fd45f4a89e7999ab5d4b02f1d83e6a8e0ccd87f9 $
+ * $Id: c50cb6ccaa1163da7816f60d2f09d003eee8d130 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Ilkka Ollakka  <ileoo@videolan.org>
@@ -30,6 +30,8 @@
 # include "config.h"
 #endif
 
+#include "qt4.hpp"
+
 #include "input_manager.hpp"
 #include "recents.hpp"
 
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index a38cea9f2c..6664fa16d6 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -2,7 +2,7 @@
  * input_manager.hpp : Manage an input and interact with its GUI elements
  ****************************************************************************
  * Copyright (C) 2006-2008 the VideoLAN team
- * $Id: 7d3b76af17b5923e5566aedaf2d0b579407a7faa $
+ * $Id: 4fbecbb38681ed19b1baf9103a030b19e2090f55 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste <jb@videolan.org>
@@ -29,9 +29,10 @@
 # include "config.h"
 #endif
 
+#include "qt4.hpp"
+
 #include <vlc_input.h>
 
-#include "qt4.hpp"
 #include "util/singleton.hpp"
 #include "adapters/variables.hpp"
 
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 2cc6504aa0..20d58d3077 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -2,7 +2,7 @@
  * menus.cpp : Qt menus
  *****************************************************************************
  * Copyright © 2006-2011 the VideoLAN team
- * $Id: 116e98c8c45ab96ee18e36c2c5f2354fe63c5d6c $
+ * $Id: 46240b0344b4bde5079dc8ee69a85ad2ec26d185 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -34,6 +34,8 @@
 # include "config.h"
 #endif
 
+#include "qt4.hpp"
+
 #include <vlc_common.h>
 #include <vlc_intf_strings.h>
 #include <vlc_vout.h>                             /* vout_thread_t */
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index d299750582..65a82607be 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -2,7 +2,7 @@
  * qt4.hpp : Qt interface
  ****************************************************************************
  * Copyright (C) 2006-2009 the VideoLAN team
- * $Id: 44d7db657403d85ae4dfd3d742d84007533f35ac $
+ * $Id: 5aec9570c3507ef2e657ef9517acaba97fac4402 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -29,12 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>    /* VLC_COMMON_MEMBERS for vlc_interface.h */
-#include <vlc_interface.h> /* intf_thread_t */
-#include <vlc_playlist.h>  /* playlist_t */
-
-#define QT_NO_CAST_TO_ASCII
-#include <QString>
+#include <QtGlobal>
 
 #if ( QT_VERSION < 0x040600 )
 # error Update your Qt version to at least 4.6.0
@@ -43,6 +38,31 @@
 #define HAS_QT47 ( QT_VERSION >= 0x040700 )
 #define HAS_QT5  ( QT_VERSION >= 0x050000 )
 
+#if HAS_QT5
+  #include <QtCore/qcompilerdetection.h>
+  #if defined(Q_COMPILER_ATOMICS) && \
+             ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7 ) )
+   #define VLC_ATOMIC_H
+   #include <atomic>
+   using namespace std;
+   #  define atomic_store(object,desired) \
+      do { \
+          *(object) = (desired); \
+          __sync_synchronize(); \
+      } while (0)
+
+   #  define atomic_load(object) \
+       (__sync_synchronize(), *(object))
+  #endif
+#endif
+
+#include <vlc_common.h>    /* VLC_COMMON_MEMBERS for vlc_interface.h */
+#include <vlc_interface.h> /* intf_thread_t */
+#include <vlc_playlist.h>  /* playlist_t */
+
+#define QT_NO_CAST_TO_ASCII
+#include <QString>
+
 enum {
     DialogEventTypeOffset = 0,
     IMEventTypeOffset     = 100,
diff --git a/modules/gui/qt4/ui/sprefs_interface.ui b/modules/gui/qt4/ui/sprefs_interface.ui
index 4d06fdbef3..e9dd718c78 100644
--- a/modules/gui/qt4/ui/sprefs_interface.ui
+++ b/modules/gui/qt4/ui/sprefs_interface.ui
@@ -271,6 +271,20 @@
                </property>
               </widget>
              </item>
+             <item row="10" column="0">
+              <widget class="QLabel" name="continuePlaybackLabel">
+               <property name="text">
+                <string>Continue playback?</string>
+               </property>
+              </widget>
+             </item>
+             <item row="10" column="2" colspan="2">
+              <widget class="QComboBox" name="continuePlaybackComboBox">
+               <property name="enabled">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
             </layout>
            </widget>
           </item>
@@ -560,13 +574,6 @@
         </property>
        </widget>
       </item>
-      <item row="3" column="0" colspan="4">
-       <widget class="QCheckBox" name="continueBox">
-        <property name="text">
-         <string>Continue playback?</string>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
diff --git a/modules/gui/qt4/util/pictureflow.cpp b/modules/gui/qt4/util/pictureflow.cpp
index 9318953984..a7e6a01f93 100644
--- a/modules/gui/qt4/util/pictureflow.cpp
+++ b/modules/gui/qt4/util/pictureflow.cpp
@@ -29,6 +29,8 @@
   THE SOFTWARE.
 */
 
+#include "qt4.hpp"
+
 #include "pictureflow.hpp"
 
 #include <QApplication>
diff --git a/modules/mux/mp4.c b/modules/mux/mp4.c
index 4bf29529bc..b8d8783105 100644
--- a/modules/mux/mp4.c
+++ b/modules/mux/mp4.c
@@ -2,7 +2,7 @@
  * mp4.c: mp4/mov muxer
  *****************************************************************************
  * Copyright (C) 2001, 2002, 2003, 2006 VLC authors and VideoLAN
- * $Id: e6d705bab43348b1760846458230d4850e1e4722 $
+ * $Id: 1f965474d3dc8c3cee94033dad48deff8a2d7371 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin at videolan dot org>
@@ -111,7 +111,6 @@ typedef struct
     int64_t      i_dts_start; /* applies to current segment only */
     int64_t      i_duration;
     uint32_t     i_timescale;
-    mtime_t      i_starttime; /* the really first packet */
     bool         b_hasbframes;
 
     /* for later stco fix-up (fast start files) */
@@ -133,6 +132,7 @@ struct sout_mux_sys_t
     uint64_t i_mdat_pos;
     uint64_t i_pos;
     mtime_t  i_duration;
+    mtime_t  i_first_dts;
 
     unsigned int   i_nb_streams;
     mp4_stream_t **pp_streams;
@@ -196,6 +196,7 @@ static int Open(vlc_object_t *p_this)
     p_sys->b_mov        = p_mux->psz_mux && !strcmp(p_mux->psz_mux, "mov");
     p_sys->b_3gp        = p_mux->psz_mux && !strcmp(p_mux->psz_mux, "3gp");
     p_sys->i_duration   = 0;
+    p_sys->i_first_dts  = 0;
 
     if (!p_sys->b_mov) {
         /* Now add ftyp header */
@@ -418,7 +419,6 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input)
         p_stream->i_timescale = p_stream->fmt.audio.i_rate;
     else
         p_stream->i_timescale = CLOCK_FREQ;
-    p_stream->i_starttime   = p_sys->i_duration;
     p_stream->b_hasbframes  = false;
 
     p_stream->i_last_dts    = 0;
@@ -469,11 +469,18 @@ static int Mux(sout_mux_t *p_mux)
         /* Reset reference dts in case of discontinuity (ex: gather sout) */
         if ( p_stream->i_entry_count == 0 || p_data->i_flags & BLOCK_FLAG_DISCONTINUITY )
         {
-            p_stream->i_dts_start = p_data->i_dts;
-            p_stream->i_last_dts = p_data->i_dts;
+            p_stream->i_dts_start = VLC_TS_INVALID;
+            p_stream->i_last_dts = VLC_TS_INVALID;
             p_stream->i_length_neg = 0;
         }
 
+        if(p_stream->i_dts_start == VLC_TS_INVALID)
+        {
+            p_stream->i_dts_start = p_data->i_dts;
+            if(p_sys->i_first_dts == VLC_TS_INVALID)
+                p_sys->i_first_dts = p_data->i_dts;
+        }
+
         if (p_stream->fmt.i_cat != SPU_ES) {
             /* Fix length of the sample */
             if (block_FifoCount(p_input->p_fifo) > 0) {
@@ -526,16 +533,20 @@ static int Mux(sout_mux_t *p_mux)
         if (p_stream->fmt.i_cat == SPU_ES && p_stream->i_entry_count > 0) {
             int64_t i_length = p_data->i_dts - p_stream->i_last_dts;
 
-            if (i_length <= 0) /* FIXME handle this broken case */
-                i_length = 1;
+            if (i_length < 0) /* FIXME handle this broken case */
+                i_length = 0;
 
             /* Fix last entry */
-            if (p_stream->entry[p_stream->i_entry_count-1].i_length <= 0)
-                p_stream->entry[p_stream->i_entry_count-1].i_length = i_length;
+            p_stream->entry[p_stream->i_entry_count-1].i_length = i_length;
+            p_stream->i_duration += i_length;
         }
 
+        /* Update (Not earlier for SPU!) */
+        if(p_stream->i_last_dts < p_data->i_dts)
+            p_stream->i_last_dts = p_data->i_dts;
+
         /* add index entry */
-        mp4_entry_t *e = &p_stream->entry[p_stream->i_entry_count];
+        mp4_entry_t *e = &p_stream->entry[p_stream->i_entry_count++];
         e->i_pos    = p_sys->i_pos;
         e->i_size   = p_data->i_buffer;
 
@@ -550,7 +561,6 @@ static int Mux(sout_mux_t *p_mux)
         e->i_length = p_data->i_length;
         e->i_flags  = p_data->i_flags;
 
-        p_stream->i_entry_count++;
         /* XXX: -1 to always have 2 entry for easy adding of empty SPU */
         if (p_stream->i_entry_count >= p_stream->i_entry_max - 1) {
             p_stream->i_entry_max += 1000;
@@ -562,37 +572,28 @@ static int Mux(sout_mux_t *p_mux)
         p_stream->i_duration += __MAX( 0, p_data->i_length );
         p_sys->i_pos += p_data->i_buffer;
 
-        /* Save the DTS for SPU */
-        p_stream->i_last_dts = p_data->i_dts;
-
         /* write data */
         sout_AccessOutWrite(p_mux->p_access, p_data);
 
         /* close subtitle with empty frame */
         if (p_stream->fmt.i_cat == SPU_ES) {
-            int64_t i_length = p_stream->entry[p_stream->i_entry_count-1].i_length;
 
-            if ( i_length != 0 && (p_data = block_Alloc(3)) ) {
+            if ( (p_data = block_Alloc(3)) ) {
                 /* TODO */
                 msg_Dbg(p_mux, "writing an empty sub") ;
 
-                /* Append a idx entry */
-                mp4_entry_t *e = &p_stream->entry[p_stream->i_entry_count];
-                e->i_pos    = p_sys->i_pos;
-                e->i_size   = 3;
-                e->i_pts_dts= 0;
-                e->i_length = 0;
-                e->i_flags  = 0;
-
-                /* XXX: No need to grow the entry here */
-                p_stream->i_entry_count++;
+                /* point to start of our empty */
+                p_stream->i_last_dts += e->i_length;
 
-                /* Fix last dts */
-                p_stream->i_last_dts += i_length;
+                /* Append a idx entry */
+                mp4_entry_t *p_empty = &p_stream->entry[p_stream->i_entry_count++];
+                p_empty->i_pos    = p_sys->i_pos;
+                p_empty->i_size   = 3;
+                p_empty->i_pts_dts= 0;
+                p_empty->i_length = 0;
+                p_empty->i_flags  = 0;
 
                 /* Write a " " */
-                p_data->i_dts = p_stream->i_last_dts;
-                p_data->i_dts = p_data->i_pts;
                 p_data->p_buffer[0] = 0;
                 p_data->p_buffer[1] = 1;
                 p_data->p_buffer[2] = ' ';
@@ -601,17 +602,10 @@ static int Mux(sout_mux_t *p_mux)
 
                 sout_AccessOutWrite(p_mux->p_access, p_data);
             }
-
-            /* Fix duration = current segment starttime + duration within */
-            p_stream->i_duration = p_stream->i_starttime + ( p_stream->i_last_dts - p_stream->i_dts_start );
         }
-    }
 
-    /* Update the global segment/media duration */
-    for ( unsigned int i=0; i<p_sys->i_nb_streams; i++ )
-    {
-        if ( p_sys->pp_streams[i]->i_duration > p_sys->i_duration )
-            p_sys->i_duration = p_sys->pp_streams[i]->i_duration;
+        if ( p_stream->i_duration > p_sys->i_duration )
+            p_sys->i_duration = p_stream->i_duration;
     }
 
     return(VLC_SUCCESS);
@@ -1369,6 +1363,20 @@ static bo_t *GetTextBox(void)
     return text;
 }
 
+static int64_t GetScaledEntryDuration( const mp4_entry_t *p_entry, uint32_t i_timescale,
+                                       mtime_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;
+
+    /* 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;
+    *pi_total_mtime += p_entry->i_length;
+    *pi_total_scaled += i_scaled;
+
+    return i_scaled;
+}
+
 static bo_t *GetStblBox(sout_mux_t *p_mux, mp4_stream_t *p_stream)
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
@@ -1439,17 +1447,30 @@ static bo_t *GetStblBox(sout_mux_t *p_mux, mp4_stream_t *p_stream)
     bo_t *stts = box_full_new("stts", 0, 0);
     bo_add_32be(stts, 0);     // entry-count (fixed latter)
 
+    mtime_t i_total_mtime = 0;
+    int64_t i_total_scaled = 0;
     unsigned i_index = 0;
     for (unsigned i = 0; i < p_stream->i_entry_count; i_index++) {
         int     i_first = i;
-        mtime_t i_delta = p_stream->entry[i].i_length;
 
-        for (; i < p_stream->i_entry_count; ++i)
-            if (i == p_stream->i_entry_count || p_stream->entry[i].i_length != i_delta)
+        int64_t i_scaled = GetScaledEntryDuration(&p_stream->entry[i], p_stream->i_timescale,
+                                                  &i_total_mtime, &i_total_scaled);
+        for (unsigned j=i+1; j < p_stream->i_entry_count; j++)
+        {
+            mtime_t i_total_mtime_next = i_total_mtime;
+            int64_t i_total_scaled_next = i_total_scaled;
+            int64_t i_scalednext = GetScaledEntryDuration(&p_stream->entry[j], p_stream->i_timescale,
+                                                          &i_total_mtime_next, &i_total_scaled_next);
+            if( i_scalednext != i_scaled )
                 break;
 
-        bo_add_32be(stts, i - i_first); // sample-count
-        bo_add_32be(stts, i_delta * p_stream->i_timescale / CLOCK_FREQ ); // sample-delta
+            i_total_mtime = i_total_mtime_next;
+            i_total_scaled = i_total_scaled_next;
+            i = j;
+        }
+
+        bo_add_32be(stts, ++i - i_first); // sample-count
+        bo_add_32be(stts, i_scaled); // sample-delta
     }
     bo_fix_32be(stts, 12, i_index);
 
@@ -1701,21 +1722,24 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
         /* *** add /moov/trak/edts and elst */
         bo_t *edts = box_new("edts");
         bo_t *elst = box_full_new("elst", p_sys->b_64_ext ? 1 : 0, 0);
-        if (p_stream->i_starttime > 0) {
+        const mtime_t i_start_offset = p_stream->i_dts_start - p_sys->i_first_dts;
+        if (i_start_offset > 0) {
             bo_add_32be(elst, 2);
 
             if (p_sys->b_64_ext) {
-                bo_add_64be(elst, p_stream->i_starttime *
+                bo_add_64be(elst, i_start_offset *
                              i_movie_timescale / CLOCK_FREQ);
                 bo_add_64be(elst, -1);
             } else {
-                bo_add_32be(elst, p_stream->i_starttime *
+                bo_add_32be(elst, i_start_offset *
                              i_movie_timescale / CLOCK_FREQ);
                 bo_add_32be(elst, -1);
             }
             bo_add_16be(elst, 1);
             bo_add_16be(elst, 0);
-        } else {
+        }
+        else
+        {
             bo_add_32be(elst, 1);
         }
         if (p_sys->b_64_ext) {
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index b5e116d120..67fe848d7e 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -2,7 +2,7 @@
  * h264.c: h264/avc video packetizer
  *****************************************************************************
  * Copyright (C) 2001, 2002, 2006 VLC authors and VideoLAN
- * $Id: e671f6e92bc97347bd50355db4ddc5664974f547 $
+ * $Id: 7e29b8683e0c3d1e07146b7b6952c0175d98b6d8 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -572,7 +572,7 @@ static void CreateDecodedNAL( uint8_t **pp_ret, int *pi_ret,
     *pi_ret = dst - *pp_ret;
 }
 
-static inline int bs_read_ue( bs_t *s )
+static inline uint32_t bs_read_ue( bs_t *s )
 {
     int i = 0;
 
@@ -580,7 +580,7 @@ static inline int bs_read_ue( bs_t *s )
     {
         i++;
     }
-    return( ( 1 << i) - 1 + bs_read( s, i ) );
+    return( ( 1u << i) - 1 + bs_read( s, i ) );
 }
 
 static inline int bs_read_se( bs_t *s )
@@ -794,7 +794,7 @@ static void PutSPS( decoder_t *p_dec, block_t *p_frag )
     int     i_dec = 0;
     bs_t s;
     int i_tmp;
-    int i_sps_id;
+    uint32_t i_sps_id;
 
     CreateDecodedNAL( &pb_dec, &i_dec, &p_frag->p_buffer[5],
                      p_frag->i_buffer - 5 );
@@ -807,9 +807,9 @@ static void PutSPS( decoder_t *p_dec, block_t *p_frag )
     p_dec->fmt_out.i_level = bs_read( &s, 8 );
     /* sps id */
     i_sps_id = bs_read_ue( &s );
-    if( i_sps_id >= SPS_MAX || i_sps_id < 0 )
+    if( i_sps_id >= SPS_MAX )
     {
-        msg_Warn( p_dec, "invalid SPS (sps_id=%d)", i_sps_id );
+        msg_Warn( p_dec, "invalid SPS (sps_id=%u)", i_sps_id );
         free( pb_dec );
         block_Release( p_frag );
         return;
@@ -989,8 +989,8 @@ static void PutPPS( decoder_t *p_dec, block_t *p_frag )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     bs_t s;
-    int i_pps_id;
-    int i_sps_id;
+    uint32_t i_pps_id;
+    uint32_t i_sps_id;
 
     bs_init( &s, &p_frag->p_buffer[5], p_frag->i_buffer - 5 );
     i_pps_id = bs_read_ue( &s ); // pps id
diff --git a/modules/text_renderer/quartztext.c b/modules/text_renderer/quartztext.c
index 33b98e1e44..1a6086777d 100644
--- a/modules/text_renderer/quartztext.c
+++ b/modules/text_renderer/quartztext.c
@@ -2,7 +2,7 @@
  * quartztext.c : Put text on the video, using Mac OS X Quartz Engine
  *****************************************************************************
  * Copyright (C) 2007, 2009, 2012 VLC authors and VideoLAN
- * $Id: 69a31ed35da823e7a810ea1ca76af5380beeb326 $
+ * $Id: 3e75a08a74e2f3a487e03c386fec4c9fa96d177f $
  *
  * Authors: Bernie Purcell <bitmap@videolan.org>
  *          Pierre d'Herbemont <pdherbemont # videolan dot>
diff --git a/modules/video_splitter/Makefile.am b/modules/video_splitter/Makefile.am
index f0e023cd04..4998c719cc 100644
--- a/modules/video_splitter/Makefile.am
+++ b/modules/video_splitter/Makefile.am
@@ -15,8 +15,8 @@ if HAVE_WIN32
 splitter_LTLIBRARIES += libpanoramix_plugin.la
 else
 if HAVE_XCB_RANDR
-libpanoramix_plugin_la_CFLAGS += $(XCB_RANDR_CFLAGS)
-libpanoramix_plugin_la_LIBADD += $(XCB_RANDR_LIBS)
+libpanoramix_plugin_la_CFLAGS += $(XCB_RANDR_CFLAGS) $(XCB_CFLAGS)
+libpanoramix_plugin_la_LIBADD += $(XCB_RANDR_LIBS) $(XCB_LIBS)
 splitter_LTLIBRARIES += libpanoramix_plugin.la
 endif
 endif
diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
index 98d7182e21..dc487c51d9 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -2,7 +2,7 @@
  * projectm.cpp: visualization module based on libprojectM
  *****************************************************************************
  * Copyright © 2009-2011 VLC authors and VideoLAN
- * $Id: e80fbf45b49752a2dd764cde39f3f5a4af4a9dbe $
+ * $Id: 96d532d05942267e976ab15e6e8f4870fee7c0d5 $
  *
  * Authors: Rémi Duraffort <ivoire@videolan.org>
  *          Laurent Aimar
@@ -30,6 +30,10 @@
 #endif
 
 #include <assert.h>
+#if defined(__GNUC__) && \
+           ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7 ) )
+  #define VLC_ATOMIC_H /* Ensure C atomics wont collide with old intrinsics */
+#endif
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
diff --git a/share/Makefile.am b/share/Makefile.am
index 029c9f4b1e..b08b3e8751 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -76,11 +76,13 @@ skins2_default_vlt_FILES = \
 	skins2/default/subX/vol_slider.png
 
 skins2/default.vlt: $(skins2_default_vlt_FILES)
-	mkdir -p skins2
-	(cd "$(srcdir)/skins2"; find default -print0 | \
-		LC_ALL=C sort -z | \
-		tar cvv --exclude .svn --no-recursion --null -T -) | \
-	gzip -n > skins2/default.vlt
+	$(AM_V_at)mkdir -p skins2
+	$(AM_V_at)rm -f -- skins2/default.vlt.tmp
+	$(AM_V_GEN)GZIP=--no-name \
+	tar cvvzf skins2/default.vlt.tmp \
+		--owner=root --group=root --directory="$(srcdir)/skins2" \
+		default/
+	$(AM_V_at)mv -f -- skins2/default.vlt.tmp skins2/default.vlt
 
 #
 # LUA
@@ -152,7 +154,6 @@ nobase_vlclib_DATA = \
 	lua/sd/icecast.luac \
 	lua/sd/icast.luac \
 	lua/sd/jamendo.luac \
-	lua/sd/metachannels.luac \
 	$(NULL)
 
 nobase_doc_DATA = \
@@ -244,8 +245,7 @@ EXTRA_DIST += \
 	lua/sd/fmc.lua \
 	lua/sd/icecast.lua \
 	lua/sd/icast.lua \
-	lua/sd/jamendo.lua \
-	lua/sd/metachannels.lua
+	lua/sd/jamendo.lua
 
 DIST_http_lua = \
 	lua/http/view.html \
diff --git a/share/lua/extensions/VLSub.lua b/share/lua/extensions/VLSub.lua
index ecac0030ac..cd6f7b770d 100644
--- a/share/lua/extensions/VLSub.lua
+++ b/share/lua/extensions/VLSub.lua
@@ -1189,7 +1189,7 @@ openSub = {
     local request = "<?xml version='1.0'?>"..dump_xml(reqTable)
     local host, path = parse_url(openSub.conf.url)		
     local header = {
-      "POST "..path.." HTTP/1.1", 
+      "POST "..path.." HTTP/1.0", 
       "Host: "..host, 
       "User-Agent: "..openSub.conf.userAgentHTTP, 
       "Content-Type: text/xml", 
@@ -1840,7 +1840,7 @@ end
 function get(url)
   local host, path = parse_url(url)
   local header = {
-    "GET "..path.." HTTP/1.1", 
+    "GET "..path.." HTTP/1.0", 
     "Host: "..host, 
     "User-Agent: "..openSub.conf.userAgentHTTP,
     "",
diff --git a/share/lua/http/index.html b/share/lua/http/index.html
index bf831c9b3b..211fa08eec 100644
--- a/share/lua/http/index.html
+++ b/share/lua/http/index.html
@@ -168,7 +168,7 @@
 					modal: true,
 					buttons:{
 						"<?vlc gettext("Yes") ?>":function(){
-							var file			=	$('[current="current"]','#libraryTree').length>0 ? decodeURIComponent($('[current="current"]','#libraryTree').first().attr('uri').substr(7)) : ($('.jstree-clicked','#libraryTree').length>0 ? decodeURIComponent($('.jstree-clicked','#libraryTree').first().parents().first().attr('uri').substr(7)) : ($('#plid_'+current_id).attr('uri') ? decodeURIComponent($('#plid_'+current_id).attr('uri').substr(7)) : false));
+							var file			=	$('[current="current"]','#libraryTree').length>0 ? $('[current="current"]','#libraryTree').first().attr('uri') : ($('.jstree-clicked','#libraryTree').length>0 ? $('.jstree-clicked','#libraryTree').first().parents().first().attr('uri') : ($('#plid_'+current_id).attr('uri') ? $('#plid_'+current_id).attr('uri') : false));
 							if(file){
 								if($('#viewContainer').css('display')=='none'){
 									$('#buttonViewer').click();
diff --git a/share/lua/intf/cli.lua b/share/lua/intf/cli.lua
index 0a0f4368d0..bdc5b79349 100644
--- a/share/lua/intf/cli.lua
+++ b/share/lua/intf/cli.lua
@@ -215,7 +215,8 @@ function playlist(name,client,arg)
     function playlist0(item,prefix)
         local prefix = prefix or ""
         if not item.flags.disabled then
-            local str = "| "..prefix..tostring(item.id).." - "..item.name
+            local str = "| "..prefix..tostring(item.id).." - "..
+                            ( item.name or item.path )
             if item.duration > 0 then
                 str = str.." ("..common.durationtostring(item.duration)..")"
             end
diff --git a/share/lua/playlist/appletrailers.lua b/share/lua/playlist/appletrailers.lua
index d8c3cc24b9..c9015eca75 100644
--- a/share/lua/playlist/appletrailers.lua
+++ b/share/lua/playlist/appletrailers.lua
@@ -20,11 +20,10 @@
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 --]]
 
--- Probe function.
+-- Probe function
 function probe()
-    return vlc.access == "http"
-        and string.match( vlc.path, "trailers.apple.com" )
-        and string.match( vlc.path, "web.inc" )
+    return (vlc.access == "http" or vlc.access == "https")
+        and string.match( vlc.path, "^trailers%.apple%.com/trailers/.+/.+" )
 end
 
 function find( haystack, needle )
@@ -32,62 +31,113 @@ function find( haystack, needle )
     return r
 end
 
-function sort(a, b)
-    if(a == nil) then return false end
-    if(b == nil) then return false end
+function parse_json(url)
+    vlc.msg.dbg("Trying to parse JSON from " .. url)
+    local json = require ("dkjson")
 
-    local str_a
-    local str_b
+    -- Use vlc.stream to grab a remote json file, place it in a string,
+    -- decode it and return the decoded data.
+    local stream = vlc.stream(url)
+    local string = ""
+    local line   = ""
 
-    if(string.find(a.name, '%(') == 1) then
-        str_a = tonumber(string.sub(a.name, 2, string.find(a.name, 'p') - 1))
-        str_b = tonumber(string.sub(b.name, 2, string.find(b.name, 'p') - 1))
-    else
-        str_a = string.sub(a.name, 1, string.find(a.name, '%(') - 2)
-        str_b = string.sub(b.name, 1, string.find(b.name, '%(') - 2)
-        if(str_a == str_b) then
-            str_a = tonumber(string.sub(a.name, string.len(str_a) + 3, string.find(a.name, 'p', string.len(str_a) + 3) - 1))
-            str_b = tonumber(string.sub(b.name, string.len(str_b) + 3, string.find(b.name, 'p', string.len(str_b) + 3) - 1))
-        end
+    if not stream then return false end
+
+    while true do
+        line = stream:readline()
+        if not line then break end
+
+        string = string .. line
     end
-    if(str_a > str_b) then return false else return true end
+
+    return json.decode(string)
 end
 
 -- Parse function.
 function parse()
+    local video_id = nil
     local playlist = {}
-    local description = ''
-    local art_url = ''
 
-    while true
-    do 
+    while true do
         line = vlc.readline()
         if not line then break end
 
-        if string.match( line, "h3>.-</h3" ) then
-            description = find( line, "h3>(.-)</h3")
-            vlc.msg.dbg(description)
+        if string.match(line, "FilmId%s+=%s+'%d+'") then
+            video_id = find(line, "FilmId%s+=%s+'(%d+)'")
+            vlc.msg.dbg("Found FilmId " .. video_id)
+            break
         end
-        if string.match( line, 'img src=') then
-            for img in string.gmatch(line, '<img src="(http://.*%.jpg)" ') do
-                art_url = img
-            end
-            for i,value in pairs(playlist) do
-                if value.arturl == '' then
-                    playlist[i].arturl = art_url
-                end
-            end
+    end
+
+    -- Found a video id
+    if video_id ~= nil then
+        -- Lookup info from the json endpoint
+        local info = filmid_info(video_id)
+
+        -- Parse data
+        if info["clips"] == nil then
+            vlc.msg.err("Unexpected JSON response from Apple trailers")
+            return playlist
         end
-        if string.match( line, 'class="hd".-%.mov') then
-            for urlline,resolution in string.gmatch(line, 'class="hd".-href="(.-%.mov)".->(%d+.-p)') do
-                urlline = string.gsub( urlline, "_"..resolution, "_h"..resolution )
-                table.insert( playlist, { path = urlline,
-                                          name = description.." "..resolution,
-                                          arturl = art_url,
-                                          options = {":http-user-agent=QuickTime/7.5", ":play-and-pause", ":demux=avformat"} } )
+
+        local movietitle = lookup_keys(info, "details/locale/en/movie_title")
+        local desc       = lookup_keys(info, "details/locale/en/synopsis")
+
+        for _, clip in ipairs(info["clips"]) do
+            local item          = {}
+
+            if clip["title"] == nil then
+                item["name"] = movietitle
+            else
+                item["name"] = movietitle .. " (" .. clip["title"] .. ")"
             end
+            item["path"]        = get_preferred_src(clip)
+            item["artist"]      = clip["artist"]
+            item["arturl"]      = clip["thumb"]
+            item["description"] = desc
+            item["url"]         = vlc.path
+
+            table.insert(playlist, item)
         end
+    else
+        vlc.msg.err("Couldn't extract trailer video URL")
     end
 
     return playlist
 end
+
+-- Request, parse and return the info for a FilmID
+function filmid_info(id)
+    local film_url = "https://trailers.apple.com/trailers/feeds/data/"; .. id .. ".json"
+    vlc.msg.dbg("Fetching FilmID info from " .. film_url)
+
+    return parse_json(film_url)
+end
+
+-- Get the user-preferred quality src
+function get_preferred_src(clip)
+    local resolution = vlc.var.inherit(nil, "preferred-resolution")
+    if resolution == -1 then
+        return lookup_keys(clip, "versions/enus/sizes/hd1080/srcAlt")
+    end
+    if resolution >= 1080 then
+        return lookup_keys(clip, "versions/enus/sizes/hd1080/srcAlt")
+    end
+    if resolution >= 720 then
+        return lookup_keys(clip, "versions/enus/sizes/hd720/srcAlt")
+    end
+    return lookup_keys(clip, "versions/enus/sizes/sd/srcAlt")
+end
+
+-- Resolve a "path" in a table or return nil if any of
+-- the keys are not found
+function lookup_keys(table, path)
+    local value = table
+    for token in path:gmatch( "[^/]+" ) do
+        value = value[token]
+        if value == nil then
+            break
+        end
+    end
+    return value
+end
diff --git a/share/lua/playlist/dailymotion.lua b/share/lua/playlist/dailymotion.lua
index db648554fd..f85ca62fcc 100644
--- a/share/lua/playlist/dailymotion.lua
+++ b/share/lua/playlist/dailymotion.lua
@@ -4,7 +4,7 @@
 
  $Id$
 
- Copyright © 2007-2011 the VideoLAN team
+ Copyright © 2007-2016 the VideoLAN team
 
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
@@ -32,9 +32,6 @@ end
 
 -- Parse function.
 function parse()
-	prefres = vlc.var.inherit(nil, "preferred-resolution")
-
-
 	while true
     do
         line = vlc.readline()
@@ -49,56 +46,46 @@ function parse()
                 description = vlc.strings.resolve_xml_special_chars( description )
             end
 		end
-		if string.match( line, "<meta name=\"author\"" ) then
-			_,_,artist = string.find( line, "content=\"(.-)\"" )
-			artist = vlc.strings.resolve_xml_special_chars( artist )
-		end
 		if string.match( line, "<link rel=\"thumbnail\" type=\"image/jpeg\"" ) then
 			_,_,arturl = string.find( line, "href=\"(.-)\"" )
 		end
-    end
-
-	page_embed = string.gsub(vlc.path, "dailymotion.com/video/", "dailymotion.com/embed/video/")
-	page_url = vlc.stream(vlc.access .. "://" .. page_embed )
-	if not page_url then return nil end
-    page = page_url:read( 65653 )
-
-
-	hd1080url = string.match( page, "\"stream_h264_hd1080_url\"%s*:%s*\"([^\"]*)\"")
-	hdurl = string.match( page, "\"stream_h264_hd_url\"%s*:%s*\"([^\"]*)\"")
-	hqurl = string.match( page, "\"stream_h264_hq_url\"%s*:%s*\"([^\"]*)\"")
-	baseurl = string.match( page, "\"stream_h264_url\"%s*:%s*\"([^\"]*)\"")
-	ldurl = string.match( page, "\"stream_h264_ld_url\"%s*:%s*\"([^\"]*)\"")
-	livehlsurl = string.match( page, "\"stream_live_hls_url\"%s*:%s*\"([^\"]*)\"")
-
-
-	arr_videos_urls = {}
-	if hd1080url then	table.insert(arr_videos_urls,hd1080url)	end
-	if hdurl then table.insert(arr_videos_urls,hdurl) end
-	if hqurl then	table.insert(arr_videos_urls,hqurl)	end
-	if baseurl then table.insert(arr_videos_urls,baseurl) end
-	if ldurl then table.insert(arr_videos_urls,baseurl) end
 
+        if string.match( line, "var config = {" ) then
+            artist = string.match( line, '"username":"([^"]+)"' )
+
+            local streams = string.match( line, "\"qualities\":{(.-%])}" )
+            if streams then
+                local prefres = vlc.var.inherit(nil, "preferred-resolution")
+                local file = nil
+                local live = nil
+                for height,stream in string.gmatch( streams, "\"(%w+)\":%[(.-)%]" ) do
+                    -- Apparently formats are listed in increasing quality
+                    -- order, so we take the first, lowest quality as
+                    -- fallback, then pick the last one that matches.
+                    if string.match( height, "^(%d+)$" ) and ( ( not file ) or prefres < 0 or tonumber( height ) <= prefres ) then
+                        local f = string.match( stream, '"type":"video\\/[^"]+","url":"([^"]+)"' )
+                        if f then
+                            file = f
+                        end
+                    end
+                    if not live then
+                        live = string.match( stream, '"type":"application\\/x%-mpegURL","url":"([^"]+)"' )
+                    end
+                end
+
+                -- Pick live streaming only as a fallback
+                path = file or live
+                if path then
+                    path = string.gsub( path, "\\/", "/")
+                end
+            end
+        end
+    end
 
-	if livehlsurl then
-		return { { path = livehlsurl:gsub("\\/", "/"); name = name; description = description; url = vlc.path; arturl = arturl ; artist = artist} }
-	else
-		if table.getn(arr_videos_urls) > 0 then
-			for i=1 , table.getn(arr_videos_urls)  do
-				video_url_out = arr_videos_urls[i]:gsub("\\/", "/")
+    if not path then
+        vlc.msg.err("Couldn't extract the video URL from dailymotion")
+        return { }
+    end
 
-				if prefres < 0 then
-					break
-				end
-				height = string.match( video_url_out, "/cdn/%w+%-%d+x(%d+)/video/" )
-				if not height or tonumber(height) <= prefres then
-					break
-				end
-			end
-			return { { path = video_url_out; name = name; description = description; url = vlc.path; arturl = arturl; artist = artist} }
-		else
-			vlc.msg.err("Couldn't extract the video URL from dailymotion")
-			return { }
-		end
-	end
+    return { { path = path; name = name; description = description; url = vlc.path; arturl = arturl; artist = artist } }
 end
diff --git a/share/lua/playlist/soundcloud.lua b/share/lua/playlist/soundcloud.lua
index 0e0c629dff..3ad7567039 100644
--- a/share/lua/playlist/soundcloud.lua
+++ b/share/lua/playlist/soundcloud.lua
@@ -46,10 +46,10 @@ function parse()
             local track = string.match( line, "soundcloud:tracks:(%d+)" )
             if track then
                 -- API magic
-                local client_id = "02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea"
+                local client_id = "fDoItMDbsbZz8dY16ZzARCZmzgHBPotA"
                 -- app_version is not required by the API but we send it
                 -- anyway to remain unconspicuous
-                local app_version = "a089efd"
+                local app_version = "1480607078"
 
                 local api = vlc.stream( "https://api.soundcloud.com/i1/tracks/"..track.."/streams?client_id="..client_id.."&app_version="..app_version )
                 if not api then
diff --git a/share/lua/playlist/vimeo.lua b/share/lua/playlist/vimeo.lua
index 00ef98b42e..8e15b914f0 100644
--- a/share/lua/playlist/vimeo.lua
+++ b/share/lua/playlist/vimeo.lua
@@ -37,10 +37,16 @@ function parse()
         while true do
             local line = vlc.readline()
             if not line then break end
-            path = string.match( line, "data%-config%-url=\"(.-)\"" )
-            if path then
-                path = vlc.strings.resolve_xml_special_chars( path )
-                return { { path = path } }
+
+            -- Get the appropriate ubiquitous meta tag
+            -- <meta name="twitter:player" content="https://player.vimeo.com/video/123456789";>
+            local meta = string.match( line, "(<meta[^>]- name=\"twitter:player\"[^>]->)" )
+            if meta then
+                local path = string.match( meta, " content=\"(.-)\"" )
+                if path then
+                    path = vlc.strings.resolve_xml_special_chars( path )
+                    return { { path = path } }
+                end
             end
         end
 
@@ -58,7 +64,7 @@ function parse()
                 -- Apparently the different formats available are listed
                 -- in uncertain order of quality, so compare with what
                 -- we have so far.
-                local height = string.match( stream, "\"height\":(%d+)[,}]" )
+                local height = string.match( stream, "\"height\":(%d+)" )
                 height = tonumber( height )
 
                 -- Better than nothing
diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 6743f79f74..d3fa4bc7b7 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -107,21 +107,24 @@ function js_descramble( sig, js_url )
     -- c&&a.set("signature",br(c));
     local descrambler = js_extract( js, "%.set%(\"signature\",(.-)%(", nil )
     if not descrambler then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature descrambling function name" )
         return sig
     end
 
     -- Fetch the code of the descrambler function
-    -- var Go=function(a){a=a.split("");Fo.sH(a,2);Fo.TU(a,28);Fo.TU(a,44);Fo.TU(a,26);Fo.TU(a,40);Fo.TU(a,64);Fo.TR(a,26);Fo.sH(a,1);return a.join("")};
-    local rules = js_extract( js, "[ ,]"..descrambler.."=function%([^)]*%){(.-)};",
+    -- Go=function(a){a=a.split("");Fo.sH(a,2);Fo.TU(a,28);Fo.TU(a,44);Fo.TU(a,26);Fo.TU(a,40);Fo.TU(a,64);Fo.TR(a,26);Fo.sH(a,1);return a.join("")};
+    local rules = js_extract( js, "^"..descrambler.."=function%([^)]*%){(.-)};",
                                   -- Legacy/alternate format
                                   "function "..descrambler.."%([^)]*%){(.-)}" )
     if not rules then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature descrambling rules" )
         return sig
     end
 
     -- Get the name of the helper object providing transformation definitions
     local helper = string.match( rules, ";(..)%...%(" )
     if not helper then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature transformation helper name" )
         vlc.msg.err( "Couldn't process youtube video URL, please check for updates to this script" )
         return sig
     end
@@ -130,6 +133,7 @@ function js_descramble( sig, js_url )
     -- var Fo={TR:function(a){a.reverse()},TU:function(a,b){var c=a[0];a[0]=a[b%a.length];a[b]=c},sH:function(a,b){a.splice(0,b)}};
     local transformations = js_extract( js, "[ ,]"..helper.."={(.-)};", nil )
     if not transformations then
+        vlc.msg.dbg( "Couldn't extract youtube video URL signature transformation code" )
         return sig
     end
 
@@ -257,9 +261,11 @@ function parse()
                 name = vlc.strings.resolve_xml_special_chars( name )
             end
 
-            if string.match( line, "<p id=\"eow[-]description\" >" ) then
-                _,_,description = string.find( line, "<p id=\"eow[-]description\" >(.-)<[/]p>" )
-                description = vlc.strings.resolve_xml_special_chars( description )
+            if not description then
+                description = string.match( line, "<p id=\"eow%-description\"[^>]*>(.-)</p>" )
+                if description then
+                    description = vlc.strings.resolve_xml_special_chars( description )
+                end
             end
 
 
@@ -279,6 +285,11 @@ function parse()
                 local js_url = string.match( line, "\"js\": *\"(.-)\"" )
                 if js_url then
                     js_url = string.gsub( js_url, "\\/", "/" )
+                    -- Resolve URL
+                    if string.match( js_url, "^/[^/]" ) then
+                        local authority = string.match( vlc.path, "^([^/]*)/" )
+                        js_url = "//"..authority..js_url
+                    end
                     js_url = string.gsub( js_url, "^//", vlc.access.."://" )
                 end
 
@@ -320,10 +331,11 @@ function parse()
                 else
                     format = ""
                 end
-                -- Without "el=detailpage", /get_video_info fails for many
-                -- music videos with errors about copyrighted content being
-                -- "restricted from playback on certain sites"
-                path = vlc.access.."://www.youtube.com/get_video_info?video_id="..video_id..format.."&el=detailpage"
+                -- Passing no "el" parameter to /get_video_info seems to
+                -- let it default to "embedded", and both known values
+                -- of "embedded" and "detailpage" are wrong and fail for
+                -- various restricted videos, so we pass a different value
+                path = vlc.access.."://www.youtube.com/get_video_info?video_id="..video_id..format.."&el=detail"
                 vlc.msg.warn( "Couldn't extract video URL, falling back to alternate youtube API" )
             end
         end
diff --git a/share/lua/sd/metachannels.lua b/share/lua/sd/metachannels.lua
deleted file mode 100644
index da593c4886..0000000000
--- a/share/lua/sd/metachannels.lua
+++ /dev/null
@@ -1,75 +0,0 @@
---[[
- $Id$
-
- Copyright © 2010 VideoLAN and AUTHORS
-
- Authors: Rémi Duraffort <ivoire at videolan dot org>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
---]]
-
-require "simplexml"
-
-function descriptor()
-    return { title="Channels.com" }
-end
-
-function search( string )
-    -- Do the query
-    query = string.gsub( string, ' ', '+' )
-    local feed = simplexml.parse_url( "http://www.metachannels.com/api/search?apikey=54868d5d73af69d6afa12d55db6f3d18735baa7d&searchTerms="; .. query )
-    local channel = feed.children[1]
-
-    -- List all answers
-    local node = vlc.sd.add_node( { path = "", title = string } )
-    for _,item in ipairs( channel.children ) do
-        if( item.name == 'item' ) then
-            simplexml.add_name_maps( item )
-            local url = vlc.strings.resolve_xml_special_chars( item.children_map['link'][1].children[1] )
-            local title = vlc.strings.resolve_xml_special_chars( item.children_map['title'][1].children[1] )
-            local arturl = nil
-            if item.children_map['media:thumbnail'] ~= nil then
-                arturl = vlc.strings.resolve_xml_special_chars( item.children_map['media:thumbnail'][1].attributes['url'] )
-                if( arturl == '/images/thumb_channel_default.jpg' ) then
-                    arturl = 'http://www.metachannels.com/images/thumb_channel_default.jpg'
-                end
-            end
-            node:add_subitem( { path = url, title = title, arturl = arturl } )
-        end
-    end
-end
-
-function main()
-    -- get the primary feed and parse the <channel> tag
-    local feed = simplexml.parse_url( "http://metachannels.com/meta_channels?device=vlc&lang=en,es,fr,de,it,other&format=rss&adult_ok=y"; )
-    local channel = feed.children[1]
-
-    -- list all children that are items
-    for _,item in ipairs( channel.children ) do
-        if( item.name == 'item' ) then
-            simplexml.add_name_maps( item )
-            local url = vlc.strings.resolve_xml_special_chars( item.children_map['link'][1].children[1] )
-            local title = vlc.strings.resolve_xml_special_chars( item.children_map['title'][1].children[1] )
-            local arturl = nil
-            if item.children_map['image'] ~= nil then
-                arturl = vlc.strings.resolve_xml_special_chars( item.children_map['image'][1].children_map['url'][1].children[1] )
-            end
-            local node = vlc.sd.add_item( { path = url,
-                                            title = title,
-                                            arturl = arturl } )
-        end
-    end
-end
-
diff --git a/share/vlc.desktop.in b/share/vlc.desktop.in
index 9961a90359..4052cd11d3 100644
--- a/share/vlc.desktop.in
+++ b/share/vlc.desktop.in
@@ -70,9 +70,9 @@ GenericName[ru]=Медиаплеер
 Comment[ru]=Универсальный проигрыватель видео и аудио
 Name[sk]=VLC media player
 Comment[sk]=Naèítavajte, zaznamenávajte, vysielajte svoje multimediálne streamy
-Name[sv]=Mediaspelaren VLC
-GenericName[sv]=Mediaspelaren
-Comment[sv]=Allmän uppspelare av film och musik
+Name[sv]=VLC mediaspelare
+GenericName[sv]=Mediaspelare
+Comment[sv]=Spelare för film och musik
 Name[te]=VLC మాధ్యమ ప్రదర్శకం
 GenericName[te]=మాధ్యమ ప్రదర్శకం
 Comment[te]=మీ బహుళమాధ్యమ ప్రవాహాలను చదువు, బంధించు మరియు ప్రసారం చేయి
diff --git a/src/misc/picture.c b/src/misc/picture.c
index 5854640999..a59a9aa413 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2000-2010 VLC authors and VideoLAN
  * Copyright (C) 2009-2010 Laurent Aimar
- * $Id: d7cc482c7ba7f4fa04b15755eaa65d6737cd35ce $
+ * $Id: cfc138341252069444269368deb48deb739481a2 $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -396,17 +396,26 @@ int picture_Export( vlc_object_t *p_obj,
     fmt_out.i_chroma  = i_format;
 
     /* compute original width/height */
-    unsigned int i_original_width;
-    unsigned int i_original_height;
+    unsigned int i_width, i_height, i_original_width, i_original_height;
+    if( fmt_in.i_visible_width > 0 && fmt_in.i_visible_height > 0 )
+    {
+        i_width = fmt_in.i_visible_width;
+        i_height = fmt_in.i_visible_height;
+    }
+    else
+    {
+        i_width = fmt_in.i_width;
+        i_height = fmt_in.i_height;
+    }
     if( fmt_in.i_sar_num >= fmt_in.i_sar_den )
     {
-        i_original_width = (int64_t)fmt_in.i_width * fmt_in.i_sar_num / fmt_in.i_sar_den;
-        i_original_height = fmt_in.i_height;
+        i_original_width = (int64_t)i_width * fmt_in.i_sar_num / fmt_in.i_sar_den;
+        i_original_height = i_height;
     }
     else
     {
-        i_original_width =  fmt_in.i_width;
-        i_original_height = (int64_t)fmt_in.i_height * fmt_in.i_sar_den / fmt_in.i_sar_num;
+        i_original_width =  i_width;
+        i_original_height = i_height * fmt_in.i_sar_den / fmt_in.i_sar_num;
     }
 
     /* */
@@ -418,16 +427,18 @@ int picture_Export( vlc_object_t *p_obj,
     /* scale if only one direction is provided */
     if( fmt_out.i_height == 0 && fmt_out.i_width > 0 )
     {
-        fmt_out.i_height = fmt_in.i_height * fmt_out.i_width
-                     * fmt_in.i_sar_den / fmt_in.i_width / fmt_in.i_sar_num;
+        fmt_out.i_height = i_height * fmt_out.i_width
+                         * fmt_in.i_sar_den / fmt_in.i_width / fmt_in.i_sar_num;
     }
     else if( fmt_out.i_width == 0 && fmt_out.i_height > 0 )
     {
-        fmt_out.i_width  = fmt_in.i_width * fmt_out.i_height
-                     * fmt_in.i_sar_num / fmt_in.i_height / fmt_in.i_sar_den;
+        fmt_out.i_width  = i_width * fmt_out.i_height
+                         * fmt_in.i_sar_num / fmt_in.i_height / fmt_in.i_sar_den;
     }
 
     image_handler_t *p_image = image_HandlerCreate( p_obj );
+    if( !p_image )
+        return VLC_ENOMEM;
 
     block_t *p_block = image_Write( p_image, p_picture, &fmt_in, &fmt_out );
 
diff --git a/src/playlist/fetcher.c b/src/playlist/fetcher.c
index 15e0478c6a..4387bf2894 100644
--- a/src/playlist/fetcher.c
+++ b/src/playlist/fetcher.c
@@ -2,7 +2,7 @@
  * fetcher.c: Art fetcher thread.
  *****************************************************************************
  * Copyright © 1999-2009 VLC authors and VideoLAN
- * $Id: a8b7b110176d2d5da0da32cf495c92e3a2f76544 $
+ * $Id: 93315495ea1523592e4918c108b069284b458256 $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Clément Stenac <zorglub@videolan.org>
@@ -351,7 +351,7 @@ static int DownloadArt( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
     char *psz_arturl = input_item_GetArtURL( p_item );
     assert( *psz_arturl );
 
-    if( !strncmp( psz_arturl , "file://", 7 ) )
+    if( !strncasecmp( psz_arturl , "file://", 7 ) )
     {
         msg_Dbg( p_fetcher->object,
                  "Album art is local file, no need to cache" );
diff --git a/src/playlist/preparser.c b/src/playlist/preparser.c
index f7e884b667..731ee8a2d2 100644
--- a/src/playlist/preparser.c
+++ b/src/playlist/preparser.c
@@ -2,7 +2,7 @@
  * preparser.c: Preparser thread.
  *****************************************************************************
  * Copyright © 1999-2009 VLC authors and VideoLAN
- * $Id: b44b9f8db8efcdac25f0bf51cf610f32d8ed92a8 $
+ * $Id: 63ec55355dcc5b5a45513b1dd0883f9b7389814b $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Clément Stenac <zorglub@videolan.org>
@@ -170,8 +170,8 @@ static void Art( playlist_preparser_t *p_preparser, input_item_t *p_item )
         const char *psz_arturl = vlc_meta_Get( p_item->p_meta, vlc_meta_ArtworkURL );
         const char *psz_name = vlc_meta_Get( p_item->p_meta, vlc_meta_Title );
 
-        if( !psz_arturl || ( strncmp( psz_arturl, "file://", 7 ) &&
-                             strncmp( psz_arturl, "attachment://", 13 ) ) )
+        if( !psz_arturl || ( strncasecmp( psz_arturl, "file://", 7 ) &&
+                             strncasecmp( psz_arturl, "attachment://", 13 ) ) )
         {
             msg_Dbg( obj, "meta ok for %s, need to fetch art",
                      psz_name ? psz_name : "(null)" );
diff --git a/src/revision.c b/src/revision.c
index 6731adb71b..4612da0af0 100644
--- a/src/revision.c
+++ b/src/revision.c
@@ -1 +1 @@
-const char psz_vlc_changeset[] = "2.2.3-37-g888b7e89";
+const char psz_vlc_changeset[] = "2.2.5-0-g9275f0fefa";
diff --git a/src/revision.txt b/src/revision.txt
index fceef34642..8f8c0f4216 100644
--- a/src/revision.txt
+++ b/src/revision.txt
@@ -1 +1 @@
-2.2.3-37-g888b7e89
+2.2.5-0-g9275f0fefa
diff --git a/src/text/unicode.c b/src/text/unicode.c
index 25215d7ffc..64c85734b4 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -151,7 +151,7 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc)
             break;
 
         case 4:
-            cp = (c & 0x07) << 16;
+            cp = (c & 0x07) << 18;
             break;
 
         default:
@@ -163,18 +163,18 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc)
     {
         case 4:
             c = *++ptr;
-            if (unlikely((c >> 6) != 2)) // not a continuation byte
+            if (unlikely((c & 0xC0) != 0x80)) // not a continuation byte
                 return -1;
-            cp |= (c & 0x3f) << 12;
+            cp |= (c & 0x3F) << 12;
 
             if (unlikely(cp >= 0x110000)) // beyond Unicode range
                 return -1;
             /* fall through */
         case 3:
             c = *++ptr;
-            if (unlikely((c >> 6) != 2)) // not a continuation byte
+            if (unlikely((c & 0xC0) != 0x80)) // not a continuation byte
                 return -1;
-            cp |= (c & 0x3f) << 6;
+            cp |= (c & 0x3F) << 6;
 
             if (unlikely(cp >= 0xD800 && cp < 0xE000)) // UTF-16 surrogate
                 return -1;
@@ -183,9 +183,9 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc)
             /* fall through */
         case 2:
             c = *++ptr;
-            if (unlikely((c >> 6) != 2)) // not a continuation byte
+            if (unlikely((c & 0xC0) != 0x80)) // not a continuation byte
                 return -1;
-            cp |= (c & 0x3f);
+            cp |= (c & 0x3F);
             break;
     }
 
diff --git a/test/run_vlc.sh b/test/run_vlc.sh
index 38c7d105cb..af35987dc3 100755
--- a/test/run_vlc.sh
+++ b/test/run_vlc.sh
@@ -2,7 +2,7 @@
 
 set -e
 
-VLC="./vlc --ignore-config"
+VLC="./vlc --ignore-config --rc-fake-tty"
 
 $VLC -H
 $VLC -vv vlc://quit
diff --git a/debian/changelog b/debian/changelog
index 739c269c42..4b7488b79f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+vlc (2.2.5-1) unstable; urgency=medium
+
+  * New upstream releases. (Closes: #850529)
+  * debian/patches:
+    - fix-translation.patch: Refreshed.
+    - Removed patches taken from upstream included in 2.2.5.
+  * debian/*.maintscript: Bump all versions to 2.2.5-1~z. This is necessary to
+    properly handle symlink to directory conversions once 2.2.5 is available
+    in stretch.
+
+ -- Sebastian Ramacher <sramacher@debian.org>  Sun, 19 Mar 2017 21:50:23 +0100
+
 vlc (2.2.4-14) unstable; urgency=medium
 
   [ Mateusz Łukasik ]
diff --git a/debian/libvlc-dev.maintscript b/debian/libvlc-dev.maintscript
index a447bb1d8c..5aceb56641 100644
--- a/debian/libvlc-dev.maintscript
+++ b/debian/libvlc-dev.maintscript
@@ -1,2 +1,2 @@
-symlink_to_dir /usr/share/doc/libvlc-dev libvlc5 2.2.4-1~z
-symlink_to_dir /usr/share/bug/libvlc-dev libvlc5 2.2.4-1~z
+symlink_to_dir /usr/share/doc/libvlc-dev libvlc5 2.2.5-1~z
+symlink_to_dir /usr/share/bug/libvlc-dev libvlc5 2.2.5-1~z
diff --git a/debian/libvlc5.maintscript b/debian/libvlc5.maintscript
index ea4bd92f01..f3a8313dbe 100644
--- a/debian/libvlc5.maintscript
+++ b/debian/libvlc5.maintscript
@@ -1,2 +1,2 @@
-symlink_to_dir /usr/share/doc/libvlc5 libvlccore8 2.2.4-1~z
-symlink_to_dir /usr/share/bug/libvlc5 libvlccore8 2.2.4-1~z
+symlink_to_dir /usr/share/doc/libvlc5 libvlccore8 2.2.5-1~z
+symlink_to_dir /usr/share/bug/libvlc5 libvlccore8 2.2.5-1~z
diff --git a/debian/libvlccore-dev.maintscript b/debian/libvlccore-dev.maintscript
index da57e1b233..2f1c5a6f8f 100644
--- a/debian/libvlccore-dev.maintscript
+++ b/debian/libvlccore-dev.maintscript
@@ -1,2 +1,2 @@
-symlink_to_dir /usr/share/doc/libvlccore-dev libvlccore8 2.2.4-1~z
-symlink_to_dir /usr/share/bug/libvlccore-dev libvlccore8 2.2.4-1~z
+symlink_to_dir /usr/share/doc/libvlccore-dev libvlccore8 2.2.5-1~z
+symlink_to_dir /usr/share/bug/libvlccore-dev libvlccore8 2.2.5-1~z
diff --git a/debian/libvlccore8.maintscript b/debian/libvlccore8.maintscript
index a5cec26f95..c8e0e00e7e 100644
--- a/debian/libvlccore8.maintscript
+++ b/debian/libvlccore8.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/doc/libvlccore8 vlc-data 2.2.4-1~z
+symlink_to_dir /usr/share/doc/libvlccore8 vlc-data 2.2.5-1~z
diff --git a/debian/patches/Fix-build-using-old-GCC-intrinsics.patch b/debian/patches/Fix-build-using-old-GCC-intrinsics.patch
deleted file mode 100644
index 7bfc0e6e10..0000000000
--- a/debian/patches/Fix-build-using-old-GCC-intrinsics.patch
+++ /dev/null
@@ -1,292 +0,0 @@
-From 8b0a359be21c8b66c7f7f5d34b85df3cf6689035 Mon Sep 17 00:00:00 2001
-From: Francois Cartegnie <fcvlcdev@free.fr>
-Date: Sun, 24 Jul 2016 12:59:20 +0200
-Subject: [PATCH] Fix build using old GCC intrinsics
-
-As the 2.2 headers are still using vlc_atomics (picture)
-we cannot have a way to avoid collisions with early
-or late <atomic> inclusion when using GCC >= 4.7
-
-Conditionals in vlc_atomic won't work.
-
-Happens in ProjectM and Qt5.
-
-Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
----
- modules/gui/qt4/actions_manager.cpp                |  2 ++
- modules/gui/qt4/adapters/seekpoints.cpp            |  4 +--
- modules/gui/qt4/adapters/seekpoints.hpp            |  4 +--
- modules/gui/qt4/components/controller.cpp          |  2 ++
- .../gui/qt4/components/playlist/playlist_model.hpp |  4 +--
- modules/gui/qt4/components/playlist/views.cpp      |  6 ++++
- modules/gui/qt4/dialogs/messages.cpp               |  2 ++
- modules/gui/qt4/dialogs/vlm.cpp                    |  4 ---
- modules/gui/qt4/dialogs/vlm.hpp                    |  4 ++-
- modules/gui/qt4/input_manager.cpp                  |  2 ++
- modules/gui/qt4/input_manager.hpp                  |  3 +-
- modules/gui/qt4/menus.cpp                          |  2 ++
- modules/gui/qt4/qt4.hpp                            | 32 ++++++++++++++++++----
- modules/gui/qt4/util/pictureflow.cpp               |  2 ++
- modules/visualization/projectm.cpp                 |  4 +++
- 15 files changed, 56 insertions(+), 21 deletions(-)
-
-diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
-index eff40d9..b7ca967 100644
---- a/modules/gui/qt4/actions_manager.cpp
-+++ b/modules/gui/qt4/actions_manager.cpp
-@@ -25,6 +25,8 @@
- # include "config.h"
- #endif
- 
-+#include "qt4.hpp"
-+
- #include <vlc_vout.h>
- #include <vlc_keys.h>
- 
-diff --git a/modules/gui/qt4/adapters/seekpoints.cpp b/modules/gui/qt4/adapters/seekpoints.cpp
-index fbf2957..a3564bb 100644
---- a/modules/gui/qt4/adapters/seekpoints.cpp
-+++ b/modules/gui/qt4/adapters/seekpoints.cpp
-@@ -19,14 +19,12 @@
-  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-  *****************************************************************************/
- 
-+#include "seekpoints.hpp"
- 
- #include "recents.hpp"
- #include "dialogs_provider.hpp"
- #include "menus.hpp"
- 
--#include "seekpoints.hpp"
--
--#include "qt4.hpp"
- #include "input_manager.hpp"
- 
- SeekPoints::SeekPoints( QObject *parent, intf_thread_t *p_intf_ ) :
-diff --git a/modules/gui/qt4/adapters/seekpoints.hpp b/modules/gui/qt4/adapters/seekpoints.hpp
-index 0083989..bbb9214 100644
---- a/modules/gui/qt4/adapters/seekpoints.hpp
-+++ b/modules/gui/qt4/adapters/seekpoints.hpp
-@@ -22,9 +22,7 @@
- #ifndef SEEKPOINTS_HPP
- #define SEEKPOINTS_HPP
- 
--#ifdef HAVE_CONFIG_H
--#include "config.h"
--#endif
-+#include "qt4.hpp"
- 
- #include <vlc_common.h>
- #include <vlc_interface.h>
-diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
-index d93e0db..c43d929 100644
---- a/modules/gui/qt4/components/controller.cpp
-+++ b/modules/gui/qt4/components/controller.cpp
-@@ -26,6 +26,8 @@
- # include "config.h"
- #endif
- 
-+#include "qt4.hpp"
-+
- #include <vlc_vout.h>                       /* vout_thread_t for FSC */
- 
- /* Widgets */
-diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
-index f9d1d0c..1f71ac9 100644
---- a/modules/gui/qt4/components/playlist/playlist_model.hpp
-+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
-@@ -25,9 +25,7 @@
- #ifndef _PLAYLIST_MODEL_H_
- #define _PLAYLIST_MODEL_H_
- 
--#ifdef HAVE_CONFIG_H
--# include "config.h"
--#endif
-+#include "qt4.hpp"
- 
- #include <vlc_input.h>
- #include <vlc_playlist.h>
-diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
-index 59f6535..0066205 100644
---- a/modules/gui/qt4/components/playlist/views.cpp
-+++ b/modules/gui/qt4/components/playlist/views.cpp
-@@ -21,6 +21,12 @@
-  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-  *****************************************************************************/
- 
-+#ifdef HAVE_CONFIG_H
-+#include "config.h"
-+#endif
-+
-+#include "qt4.hpp"
-+
- #include "components/playlist/views.hpp"
- #include "components/playlist/vlc_model.hpp"      /* VLCModel */
- #include "components/playlist/sorting.h"          /* Columns List */
-diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
-index 30793a2..9c79c99 100644
---- a/modules/gui/qt4/dialogs/messages.cpp
-+++ b/modules/gui/qt4/dialogs/messages.cpp
-@@ -24,6 +24,8 @@
- # include "config.h"
- #endif
- 
-+#include "qt4.hpp"
-+
- #include "dialogs/messages.hpp"
- 
- #include <QPlainTextEdit>
-diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp
-index 0da88cc..595f015 100644
---- a/modules/gui/qt4/dialogs/vlm.cpp
-+++ b/modules/gui/qt4/dialogs/vlm.cpp
-@@ -23,10 +23,6 @@
-  * Foundation, Inc., 51 Franklin street, Fifth Floor, Boston MA 02110-1301, USA.
-  *****************************************************************************/
- 
--#ifdef HAVE_CONFIG_H
--# include "config.h"
--#endif
--
- #include "dialogs/vlm.hpp"
- 
- #ifdef ENABLE_VLM
-diff --git a/modules/gui/qt4/dialogs/vlm.hpp b/modules/gui/qt4/dialogs/vlm.hpp
-index a3c6e5d..dcf7110 100644
---- a/modules/gui/qt4/dialogs/vlm.hpp
-+++ b/modules/gui/qt4/dialogs/vlm.hpp
-@@ -25,8 +25,10 @@
- #ifndef QVLC_VLM_DIALOG_H_
- #define QVLC_VLM_DIALOG_H_ 1
- 
-+#include "qt4.hpp"
-+
- #ifdef HAVE_CONFIG_H
--# include "config.h"
-+#include "config.h"
- #endif
- 
- #ifdef ENABLE_VLM
-diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
-index fd45f4a..c50cb6c 100644
---- a/modules/gui/qt4/input_manager.cpp
-+++ b/modules/gui/qt4/input_manager.cpp
-@@ -30,6 +30,8 @@
- # include "config.h"
- #endif
- 
-+#include "qt4.hpp"
-+
- #include "input_manager.hpp"
- #include "recents.hpp"
- 
-diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
-index 7d3b76a..4fbecbb 100644
---- a/modules/gui/qt4/input_manager.hpp
-+++ b/modules/gui/qt4/input_manager.hpp
-@@ -29,9 +29,10 @@
- # include "config.h"
- #endif
- 
-+#include "qt4.hpp"
-+
- #include <vlc_input.h>
- 
--#include "qt4.hpp"
- #include "util/singleton.hpp"
- #include "adapters/variables.hpp"
- 
-diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
-index 116e98c..46240b0 100644
---- a/modules/gui/qt4/menus.cpp
-+++ b/modules/gui/qt4/menus.cpp
-@@ -34,6 +34,8 @@
- # include "config.h"
- #endif
- 
-+#include "qt4.hpp"
-+
- #include <vlc_common.h>
- #include <vlc_intf_strings.h>
- #include <vlc_vout.h>                             /* vout_thread_t */
-diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
-index 44d7db6..5aec957 100644
---- a/modules/gui/qt4/qt4.hpp
-+++ b/modules/gui/qt4/qt4.hpp
-@@ -29,12 +29,7 @@
- # include "config.h"
- #endif
- 
--#include <vlc_common.h>    /* VLC_COMMON_MEMBERS for vlc_interface.h */
--#include <vlc_interface.h> /* intf_thread_t */
--#include <vlc_playlist.h>  /* playlist_t */
--
--#define QT_NO_CAST_TO_ASCII
--#include <QString>
-+#include <QtGlobal>
- 
- #if ( QT_VERSION < 0x040600 )
- # error Update your Qt version to at least 4.6.0
-@@ -43,6 +38,31 @@
- #define HAS_QT47 ( QT_VERSION >= 0x040700 )
- #define HAS_QT5  ( QT_VERSION >= 0x050000 )
- 
-+#if HAS_QT5
-+  #include <QtCore/qcompilerdetection.h>
-+  #if defined(Q_COMPILER_ATOMICS) && \
-+             ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7 ) )
-+   #define VLC_ATOMIC_H
-+   #include <atomic>
-+   using namespace std;
-+   #  define atomic_store(object,desired) \
-+      do { \
-+          *(object) = (desired); \
-+          __sync_synchronize(); \
-+      } while (0)
-+
-+   #  define atomic_load(object) \
-+       (__sync_synchronize(), *(object))
-+  #endif
-+#endif
-+
-+#include <vlc_common.h>    /* VLC_COMMON_MEMBERS for vlc_interface.h */
-+#include <vlc_interface.h> /* intf_thread_t */
-+#include <vlc_playlist.h>  /* playlist_t */
-+
-+#define QT_NO_CAST_TO_ASCII
-+#include <QString>
-+
- enum {
-     DialogEventTypeOffset = 0,
-     IMEventTypeOffset     = 100,
-diff --git a/modules/gui/qt4/util/pictureflow.cpp b/modules/gui/qt4/util/pictureflow.cpp
-index 9318953..a7e6a01 100644
---- a/modules/gui/qt4/util/pictureflow.cpp
-+++ b/modules/gui/qt4/util/pictureflow.cpp
-@@ -29,6 +29,8 @@
-   THE SOFTWARE.
- */
- 
-+#include "qt4.hpp"
-+
- #include "pictureflow.hpp"
- 
- #include <QApplication>
-diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
-index e80fbf4..96d532d 100644
---- a/modules/visualization/projectm.cpp
-+++ b/modules/visualization/projectm.cpp
-@@ -30,6 +30,10 @@
- #endif
- 
- #include <assert.h>
-+#if defined(__GNUC__) && \
-+           ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7 ) )
-+  #define VLC_ATOMIC_H /* Ensure C atomics wont collide with old intrinsics */
-+#endif
- 
- #include <vlc_common.h>
- #include <vlc_plugin.h>
--- 
-2.8.1
-
diff --git a/debian/patches/Revert-Build-default.vlt-in-a-reproducible-fashion-f.patch b/debian/patches/Revert-Build-default.vlt-in-a-reproducible-fashion-f.patch
deleted file mode 100644
index 7578484166..0000000000
--- a/debian/patches/Revert-Build-default.vlt-in-a-reproducible-fashion-f.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From d0339fa10a29e78155a9d32a9c0ecf6cfda10a4d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
-Date: Fri, 21 Oct 2016 15:56:51 +0300
-Subject: [PATCH 1/5] Revert "Build default.vlt in a reproducible fashion
- (fixes #4562)"
-
-This broke error propagation.
-
-This reverts commit ceacef3bbb0c34d67aa84e6ca91b360cbe2419e5.
-
-(cherry picked from commit 9f2f2165b7f7afa912fdf7ffbe8b3f0db51f687a)
----
- share/Makefile.am | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
---- a/share/Makefile.am
-+++ b/share/Makefile.am
-@@ -78,10 +78,7 @@
- 
- skins2/default.vlt: $(skins2_default_vlt_FILES)
- 	mkdir -p skins2
--	(cd "$(srcdir)/skins2"; find default -print0 | \
--		LC_ALL=C sort -z | \
--		tar cvv --exclude .svn --no-recursion --null -T -) | \
--	gzip -n > skins2/default.vlt
-+	tar cvvzf skins2/default.vlt -C $(srcdir)/skins2 default/
- 
- #
- # LUA
diff --git a/debian/patches/VLSub-don-t-pretend-to-support-HTTP-1.1.patch b/debian/patches/VLSub-don-t-pretend-to-support-HTTP-1.1.patch
deleted file mode 100644
index c215d8fe30..0000000000
--- a/debian/patches/VLSub-don-t-pretend-to-support-HTTP-1.1.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 4b1c65d5da017d807efea415fb3ab069945da75d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
-Date: Sun, 4 Dec 2016 14:36:29 +0200
-Subject: [PATCH] VLSub: don't pretend to support HTTP 1.1
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-(cherry picked from commit 5c26ad66d4b3b1d3de13ae778161f9ddde25cd59)
-Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
----
- share/lua/extensions/VLSub.lua | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/share/lua/extensions/VLSub.lua b/share/lua/extensions/VLSub.lua
-index ecac0030ac..cd6f7b770d 100644
---- a/share/lua/extensions/VLSub.lua
-+++ b/share/lua/extensions/VLSub.lua
-@@ -1189,7 +1189,7 @@ openSub = {
-     local request = "<?xml version='1.0'?>"..dump_xml(reqTable)
-     local host, path = parse_url(openSub.conf.url)		
-     local header = {
--      "POST "..path.." HTTP/1.1", 
-+      "POST "..path.." HTTP/1.0", 
-       "Host: "..host, 
-       "User-Agent: "..openSub.conf.userAgentHTTP, 
-       "Content-Type: text/xml", 
-@@ -1840,7 +1840,7 @@ end
- function get(url)
-   local host, path = parse_url(url)
-   local header = {
--    "GET "..path.." HTTP/1.1", 
-+    "GET "..path.." HTTP/1.0", 
-     "Host: "..host, 
-     "User-Agent: "..openSub.conf.userAgentHTTP,
-     "",
--- 
-2.11.0
-
diff --git a/debian/patches/fix-translation.patch b/debian/patches/fix-translation.patch
index 39660fd7f4..33462cef84 100644
--- a/debian/patches/fix-translation.patch
+++ b/debian/patches/fix-translation.patch
@@ -4,30 +4,30 @@ Bug-Debian: https://bugs.debian.org/814258
 
 --- a/po/mr.po
 +++ b/po/mr.po
-@@ -21589,7 +21589,7 @@
+@@ -21567,7 +21567,7 @@
  
- #: modules/gui/qt4/menus.cpp:491
+ #: modules/gui/qt4/menus.cpp:493
  msgid "Ctrl+L"
 -msgstr "कंट्रोल + एल"
 +msgstr "Ctrl+L"
  
- #: modules/gui/qt4/menus.cpp:494
+ #: modules/gui/qt4/menus.cpp:496
  msgid "Docked Playlist"
-@@ -21601,7 +21601,7 @@
+@@ -21579,7 +21579,7 @@
  
- #: modules/gui/qt4/menus.cpp:506
+ #: modules/gui/qt4/menus.cpp:508
  msgid "Ctrl+H"
 -msgstr "कंट्रोल + एच"
 +msgstr "Ctrl+H"
  
- #: modules/gui/qt4/menus.cpp:515
+ #: modules/gui/qt4/menus.cpp:517
  msgid "&Fullscreen Interface"
-@@ -21757,7 +21757,7 @@
+@@ -21735,7 +21735,7 @@
  
- #: modules/gui/qt4/menus.cpp:918
+ #: modules/gui/qt4/menus.cpp:920
  msgid "Ctrl+T"
 -msgstr "कंट्रोल + टी"
 +msgstr "Ctrl+T"
  
- #: modules/gui/qt4/menus.cpp:933
+ #: modules/gui/qt4/menus.cpp:935
  msgid "Open &Network..."
diff --git a/debian/patches/series b/debian/patches/series
index 683cccfab7..f4e8490e21 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,12 +1,2 @@
 fix-translation.patch
 generated-mimetypes.patch
-vlc_atomic-atomic_compare_exchange_weak_explicit-tak.patch
-vlc_atomic-atomic_compare_exchange_strong_explicit-t.patch
-Fix-build-using-old-GCC-intrinsics.patch
-video_splliter-Add-XCB-flags-for-panoramix.patch
-Revert-Build-default.vlt-in-a-reproducible-fashion-f.patch
-skins2-do-not-save-user-and-group-names-in-the-defau.patch
-skins-remove-timestamp-from-default.vlt-fixes-4562.patch
-skins-implement-silent-mode-make.patch
-skins2-do-not-generate-broken-default.vlt-on-error.patch
-VLSub-don-t-pretend-to-support-HTTP-1.1.patch
diff --git a/debian/patches/skins-implement-silent-mode-make.patch b/debian/patches/skins-implement-silent-mode-make.patch
deleted file mode 100644
index 13621bc2b5..0000000000
--- a/debian/patches/skins-implement-silent-mode-make.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 43f830f9e81e2534c42496005391104005cab6d6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
-Date: Fri, 21 Oct 2016 16:05:02 +0300
-Subject: [PATCH 4/5] skins: implement silent mode make
-
-(cherry picked from commit 0bdddcb8dcebe18cecfeed5805ceaaf50432a658)
----
- share/Makefile.am | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/share/Makefile.am
-+++ b/share/Makefile.am
-@@ -77,8 +77,8 @@
- 	skins2/default/subX/vol_slider.png
- 
- skins2/default.vlt: $(skins2_default_vlt_FILES)
--	mkdir -p skins2
--	GZIP=--no-name \
-+	$(AM_V_at)mkdir -p skins2
-+	$(AM_V_GEN)GZIP=--no-name \
- 	tar cvvzf skins2/default.vlt \
- 		--owner=root --group=root --directory="$(srcdir)/skins2" \
- 		default/
diff --git a/debian/patches/skins-remove-timestamp-from-default.vlt-fixes-4562.patch b/debian/patches/skins-remove-timestamp-from-default.vlt-fixes-4562.patch
deleted file mode 100644
index 8667d8ca3b..0000000000
--- a/debian/patches/skins-remove-timestamp-from-default.vlt-fixes-4562.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-From 75b4a84c0b7061807f13a734331287d24dd46ffe Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
-Date: Fri, 21 Oct 2016 16:04:21 +0300
-Subject: [PATCH 3/5] skins: remove timestamp from default.vlt (fixes #4562)
-
-(cherry picked from commit 7b4bcf17d1f493c2d49f74ff573591e662a03924)
----
- share/Makefile.am | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/share/Makefile.am
-+++ b/share/Makefile.am
-@@ -78,6 +78,7 @@
- 
- skins2/default.vlt: $(skins2_default_vlt_FILES)
- 	mkdir -p skins2
-+	GZIP=--no-name \
- 	tar cvvzf skins2/default.vlt \
- 		--owner=root --group=root --directory="$(srcdir)/skins2" \
- 		default/
diff --git a/debian/patches/skins2-do-not-generate-broken-default.vlt-on-error.patch b/debian/patches/skins2-do-not-generate-broken-default.vlt-on-error.patch
deleted file mode 100644
index ecf8026322..0000000000
--- a/debian/patches/skins2-do-not-generate-broken-default.vlt-on-error.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 953263bf5839054b162fe114db6b132521747bf7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
-Date: Fri, 21 Oct 2016 16:08:25 +0300
-Subject: [PATCH 5/5] skins2: do not generate (broken) default.vlt on error
-
-(cherry picked from commit 096c3544b55a88ca07ece9a5624671484e362945)
----
- share/Makefile.am | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/share/Makefile.am
-+++ b/share/Makefile.am
-@@ -78,10 +78,12 @@
- 
- skins2/default.vlt: $(skins2_default_vlt_FILES)
- 	$(AM_V_at)mkdir -p skins2
-+	$(AM_V_at)rm -f -- skins2/default.vlt.tmp
- 	$(AM_V_GEN)GZIP=--no-name \
--	tar cvvzf skins2/default.vlt \
-+	tar cvvzf skins2/default.vlt.tmp \
- 		--owner=root --group=root --directory="$(srcdir)/skins2" \
- 		default/
-+	$(AM_V_at)mv -f -- skins2/default.vlt.tmp skins2/default.vlt
- 
- #
- # LUA
diff --git a/debian/patches/skins2-do-not-save-user-and-group-names-in-the-defau.patch b/debian/patches/skins2-do-not-save-user-and-group-names-in-the-defau.patch
deleted file mode 100644
index fb73a043e8..0000000000
--- a/debian/patches/skins2-do-not-save-user-and-group-names-in-the-defau.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From cac50d90bae28f7125a46422cc6d497f316c9ad6 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
-Date: Fri, 21 Oct 2016 15:35:18 +0300
-Subject: [PATCH 2/5] skins2: do not save user and group names in the default
- skin
-
-(cherry picked from commit 79bed730df73ff241545e4ffe85ed293bf52adc1)
----
- share/Makefile.am | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/share/Makefile.am
-+++ b/share/Makefile.am
-@@ -78,7 +78,9 @@
- 
- skins2/default.vlt: $(skins2_default_vlt_FILES)
- 	mkdir -p skins2
--	tar cvvzf skins2/default.vlt -C $(srcdir)/skins2 default/
-+	tar cvvzf skins2/default.vlt \
-+		--owner=root --group=root --directory="$(srcdir)/skins2" \
-+		default/
- 
- #
- # LUA
diff --git a/debian/patches/video_splliter-Add-XCB-flags-for-panoramix.patch b/debian/patches/video_splliter-Add-XCB-flags-for-panoramix.patch
deleted file mode 100644
index ba26788e7b..0000000000
--- a/debian/patches/video_splliter-Add-XCB-flags-for-panoramix.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From a854dc7108cdb70b5f58a1232868c74ad3620c99 Mon Sep 17 00:00:00 2001
-From: Vinson Lee <vlee@freedesktop.org>
-Date: Sat, 20 Aug 2016 06:02:27 +0000
-Subject: [PATCH] video_splliter: Add XCB flags for panoramix.
-
-This patch fixes this build error.
-
-video_splitter/.libs/libpanoramix_plugin_la-panoramix.o: In function `CountMonitors':
-modules/video_splitter/panoramix.c:352: undefined reference to `xcb_connect'
-modules/video_splitter/panoramix.c:354: undefined reference to `xcb_connection_has_error'
-modules/video_splitter/panoramix.c:357: undefined reference to `xcb_get_setup'
-modules/video_splitter/panoramix.c:359: undefined reference to `xcb_setup_roots_iterator'
-modules/video_splitter/panoramix.c:360: undefined reference to `xcb_screen_next'
-modules/video_splitter/panoramix.c:407: undefined reference to `xcb_disconnect'
-modules/video_splitter/panoramix.c:407: undefined reference to `xcb_disconnect'
-modules/video_splitter/panoramix.c:407: undefined reference to `xcb_disconnect'
-
-Signed-off-by: Vinson Lee <vlee@freedesktop.org>
-Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
----
- modules/video_splitter/Makefile.am | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules/video_splitter/Makefile.am b/modules/video_splitter/Makefile.am
-index da32c52..ffeb94e 100644
---- a/modules/video_splitter/Makefile.am
-+++ b/modules/video_splitter/Makefile.am
-@@ -15,8 +15,8 @@ if HAVE_WIN32_DESKTOP
- splitter_LTLIBRARIES += libpanoramix_plugin.la
- else
- if HAVE_XCB_RANDR
--libpanoramix_plugin_la_CFLAGS += $(XCB_RANDR_CFLAGS)
--libpanoramix_plugin_la_LIBADD += $(XCB_RANDR_LIBS)
-+libpanoramix_plugin_la_CFLAGS += $(XCB_RANDR_CFLAGS) $(XCB_CFLAGS)
-+libpanoramix_plugin_la_LIBADD += $(XCB_RANDR_LIBS) $(XCB_LIBS)
- splitter_LTLIBRARIES += libpanoramix_plugin.la
- endif
- endif
--- 
-2.9.3
-
diff --git a/debian/patches/vlc_atomic-atomic_compare_exchange_strong_explicit-t.patch b/debian/patches/vlc_atomic-atomic_compare_exchange_strong_explicit-t.patch
deleted file mode 100644
index 5ba1a8309b..0000000000
--- a/debian/patches/vlc_atomic-atomic_compare_exchange_strong_explicit-t.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From ec34ff174f04d1e81c939ed0325a0073c6f68fce Mon Sep 17 00:00:00 2001
-From: Francois Cartegnie <fcvlcdev@free.fr>
-Date: Fri, 22 Jul 2016 13:37:15 +0200
-Subject: [PATCH 2/2] vlc_atomic: atomic_compare_exchange_strong_explicit takes
- 5 parameters
-
-Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
----
- include/vlc_atomic.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/vlc_atomic.h b/include/vlc_atomic.h
-index 01e0f85..15ccf8c 100644
---- a/include/vlc_atomic.h
-+++ b/include/vlc_atomic.h
-@@ -152,7 +152,7 @@ typedef         uintmax_t atomic_uintmax_t;
- #  define atomic_compare_exchange_strong(object,expected,desired) \
-     atomic_compare_exchange(object, expected, desired)
- 
--#  define atomic_compare_exchange_strong_explicit(object,expected,desired,order) \
-+#  define atomic_compare_exchange_strong_explicit(object,expected,desired,order,order_different) \
-     atomic_compare_exchange_strong(object, expected, desired)
- 
- #  define atomic_compare_exchange_weak(object,expected,desired) \
--- 
-2.8.1
-
diff --git a/debian/patches/vlc_atomic-atomic_compare_exchange_weak_explicit-tak.patch b/debian/patches/vlc_atomic-atomic_compare_exchange_weak_explicit-tak.patch
deleted file mode 100644
index 2c07fc78d8..0000000000
--- a/debian/patches/vlc_atomic-atomic_compare_exchange_weak_explicit-tak.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From ce8cc916ab43e12b85abd6a1b850f1ccf43319c8 Mon Sep 17 00:00:00 2001
-From: Steve Lhomme <robux4@videolabs.io>
-Date: Fri, 22 Jul 2016 13:37:14 +0200
-Subject: [PATCH 1/2] vlc_atomic: atomic_compare_exchange_weak_explicit takes 5
- parameters
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
-Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
----
- include/vlc_atomic.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/include/vlc_atomic.h b/include/vlc_atomic.h
-index af88eab..01e0f85 100644
---- a/include/vlc_atomic.h
-+++ b/include/vlc_atomic.h
-@@ -158,7 +158,7 @@ typedef         uintmax_t atomic_uintmax_t;
- #  define atomic_compare_exchange_weak(object,expected,desired) \
-     atomic_compare_exchange(object, expected, desired)
- 
--#  define atomic_compare_exchange_weak_explicit(object,expected,desired,order) \
-+#  define atomic_compare_exchange_weak_explicit(object,expected,desired,order_equal,order_different) \
-     atomic_compare_exchange_weak(object, expected, desired)
- 
- #  define atomic_fetch_add(object,operand) \
--- 
-2.8.1
-
diff --git a/debian/vlc-nox.maintscript b/debian/vlc-nox.maintscript
index 5e113756d0..7e77d19ed2 100644
--- a/debian/vlc-nox.maintscript
+++ b/debian/vlc-nox.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-nox libvlccore8 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-nox libvlccore8 2.2.5-1~z
diff --git a/debian/vlc-plugin-fluidsynth.maintscript b/debian/vlc-plugin-fluidsynth.maintscript
index 135d2800b2..c2aa1c64f5 100644
--- a/debian/vlc-plugin-fluidsynth.maintscript
+++ b/debian/vlc-plugin-fluidsynth.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-plugin-fluidsynth vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-plugin-fluidsynth vlc-nox 2.2.5-1~z
diff --git a/debian/vlc-plugin-jack.maintscript b/debian/vlc-plugin-jack.maintscript
index 3c96a2fe05..079f1da619 100644
--- a/debian/vlc-plugin-jack.maintscript
+++ b/debian/vlc-plugin-jack.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-plugin-jack vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-plugin-jack vlc-nox 2.2.5-1~z
diff --git a/debian/vlc-plugin-notify.maintscript b/debian/vlc-plugin-notify.maintscript
index 06919b9140..438ea009b2 100644
--- a/debian/vlc-plugin-notify.maintscript
+++ b/debian/vlc-plugin-notify.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-plugin-notify vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-plugin-notify vlc-nox 2.2.5-1~z
diff --git a/debian/vlc-plugin-samba.maintscript b/debian/vlc-plugin-samba.maintscript
index e47487ddf4..8fe6b8ca5d 100644
--- a/debian/vlc-plugin-samba.maintscript
+++ b/debian/vlc-plugin-samba.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-plugin-samba vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-plugin-samba vlc-nox 2.2.5-1~z
diff --git a/debian/vlc-plugin-sdl.maintscript b/debian/vlc-plugin-sdl.maintscript
index 16e15c75fa..6b8aadb78a 100644
--- a/debian/vlc-plugin-sdl.maintscript
+++ b/debian/vlc-plugin-sdl.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-plugin-sdl vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-plugin-sdl vlc-nox 2.2.5-1~z
diff --git a/debian/vlc-plugin-svg.maintscript b/debian/vlc-plugin-svg.maintscript
index ee3ce687ba..5405592099 100644
--- a/debian/vlc-plugin-svg.maintscript
+++ b/debian/vlc-plugin-svg.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-plugin-svg vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-plugin-svg vlc-nox 2.2.5-1~z
diff --git a/debian/vlc-plugin-zvbi.maintscript b/debian/vlc-plugin-zvbi.maintscript
index b577b49cfc..455516ea60 100644
--- a/debian/vlc-plugin-zvbi.maintscript
+++ b/debian/vlc-plugin-zvbi.maintscript
@@ -1 +1 @@
-symlink_to_dir /usr/share/bug/vlc-plugin-zvbi vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/bug/vlc-plugin-zvbi vlc-nox 2.2.5-1~z
diff --git a/debian/vlc.maintscript b/debian/vlc.maintscript
index bfbacba313..08f8d63e53 100644
--- a/debian/vlc.maintscript
+++ b/debian/vlc.maintscript
@@ -1,2 +1,2 @@
-symlink_to_dir /usr/share/doc/vlc vlc-nox 2.2.4-1~z
-symlink_to_dir /usr/share/bug/vlc vlc-nox 2.2.4-1~z
+symlink_to_dir /usr/share/doc/vlc vlc-nox 2.2.5-1~z
+symlink_to_dir /usr/share/bug/vlc vlc-nox 2.2.5-1~z

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Sebastian Ramacher:
> Package: release.debian.org
> Severity: normal
> User: release.debian.org@packages.debian.org
> Usertags: unblock
> 
> Similarly to what we have done for jessie, I'd like to keep vlc up-to-date with
> the current stable branch during the lifetime of stretch. So please unblock
> package vlc 2.2.5-1. This upstream release is the next bug fix release in vlc's
> 2.2.x series. Most importantly, it fixes various integer and buffer overflows,
> NULL pointer dereferences, division by zero errors, heap corruptions that can be
> triggered during playback.
> 
> Note that the next bug fix release 2.2.5.1 is expected to be released soon. But
> until that happens I'd like to get 2.2.5 into stretch.
> 
> The upstream changelog is:
> 
> [...]
> 
> unblock vlc/2.2.5-1
> 
> Cheers
> 

Unblocked, thanks.

~Niels

--- End Message ---

Reply to: