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

Bug#783355: marked as done (jessie-pu: package vlc/2.2.1-1~deb8u1)



Your message dated Sat, 23 Jan 2016 13:57:15 +0000
with message-id <1453557435.1835.52.camel@adam-barratt.org.uk>
and subject line 8.3 point release cleanup
has caused the Debian Bug report #783355,
regarding jessie-pu: package vlc/2.2.1-1~deb8u1
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.)


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

I'd like to update vlc in jessie to the latest bug fix release in the 2.2.X
series: 2.2.1. It includes fixes for potential NULL dereferences, crashes when
playing FLAC and SPC files

The Debian changelog is:

vlc (2.2.1-1~deb8u1) jessie; urgency=medium

  [ Sebastian Ramacher ]
  * New upstream release.
  * debian/patches: Remove patches, no longer needed.

  [ Benjamin Drung ]
  * drop/rules: Drop removed --enable-glx configure flag.

 -- Sebastian Ramacher <sramacher@debian.org>  Sat, 25 Apr 2015 23:00:04 +0200


Upstream's changelog is:

Changes between 2.2.0 and 2.2.1:
--------------------------------

Codec:
 * Fix compilation with older libavcodec versions
 * Fix some VP9 decoding
 * Fix flac crashes
 * Fix lpcm channel ordering
 * Fix potential NULL dereference in dmo
 * Fix teletext framing code in DVB PES packets
 * Fix potential buffer overflow in schroendinger decoder
 * Fix AAC samplerate

Demuxers:
 * Fix MP4 chapters
 * Fix MKV overseeking, introducing slowness over network shares
 * Fix crash when playing SPC files
 * Fix ATRAC3 playback in MKV
 * Revert to older ASX code
 * Workaround TS issue with mpeg-audio

Access:
 * Fix sftp read and close sockets
 * Fix DTV build with Linux DVB versions < 5.8
 * Fix UDP/RTP input on Windows

Audio output:
 * Fix Alsa HDMI plugs
 * Improve Alsa output, with larger buffers
 * Fix DirectSound output with multi-channel files

OS X:
 * Fix numerous crashes in the UI
 * Fix video-wallpaper mode
 * Fix race when starting VLC from command line

Qt:
 * Fix recent items behaviour
 * Fix rotation filter activation
 * Fix mux modules names for the streaming wizard

Win32:
 * Timestamp the signature of the dlls
 * Fix extensions registration during install
 * Fix extensions dialog crash
 * Default to no DxVA decoding

libVLC:
 * fix libvlc_media_get_stats

Translations:
 * Update of Afrikaans, Albanian, Azerbaijani, Catalan, Czech, Danish, Dutch,
   English (United Kingdom), Finnish, French, German, Hebrew, Hindi, Italian,
   Japanese, Korean, Latvian, Macedonian, Malay, Modern Greek, Norwegian Bokmål,
   Norwegian Nynorsk, Polish, Portuguese, Russian, Scottish Gaelic, Serbian,
   Simplified Chinese, Slovak, Slovenian, Spanish, Swedish, Tamil, Thai,
   Traditional Chinese, Turkish, Ukrainian translations


A filtered debdiff is attached. I've removed the following parts from the
debdiff for easier review:

 AUTHORS                                            |   171 +-
 NEWS                                               |    86 +-
 THANKS                                             |    45 +-
 ChangeLog                                          | 20701 ++-----------
 doc/ChangeLog-2004                                 |     7 -
 doc/ChangeLog-2005                                 |    19 -
 doc/ChangeLog-2007                                 |    12 -
 doc/ChangeLog-2008                                 |    90 -
 doc/ChangeLog-2010                                 |    27 -
 doc/ChangeLog-2013                                 |    20 -
 doc/ChangeLog-2014                                 |  1135 +-
 doc/ChangeLog-2015                                 |  3077 ++
 share/lua/README.txt                               |     6 +-

Changelog, documentation, news, etc.

 contrib/src/ass/SHA512SUMS                         |     2 +-
 contrib/src/ass/rules.mak                          |     2 +-
 contrib/src/bluray/SHA512SUMS                      |     2 +-
 contrib/src/bluray/rules.mak                       |    26 +-
 contrib/src/cddb/getenv-crash.patch                |     3 +-
 contrib/src/dca/rules.mak                          |     1 +
 contrib/src/directx/rules.mak                      |     2 +-
 contrib/src/dvdcss/SHA512SUMS                      |     2 +-
 contrib/src/dvdcss/rules.mak                       |     2 +-
 contrib/src/dvdnav/SHA512SUMS                      |     2 +-
 contrib/src/dvdnav/rules.mak                       |     6 +-
 contrib/src/dvdread/SHA512SUMS                     |     2 +-
 contrib/src/dvdread/dvdread-win32.patch            |    13 -
 contrib/src/dvdread/rules.mak                      |     9 +-
 contrib/src/ebml/SHA512SUMS                        |     2 +-
 contrib/src/ebml/ebml-pic.patch                    |    22 -
 contrib/src/ebml/no-ansi.patch                     |    11 -
 contrib/src/ebml/rules.mak                         |    13 +-
 contrib/src/ffmpeg/rules.mak                       |    24 +-
 contrib/src/flac/SHA512SUMS                        |     2 +-
 contrib/src/flac/rules.mak                         |     9 +-
 contrib/src/freetype2/SHA512SUMS                   |     2 +-
 contrib/src/freetype2/rules.mak                    |     2 +-
 contrib/src/gettext/SHA512SUMS                     |     2 +-
 contrib/src/gettext/rules.mak                      |     2 +-
 contrib/src/gme/rules.mak                          |     1 +
 contrib/src/gme/skip-underrun.patch                |    11 +
 contrib/src/gnutls/SHA512SUMS                      |     2 +-
 contrib/src/gnutls/rules.mak                       |     2 +-
 contrib/src/gpg-error/SHA512SUMS                   |     2 +-
 contrib/src/gpg-error/rules.mak                    |     2 +-
 contrib/src/harfbuzz/disable-backends.patch        |    27 +
 contrib/src/harfbuzz/harfbuzz-clang.patch          |    16 +
 contrib/src/harfbuzz/rules.mak                     |     2 +
 contrib/src/libxml2/SHA512SUMS                     |     2 +-
 contrib/src/libxml2/pthread.patch                  |     6 +-
 contrib/src/libxml2/rules.mak                      |     2 +-
 contrib/src/libxml2/win32.patch                    |     6 +-
 contrib/src/main.mak                               |    25 +-
 contrib/src/matroska/SHA512SUMS                    |     2 +-
 contrib/src/matroska/matroska-pic.patch            |    22 -
 contrib/src/matroska/rules.mak                     |    12 +-
 contrib/src/png/SHA512SUMS                         |     2 +-
 contrib/src/png/rules.mak                          |     2 +-
 contrib/src/qt/Win32-AOT.patch                     |    11 +
 contrib/src/qt/rules.mak                           |    18 +-
 contrib/src/qt4/QtCore.pc.in                       |    10 +
 contrib/src/qt4/QtGui.pc.in                        |    10 +
 contrib/src/qt4/SHA512SUMS                         |     1 +
 contrib/src/qt4/chroot.patch                       |    13 +
 contrib/src/qt4/cross.patch                        |    18 +
 contrib/src/qt4/fix_header.sh                      |     5 +
 contrib/src/qt4/imageformats.patch                 |    14 +
 contrib/src/qt4/rules.mak                          |    75 +
 contrib/src/qt4/styles.patch                       |    11 +
 contrib/src/qt4/win64.patch                        |    11 +
 contrib/src/speex/SHA512SUMS                       |     1 +
 contrib/src/speex/rules.mak                        |    21 +-
 contrib/src/speexdsp/SHA512SUMS                    |     1 +
 contrib/src/speexdsp/rules.mak                     |    16 +-
 contrib/src/ssh2/configure-zlib.patch              |    10 +
 contrib/src/ssh2/gpg-error-pc.patch                |    11 +
 contrib/src/ssh2/rules.mak                         |     4 +-
 contrib/src/vorbis/SHA512SUMS                      |     2 +-
 contrib/src/vorbis/osx.patch                       |    13 -
 contrib/src/vorbis/rules.mak                       |     3 +-
 contrib/src/x264/rules.mak                         |    18 +-
 contrib/src/x265/rules.mak                         |     1 +

Not used in Debian.

 multiple Makefile.in files
 aclocal.m4                                         |    71 +-
 autotools/compile                                  |     2 +-
 autotools/config.guess                             |   173 +-
 autotools/config.sub                               |    36 +-
 autotools/depcomp                                  |     2 +-
 autotools/install-sh                               |   366 +-
 autotools/ltmain.sh                                |  5495 ++--
 autotools/missing                                  |     2 +-
 autotools/test-driver                              |    15 +-
 configure                                          |  3221 +-
 m4/libtool.m4                                      |  2554 +-
 m4/ltoptions.m4                                    |   127 +-
 m4/ltsugar.m4                                      |     7 +-
 m4/ltversion.m4                                    |    12 +-
 m4/lt~obsolete.m4                                  |     7 +-

autotools cruft, re-generated during build.

 .../macosx/Resources/English.lproj/Bookmarks.xib   |   932 +-
 .../macosx/Resources/English.lproj/MainMenu.xib    |  2099 +-
 bin/darwinvlc.c                                    |     8 +-
 bin/vlc_win32_rc.rc.in                             |     2 +-
 bin/winvlc.c                                       |     3 +-
 compat/freeaddrinfo.c                              |    46 +
 extras/analyser/zsh_completion.sh                  |     2 +-
 extras/package/ios/build.sh                        |     2 +-
 extras/package/macosx/build.sh                     |     4 +-
 extras/package/win32/NSIS/languages/danish.nsh     |    52 +-
 extras/package/win32/NSIS/languages/dutch.nsh      |     2 +-
 extras/package/win32/NSIS/languages/estonian.nsh   |    99 +-
 extras/package/win32/NSIS/languages/finnish.nsh    |    88 +-
 extras/package/win32/NSIS/languages/italian.nsh    |     4 +-
 extras/package/win32/NSIS/vlc.win32.nsi.in         |    29 +-
 extras/package/win32/package.mak                   |    27 +-
 extras/tools/bootstrap                             |     3 +-
 extras/tools/packages.mak                          |     3 +-
 modules/access/dshow/vlc_dshow.h                   |     3 +-
 modules/access/qtsound.m                           |     2 +
 modules/audio_output/audiounit_ios.c               |     4 +-
 modules/audio_output/auhal.c                       |     3 +-
 modules/audio_output/directsound.c                 |    18 +-
 modules/audio_output/sndio.c                       |     2 +-
 modules/codec/avcodec/dxva2.c                      |     6 +-
 modules/codec/omxil/android_mediacodec.c           |    59 +-
 modules/gui/macosx/AddonManager.m                  |     4 +
 modules/gui/macosx/MainMenu.h                      |     6 +-
 modules/gui/macosx/MainMenu.m                      |    44 +-
 modules/gui/macosx/VLCVoutWindowController.m       |     4 +-
 modules/gui/macosx/Windows.m                       |     8 +-
 modules/gui/macosx/bookmarks.h                     |     4 +-
 modules/gui/macosx/bookmarks.m                     |    17 +-
 modules/gui/macosx/coredialogs.h                   |     5 +-
 modules/gui/macosx/coredialogs.m                   |    19 +-
 modules/gui/macosx/intf.m                          |    87 +-
 modules/gui/macosx/misc.h                          |     4 +-
 modules/gui/macosx/misc.m                          |    30 +-
 modules/gui/macosx/open.m                          |    19 +-
 modules/gui/macosx/playlist.h                      |     5 +-
 modules/gui/macosx/playlist.m                      |   113 +-
 modules/gui/macosx/playlistinfo.h                  |     3 +-
 modules/gui/macosx/playlistinfo.m                  |    10 +-
 modules/gui/macosx/prefs.m                         |     3 +-
 modules/gui/macosx/simple_prefs.m                  |    29 +-
 modules/gui/qt4/main_interface_win32.cpp           |     9 +-
 modules/video_output/ios2.m                        |     5 +-
 modules/video_output/kva.c                         |     8 +-
 modules/video_output/msw/events.c                  |    10 +-
 modules/video_output/msw/win32touch.c              |    13 +-
 src/libvlc_win32_rc.rc.in                          |     2 +-
 src/misc/messages.c                                |    47 +-
 src/os2/getaddrinfo.c                              |    13 -
 src/os2/thread.c                                   |     4 +-
 src/revision.txt                                   |     2 +-
 src/win32/filesystem.c                             |    37 +
 src/win32/plugin.c                                 |     2 +-
 src/win32/thread.c                                 |     5 +-

MacOS X, Windows and OS/2 only changes

 po/LINGUAS                                         |     1 +
 po/POTFILES.in                                     |     1 +
 po/ach.gmo                                         |   Bin 56389 -> 56389 bytes
 po/ach.po                                          |  1433 +-
 po/af.gmo                                          |   Bin 50471 -> 106260 bytes
 po/af.po                                           | 10752 +++----
 po/am.gmo                                          |   Bin 72968 -> 72968 bytes
 po/am.po                                           |  1439 +-
 po/an.gmo                                          |   Bin 462610 -> 462524 bytes
 po/an.po                                           |  1438 +-
 po/ar.gmo                                          |   Bin 310202 -> 312132 bytes
 po/ar.po                                           |  1843 +-
 po/ast.gmo                                         |   Bin 465587 -> 465501 bytes
 po/ast.po                                          |  1436 +-
 po/az.gmo                                          |   Bin 2828 -> 6611 bytes
 po/az.po                                           |  1685 +-
 po/be.gmo                                          |   Bin 750883 -> 750014 bytes
 po/be.po                                           |  1454 +-
 po/bg.gmo                                          |   Bin 616686 -> 625802 bytes
 po/bg.po                                           |  2777 +-
 po/bn.gmo                                          |   Bin 666107 -> 666570 bytes
 po/bn.po                                           |  1668 +-
 po/bn_IN.gmo                                       |   Bin 795286 -> 795177 bytes
 po/bn_IN.po                                        |  1438 +-
 po/br.gmo                                          |   Bin 80105 -> 80105 bytes
 po/br.po                                           |  1434 +-
 po/bs.gmo                                          |   Bin 150691 -> 150691 bytes
 po/bs.po                                           |  1433 +-
 po/ca.gmo                                          |   Bin 626578 -> 629223 bytes
 po/ca.po                                           |  1755 +-
 po/cgg.gmo                                         |   Bin 41805 -> 41805 bytes
 po/cgg.po                                          |  1439 +-
 po/ckb.gmo                                         |   Bin 86646 -> 86646 bytes
 po/ckb.po                                          |  1439 +-
 po/co.gmo                                          |   Bin 702 -> 702 bytes
 po/co.po                                           |  1436 +-
 po/cs.gmo                                          |   Bin 247877 -> 250968 bytes
 po/cs.po                                           |  1626 +-
 po/cy.gmo                                          |   Bin 273706 -> 275108 bytes
 po/cy.po                                           |  1637 +-
 po/da.gmo                                          |   Bin 355725 -> 542975 bytes
 po/da.po                                           |  9437 +++---
 po/de.gmo                                          |   Bin 630339 -> 630466 bytes
 po/de.po                                           |  1943 +-
 po/el.gmo                                          |   Bin 876106 -> 876127 bytes
 po/el.po                                           |  1869 +-
 po/en_GB.gmo                                       |   Bin 38113 -> 38150 bytes
 po/en_GB.po                                        | 13032 +++-----
 po/es.gmo                                          |   Bin 631720 -> 631813 bytes
 po/es.po                                           |  1951 +-
 po/es_MX.gmo                                       |   Bin 0 -> 609767 bytes
 po/es_MX.po                                        | 30466 +++++++++++++++++++
 po/et.gmo                                          |   Bin 465021 -> 464943 bytes
 po/et.po                                           |  1436 +-
 po/eu.gmo                                          |   Bin 524208 -> 524121 bytes
 po/eu.po                                           |  1438 +-
 po/fa.gmo                                          |   Bin 166587 -> 166587 bytes
 po/fa.po                                           |  1432 +-
 po/ff.gmo                                          |   Bin 83518 -> 83518 bytes
 po/ff.po                                           |  1434 +-
 po/fi.gmo                                          |   Bin 548988 -> 564515 bytes
 po/fi.po                                           |  2214 +-
 po/fr.gmo                                          |   Bin 574002 -> 603699 bytes
 po/fr.po                                           |  2382 +-
 po/fur.gmo                                         |   Bin 38868 -> 38868 bytes
 po/fur.po                                          |  1444 +-
 po/ga.gmo                                          |   Bin 142398 -> 142398 bytes
 po/ga.po                                           |  1434 +-
 po/gd.gmo                                          |   Bin 188678 -> 188817 bytes
 po/gd.po                                           |  1601 +-
 po/gl.gmo                                          |   Bin 624131 -> 623483 bytes
 po/gl.po                                           |  1451 +-
 po/gu.gmo                                          |   Bin 68470 -> 68470 bytes
 po/gu.po                                           |  1434 +-
 po/he.gmo                                          |   Bin 230850 -> 235099 bytes
 po/he.po                                           |  1740 +-
 po/hi.gmo                                          |   Bin 147173 -> 148141 bytes
 po/hi.po                                           |  2143 +-
 po/hr.gmo                                          |   Bin 556190 -> 557604 bytes
 po/hr.po                                           |  9667 +++---
 po/hu.gmo                                          |   Bin 619989 -> 642057 bytes
 po/hu.po                                           |  3101 +-
 po/hy.gmo                                          |   Bin 136327 -> 136327 bytes
 po/hy.po                                           |  1462 +-
 po/ia.gmo                                          |   Bin 11156 -> 11156 bytes
 po/ia.po                                           |  1430 +-
 po/id.gmo                                          |   Bin 424094 -> 423448 bytes
 po/id.po                                           |  1451 +-
 po/is.gmo                                          |   Bin 160136 -> 193862 bytes
 po/is.po                                           |  2659 +-
 po/it.gmo                                          |   Bin 602623 -> 616381 bytes
 po/it.po                                           |  2506 +-
 po/ja.gmo                                          |   Bin 701687 -> 701691 bytes
 po/ja.po                                           |  1895 +-
 po/ka.gmo                                          |   Bin 58831 -> 58831 bytes
 po/ka.po                                           |  1439 +-
 po/kk.gmo                                          |   Bin 230816 -> 230816 bytes
 po/kk.po                                           |  1434 +-
 po/km.gmo                                          |   Bin 1014463 -> 1013405 bytes
 po/km.po                                           |  1449 +-
 po/kn.gmo                                          |   Bin 821528 -> 828863 bytes
 po/kn.po                                           |  1723 +-
 po/ko.gmo                                          |   Bin 634276 -> 634374 bytes
 po/ko.po                                           |  1908 +-
 po/ky.gmo                                          |   Bin 38916 -> 38916 bytes
 po/ky.po                                           |  1430 +-
 po/lg.gmo                                          |   Bin 55254 -> 55254 bytes
 po/lg.po                                           |  1439 +-
 po/lt.gmo                                          |   Bin 337843 -> 337765 bytes
 po/lt.po                                           |  1436 +-
 po/lv.gmo                                          |   Bin 614505 -> 633688 bytes
 po/lv.po                                           |  3130 +-
 po/mk.gmo                                          |   Bin 6589 -> 10685 bytes
 po/mk.po                                           |  3180 +-
 po/ml.gmo                                          |   Bin 37334 -> 37334 bytes
 po/ml.po                                           |  1431 +-
 po/mn.gmo                                          |   Bin 81038 -> 81038 bytes
 po/mn.po                                           |  1433 +-
 po/mr.gmo                                          |   Bin 200901 -> 202286 bytes
 po/mr.po                                           |  1629 +-
 po/ms.gmo                                          |   Bin 598131 -> 598210 bytes
 po/ms.po                                           |  1877 +-
 po/my.gmo                                          |   Bin 14938 -> 14938 bytes
 po/my.po                                           |  1431 +-
 po/nb.gmo                                          |   Bin 154338 -> 155223 bytes
 po/nb.po                                           |  1733 +-
 po/ne.gmo                                          |   Bin 362536 -> 362536 bytes
 po/ne.po                                           |  1436 +-
 po/nl.gmo                                          |   Bin 614941 -> 615096 bytes
 po/nl.po                                           |  1915 +-
 po/nn.gmo                                          |   Bin 103407 -> 106953 bytes
 po/nn.po                                           | 18715 +++++-------
 po/oc.gmo                                          |   Bin 144661 -> 144661 bytes
 po/oc.po                                           |  1438 +-
 po/or.gmo                                          |   Bin 25522 -> 25522 bytes
 po/or.po                                           |  1432 +-
 po/pa.gmo                                          |   Bin 281763 -> 285002 bytes
 po/pa.po                                           |  1727 +-
 po/pl.gmo                                          |   Bin 627350 -> 627387 bytes
 po/pl.po                                           |  1927 +-
 po/ps.gmo                                          |   Bin 43029 -> 43029 bytes
 po/ps.po                                           |  1439 +-
 po/pt_BR.gmo                                       |   Bin 543866 -> 543713 bytes
 po/pt_BR.po                                        |  1436 +-
 po/pt_PT.gmo                                       |   Bin 610661 -> 626665 bytes
 po/pt_PT.po                                        |  6497 ++--
 po/ro.gmo                                          |   Bin 422173 -> 422085 bytes
 po/ro.po                                           |  1435 +-
 po/ru.gmo                                          |   Bin 797827 -> 797880 bytes
 po/ru.po                                           |  1890 +-
 po/si.gmo                                          |   Bin 281852 -> 281700 bytes
 po/si.po                                           |  1437 +-
 po/sk.gmo                                          |   Bin 652637 -> 652009 bytes
 po/sk.po                                           |  2663 +-
 po/sl.gmo                                          |   Bin 433349 -> 591404 bytes
 po/sl.po                                           |  5242 ++--
 po/sq.gmo                                          |   Bin 66278 -> 68648 bytes
 po/sq.po                                           |  1849 +-
 po/sr.gmo                                          |   Bin 352757 -> 359617 bytes
 po/sr.po                                           |  1912 +-
 po/sv.gmo                                          |   Bin 448628 -> 450072 bytes
 po/sv.po                                           |  1830 +-
 po/ta.gmo                                          |   Bin 86711 -> 117944 bytes
 po/ta.po                                           |  2770 +-
 po/te.gmo                                          |   Bin 148086 -> 148086 bytes
 po/te.po                                           |  1433 +-
 po/tet.gmo                                         |   Bin 484 -> 484 bytes
 po/tet.po                                          |  1437 +-
 po/th.gmo                                          |   Bin 355364 -> 357980 bytes
 po/th.po                                           |  1577 +-
 po/tl.gmo                                          |   Bin 461 -> 461 bytes
 po/tl.po                                           |  1437 +-
 po/tr.gmo                                          |   Bin 638386 -> 638439 bytes
 po/tr.po                                           |  1922 +-
 po/uk.gmo                                          |   Bin 807736 -> 807785 bytes
 po/uk.po                                           |  1755 +-
 po/uz.gmo                                          |   Bin 36548 -> 57612 bytes
 po/uz.po                                           |  2401 +-
 po/vi.gmo                                          |   Bin 556892 -> 556892 bytes
 po/vi.po                                           |  1433 +-
 po/vlc.pot                                         |  1430 +-
 po/wa.gmo                                          |   Bin 286829 -> 286724 bytes
 po/wa.po                                           |  1437 +-
 po/zh_CN.gmo                                       |   Bin 570252 -> 570709 bytes
 po/zh_CN.po                                        |  2377 +-
 po/zh_TW.gmo                                       |   Bin 269691 -> 272035 bytes
 po/zh_TW.po                                        |  1554 +-
 po/zu.gmo                                          |   Bin 61515 -> 61515 bytes
 po/zu.po                                           |  1439 +-

Translation updates.


Cheers
-- 
Sebastian Ramacher
diff --git a/Makefile.am b/Makefile.am
index 9c02881..b66c21b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -106,7 +106,7 @@ AUTOMAKE_OPTIONS = \
 ChangeLog: Makefile.am
 	rm -f -- "$@"
 	cd doc && $(MAKE) $(AM_MAKEFLAGS) changelogs
-	$(LN_S) -f doc/ChangeLog-2014 "$@"
+	$(LN_S) -f doc/ChangeLog-2015 "$@"
 
 ###############################################################################
 # Mac OS X project
diff --git a/bin/vlc.c b/bin/vlc.c
index 5d7a0f1..7f07c10 100644
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -2,7 +2,7 @@
  * vlc.c: the VLC player
  *****************************************************************************
  * Copyright (C) 1998-2013 the VideoLAN team
- * $Id: 2e133345e44f2a53dfb6b18d4b078da055c6ac09 $
+ * $Id: e0deebe474e2d2b96ed9d18fdd46b4d9816aec58 $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -201,12 +201,11 @@ int main( int i_argc, const char *ppsz_argv[] )
     pthread_t self = pthread_self ();
     pthread_sigmask (SIG_SETMASK, &set, NULL);
 
-    const char *argv[i_argc + 3];
+    const char *argv[i_argc + 2];
     int argc = 0;
 
     argv[argc++] = "--no-ignore-config";
     argv[argc++] = "--media-library";
-    argv[argc++] = "--stats";
     ppsz_argv++; i_argc--; /* skip executable path */
 
 #ifdef __OS2__
diff --git a/configure.ac b/configure.ac
index b309ba1..121e8c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,20 +1,20 @@
 dnl Autoconf settings for vlc
 
-AC_COPYRIGHT([Copyright 2002-2014 VLC authors and VideoLAN])
+AC_COPYRIGHT([Copyright 1999-2015 VLC authors and VideoLAN])
 
-AC_INIT(vlc, 2.2.0-rc2)
+AC_INIT(vlc, 2.2.1)
 VERSION_MAJOR=2
 VERSION_MINOR=2
-VERSION_REVISION=0
+VERSION_REVISION=1
 VERSION_EXTRA=0
-VERSION_DEV=rc2
+VERSION_DEV=
 
 PKGDIR="vlc"
 AC_SUBST(PKGDIR)
 
 CONFIGURE_LINE="`echo "$0 $ac_configure_args" | sed -e 's/\\\/\\\\\\\/g'`"
-CODENAME="Weatherwax"
-COPYRIGHT_YEARS="1996-2014"
+CODENAME="Terry Pratchett (Weatherwax)"
+COPYRIGHT_YEARS="1996-2015"
 
 AC_CONFIG_SRCDIR(src/libvlc.c)
 AC_CONFIG_AUX_DIR(autotools)
@@ -293,6 +293,7 @@ case "${host_os}" in
   *os2*)
     SYS=os2
     LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
+    AC_LIBOBJ([freeaddrinfo])
     ;;
   *)
     SYS="${host_os}"
@@ -605,8 +606,8 @@ AC_SEARCH_LIBS(connect, [socket], [
 ])
 
 AC_SEARCH_LIBS([inet_pton], [nsl], [
- AS_IF([test "$ac_cv_search_getaddrinfo" != "none required"], [
-    SOCKET_LIBS="$ac_cv_search_getaddrinfo $SOCKET_LIBS"
+ AS_IF([test "$ac_cv_search_inet_pton" != "none required"], [
+    SOCKET_LIBS="$ac_cv_search_inet_pton $SOCKET_LIBS"
   ])
 ],, [${SOCKET_LIBS}])
 
@@ -1719,7 +1720,7 @@ dnl
 dnl  libsmbclient plugin
 dnl
 PKG_ENABLE_MODULES_VLC([SMBCLIENT], [smb], [smbclient], (SMB/CIFS support), [auto])
-AS_IF([test "${SYS}" = "mingw32"], [ VLC_ADD_PLUGIN([access_smb]) ])
+AS_IF([test "${SYS}" = "mingw32"], [ VLC_ADD_PLUGIN([smb]) ])
 
 
 dnl
@@ -3101,10 +3102,6 @@ AC_ARG_ENABLE(xvideo,
   [  --enable-xvideo         XVideo support (default enabled)],, [
     enable_xvideo="$enable_xcb"
 ])
-AC_ARG_ENABLE(glx,
-  [  --enable-glx            OpenGL support through GLX (default enabled)],, [
-  enable_glx="$enable_xcb"
-])
 
 have_xcb="no"
 have_xcb_keysyms="no"
diff --git a/debian/changelog b/debian/changelog
index 49bdb60..653be3d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+vlc (2.2.1-1~deb8u1) jessie; urgency=medium
+
+  [ Sebastian Ramacher ]
+  * New upstream release.
+  * debian/patches: Remove patches, no longer needed.
+
+  [ Benjamin Drung ]
+  * drop/rules: Drop removed --enable-glx configure flag.
+
+ -- Sebastian Ramacher <sramacher@debian.org>  Sat, 25 Apr 2015 23:00:04 +0200
+
 vlc (2.2.0~rc2-2) unstable; urgency=medium
 
   * debian/patches: Apply upstream patches for security vulnerabilities.
diff --git a/debian/gbp.conf b/debian/gbp.conf
index 1695316..690a843 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -2,6 +2,7 @@
 debian-branch = master
 pristine-tar = True
 compression = xz
+debian-branch = jessie
 
 [git-dch]
 meta = True
diff --git a/debian/patches/codec-schroedinger-fix-potential-buffer-overflow.patch b/debian/patches/codec-schroedinger-fix-potential-buffer-overflow.patch
deleted file mode 100644
index 31502ad..0000000
--- a/debian/patches/codec-schroedinger-fix-potential-buffer-overflow.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: Fabian Yamaguchi <fyamagu@gwdg.de>
-Subject: [PATCH] codec: schroedinger: fix potential buffer overflow.
- The variable len is a raw 32 bit value read using GetDWBE. If this
- value is larger than UINT32_MAX - sizeof(eos), this will cause an
- integer overflow in the subsequent call to malloc, and finally a
- buffer overflow when calling memcpy. We fix this by checking len
- accordingly.
-Origin: upstream, http://git.videolan.org/?p=vlc.git;a=commitdiff;h=9bb0353a5c63a7f8c6fc853faa3df4b4df1f5eb5
-Bug-Debian: https://bugs.debian.org/775866
-Last-Update: 2015-01-21
-
-diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c
-index f48aa2b..977afca 100644
---- a/modules/codec/schroedinger.c
-+++ b/modules/codec/schroedinger.c
-@@ -1548,6 +1548,10 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
-                      * is appended to the sequence header to allow guard
-                      * against poor streaming servers */
-                     /* XXX, should this be done using the packetizer ? */
-+
-+                    if( len > UINT32_MAX - sizeof( eos ) )
-+                        return NULL;
-+
-                     p_enc->fmt_out.p_extra = malloc( len + sizeof( eos ) );
-                     if( !p_enc->fmt_out.p_extra )
-                         return NULL;
--- 
-2.1.4
-
diff --git a/debian/patches/demux-mp4-fix-buffer-overflow-in-parsing-of-string-b.patch b/debian/patches/demux-mp4-fix-buffer-overflow-in-parsing-of-string-b.patch
deleted file mode 100644
index 3ae498d..0000000
--- a/debian/patches/demux-mp4-fix-buffer-overflow-in-parsing-of-string-b.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Fabian Yamaguchi <fyamagu@gwdg.de>
-Subject: [PATCH] demux: mp4: fix buffer overflow in parsing of string boxes.
- We ensure that pbox->i_size is never smaller than 8 to avoid an
- integer underflow in the third argument of the subsequent call to
- memcpy. We also make sure no truncation occurs when passing values
- derived from the 64 bit integer p_box->i_size to arguments of malloc
- and memcpy that may be 32 bit integers on 32 bit platforms.
-Origin: upstream, http://git.videolan.org/?p=vlc/vlc-2.2.git;a=commitdiff;h=914462405f8e90d9b2b1184ff047fdfb1f800b48
-Bug-Debian: https://bugs.debian.org/775866
-Last-Update: 2015-01-21
-
-diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
-index 19e84d3..3912e7e 100644
---- a/modules/demux/mp4/libmp4.c
-+++ b/modules/demux/mp4/libmp4.c
-@@ -2667,6 +2667,9 @@ static int MP4_ReadBox_name( stream_t *p_stream, MP4_Box_t *p_box )
- {
-     MP4_READBOX_ENTER( MP4_Box_data_name_t );
- 
-+    if( p_box->i_size < 8 || p_box->i_size > SIZE_MAX )
-+        MP4_READBOX_EXIT( 0 );
-+
-     p_box->data.p_name->psz_text = malloc( p_box->i_size + 1 - 8 ); /* +\0, -name, -size */
-     if( p_box->data.p_name->psz_text == NULL )
-         MP4_READBOX_EXIT( 0 );
--- 
-2.1.4
-
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 80613b4..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,3 +0,0 @@
-codec-schroedinger-fix-potential-buffer-overflow.patch
-demux-mp4-fix-buffer-overflow-in-parsing-of-string-b.patch
-stream_out-rtp-don-t-use-VLA-for-user-controlled-dat.patch
diff --git a/debian/patches/stream_out-rtp-don-t-use-VLA-for-user-controlled-dat.patch b/debian/patches/stream_out-rtp-don-t-use-VLA-for-user-controlled-dat.patch
deleted file mode 100644
index 9148092..0000000
--- a/debian/patches/stream_out-rtp-don-t-use-VLA-for-user-controlled-dat.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: Fabian Yamaguchi <fyamagu@gwdg.de>
-Subject: [PATCH] stream_out: rtp: don't use VLA for user controlled data
- It should fix a possible invalid memory access
- .
- When streaming ogg-files via rtp, an ogg-file can trigger an invalid
- write access using an overly long 'configuration' string.
- .
- The original code attemps to allocate space to hold the string on the stack
- and hence, cannot verify if allocation succeeds. Instead, we now allocate the
- buffer on the heap and return if allocation fails.
- .
- In detail, rtp_packetize_xiph_config allocates a buffer on the stack at (1) where
- the size depends on the local variable 'len'. The variable 'len' is
- calculated at (0) to be the length of a string contained in a specially
- crafted Ogg Vorbis file, and therefore, it is attacker-controlled.
-Origin: upstream, http://git.videolan.org/?p=vlc/vlc-2.2.git;a=commitdiff;h=3199c5dd837bc641962e9c1c8d0cd2d7c9b8bb37
-Bug-Debian: https://bugs.debian.org/775866
-Last-Update: 2015-01-21
-
-diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c
-index baee82a..ff7ea10 100644
---- a/modules/stream_out/rtpfmt.c
-+++ b/modules/stream_out/rtpfmt.c
-@@ -557,7 +557,11 @@ int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
-     char *end = strchr(start, ';');
-     assert(end != NULL);
-     size_t len = end - start;
--    char b64[len + 1];
-+
-+    char *b64 = malloc(len + 1);
-+    if(!b64)
-+        return VLC_EGENERIC;
-+
-     memcpy(b64, start, len);
-     b64[len] = '\0';
- 
-@@ -567,6 +571,7 @@ int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
-     int i_data;
- 
-     i_data = vlc_b64_decode_binary(&p_orig, b64);
-+    free(b64);
-     if (i_data <= 9)
-     {
-         free(p_orig);
--- 
-2.1.4
-
diff --git a/debian/rules b/debian/rules
index 247bfdc..dc9ce6d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -61,7 +61,6 @@ confflags += \
 	--enable-fribidi \
 	--enable-gles1 \
 	--enable-gles2 \
-	--enable-glx \
 	--enable-gnutls \
 	--enable-jack \
 	--enable-kate \
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 3397728..b8b6d6a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -37,6 +37,7 @@ CHANGELOGS = \
 	ChangeLog-2012 \
 	ChangeLog-2013 \
 	ChangeLog-2014 \
+	ChangeLog-2015 \
 	$(NULL)
 
 man1_MANS = \
@@ -84,7 +85,7 @@ $(CHANGELOGS): Makefile.am
 	fi
 
 # This one needs to be rebuilt all the time :)
-.PHONY: ChangeLog-2014 changelogs doc
+.PHONY: ChangeLog-2015 changelogs doc
 
 changelogs: $(CHANGELOGS)
 
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index c3d5fac..997f600 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -341,6 +341,18 @@ long nrand48 (unsigned short subi[3]);
 
 #ifdef __OS2__
 # undef HAVE_FORK   /* Implementation of fork() is imperfect on OS/2 */
+
+struct addrinfo
+{
+    int ai_flags;
+    int ai_family;
+    int ai_socktype;
+    int ai_protocol;
+    size_t ai_addrlen;
+    struct sockaddr *ai_addr;
+    char *ai_canonname;
+    struct addrinfo *ai_next;
+};
 #endif
 
 /* math.h */
@@ -349,4 +361,8 @@ long nrand48 (unsigned short subi[3]);
 #define nanf(tagp) NAN
 #endif
 
+#ifdef _WIN32
+FILE *vlc_win32_tmpfile(void);
+#endif
+
 #endif /* !LIBVLC_FIXUPS_H */
diff --git a/include/vlc_input_item.h b/include/vlc_input_item.h
index 2f0aca4..8dd17a8 100644
--- a/include/vlc_input_item.h
+++ b/include/vlc_input_item.h
@@ -2,7 +2,7 @@
  * vlc_input_item.h: Core input item
  *****************************************************************************
  * Copyright (C) 1999-2009 VLC authors and VideoLAN
- * $Id: bc5b2e5250e1019f827e4e181b267b3fdee13b69 $
+ * $Id: f4eb4bb23416e1b7ed774b447c5948b3086f9cfe $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -200,6 +200,17 @@ VLC_API void input_item_SetDuration( input_item_t * p_i, mtime_t i_duration );
 VLC_API bool input_item_IsPreparsed( input_item_t *p_i );
 VLC_API bool input_item_IsArtFetched( input_item_t *p_i );
 
+static inline char *input_item_GetNowPlayingFb( input_item_t *p_item )
+{
+    char *psz_meta = input_item_GetMeta( p_item, vlc_meta_NowPlaying );
+    if( !psz_meta || strlen( psz_meta ) == 0 )
+    {
+        free( psz_meta );
+        return input_item_GetMeta( p_item, vlc_meta_ESNowPlaying );
+    }
+    return psz_meta;
+}
+
 #define INPUT_META( name ) \
 static inline \
 void input_item_Set ## name (input_item_t *p_input, const char *val) \
@@ -225,6 +236,7 @@ INPUT_META(Setting)
 INPUT_META(URL)
 INPUT_META(Language)
 INPUT_META(NowPlaying)
+INPUT_META(ESNowPlaying)
 INPUT_META(Publisher)
 INPUT_META(EncodedBy)
 INPUT_META(ArtworkURL)
diff --git a/include/vlc_meta.h b/include/vlc_meta.h
index acd99ab..75cf8b3 100644
--- a/include/vlc_meta.h
+++ b/include/vlc_meta.h
@@ -2,7 +2,7 @@
  * vlc_meta.h: Stream meta-data
  *****************************************************************************
  * Copyright (C) 2004 VLC authors and VideoLAN
- * $Id: c3bf801e11201513ab8133c76f134db7baffcbf6 $
+ * $Id: 4292095290d804f6e22303de88ecae86be983fc0 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -45,6 +45,7 @@ typedef enum vlc_meta_type_t
     vlc_meta_URL,
     vlc_meta_Language,
     vlc_meta_NowPlaying,
+    vlc_meta_ESNowPlaying,
     vlc_meta_Publisher,
     vlc_meta_EncodedBy,
     vlc_meta_ArtworkURL,
@@ -57,7 +58,7 @@ typedef enum vlc_meta_type_t
     vlc_meta_Actors,
 } vlc_meta_type_t;
 
-#define VLC_META_TYPE_COUNT 23
+#define VLC_META_TYPE_COUNT 24
 
 #define ITEM_PREPARSED       1
 #define ITEM_ARTURL_FETCHED  2
diff --git a/include/vlc_network.h b/include/vlc_network.h
index 76027b8..3461c9f 100644
--- a/include/vlc_network.h
+++ b/include/vlc_network.h
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2002-2005 VLC authors and VideoLAN
  * Copyright © 2006-2007 Rémi Denis-Courmont
- * $Id: d1c63b1e76dbf462062cb6c1a36b2c8c7fd4427a $
+ * $Id: 70281a229d0acf031b71e0d22ac0a08be0712c68 $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -239,18 +239,6 @@ VLC_API ssize_t net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *,
 #  define NI_DGRAM       0x10
 # endif
 
-struct addrinfo
-{
-    int ai_flags;
-    int ai_family;
-    int ai_socktype;
-    int ai_protocol;
-    size_t ai_addrlen;
-    struct sockaddr *ai_addr;
-    char *ai_canonname;
-    struct addrinfo *ai_next;
-};
-
 # define AI_PASSIVE     1
 # define AI_CANONNAME   2
 # define AI_NUMERICHOST 4
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 00435cb..d3f021b 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -391,7 +391,24 @@ struct vlc_cleanup_t
 #ifndef LIBVLC_USE_PTHREAD_CANCEL
 /* poll() with cancellation */
 # ifdef __OS2__
-int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout);
+static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
+{
+    static int (*vlc_poll_os2)(struct pollfd *, unsigned, int) = NULL;
+
+    if (!vlc_poll_os2)
+    {
+        HMODULE hmod;
+        CHAR szFailed[CCHMAXPATH];
+
+        if (DosLoadModule(szFailed, sizeof(szFailed), "vlccore", &hmod))
+            return -1;
+
+        if (DosQueryProcAddr(hmod, 0, "_vlc_poll_os2", (PFN *)&vlc_poll_os2))
+            return -1;
+    }
+
+    return (*vlc_poll_os2)(fds, nfds, timeout);
+}
 # else
 static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
 {
diff --git a/lib/audio.c b/lib/audio.c
index 4a71560..759d0f4 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -2,7 +2,7 @@
  * libvlc_audio.c: New libvlc audio control API
  *****************************************************************************
  * Copyright (C) 2006 VLC authors and VideoLAN
- * $Id: 15d9d985d14e8afd009dd8402fecff51cda2f451 $
+ * $Id: c919eb20585a1f54fc1ed520d411eac4d314206c $
  *
  * Authors: Filippo Carone <filippo@carone.org>
  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
@@ -146,7 +146,7 @@ libvlc_audio_output_device_enum( libvlc_media_player_t *mp )
     if( aout == NULL )
         return NULL;
 
-    libvlc_audio_output_device_t *list = NULL, **pp = &list;
+    libvlc_audio_output_device_t *list, **pp = &list;
     char **values, **texts;
 
     int n = aout_DevicesList( aout, &values, &texts );
@@ -173,6 +173,7 @@ libvlc_audio_output_device_enum( libvlc_media_player_t *mp )
     free( texts );
     free( values );
 err:
+    *pp = NULL;
     return list;
 }
 
diff --git a/lib/media.c b/lib/media.c
index b80486d..ceabfdc 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -2,7 +2,7 @@
  * media.c: Libvlc API media descripor management
  *****************************************************************************
  * Copyright (C) 2007 VLC authors and VideoLAN
- * $Id: 1f6fb9e8a1283add3aaee094114586f00beb30b9 $
+ * $Id: c2a4ef5ec684bcbde288e595a46b12d7a5ee07db $
  *
  * Authors: Pierre d'Herbemont <pdherbemont@videolan.org>
  *
@@ -86,6 +86,7 @@ static const libvlc_meta_t vlc_to_libvlc_meta[] =
     [vlc_meta_URL]          = libvlc_meta_URL,
     [vlc_meta_Language]     = libvlc_meta_Language,
     [vlc_meta_NowPlaying]   = libvlc_meta_NowPlaying,
+    [vlc_meta_ESNowPlaying] = libvlc_meta_NowPlaying,
     [vlc_meta_Publisher]    = libvlc_meta_Publisher,
     [vlc_meta_EncodedBy]    = libvlc_meta_EncodedBy,
     [vlc_meta_ArtworkURL]   = libvlc_meta_ArtworkURL,
@@ -491,12 +492,22 @@ libvlc_media_get_mrl( libvlc_media_t * p_md )
 
 char *libvlc_media_get_meta( libvlc_media_t *p_md, libvlc_meta_t e_meta )
 {
-    char *psz_meta = input_item_GetMeta( p_md->p_input_item,
-                                         libvlc_to_vlc_meta[e_meta] );
-    /* Should be integrated in core */
-    if( psz_meta == NULL && e_meta == libvlc_meta_Title
-     && p_md->p_input_item->psz_name != NULL )
-        psz_meta = strdup( p_md->p_input_item->psz_name );
+    char *psz_meta = NULL;
+
+    if( e_meta == libvlc_meta_NowPlaying )
+    {
+        psz_meta = input_item_GetNowPlayingFb( p_md->p_input_item );
+    }
+    else
+    {
+        psz_meta = input_item_GetMeta( p_md->p_input_item,
+                                             libvlc_to_vlc_meta[e_meta] );
+
+        /* Should be integrated in core */
+        if( psz_meta == NULL && e_meta == libvlc_meta_Title
+            && p_md->p_input_item->psz_name != NULL )
+            psz_meta = strdup( p_md->p_input_item->psz_name );
+    }
 
     return psz_meta;
 }
diff --git a/lib/media_list.c b/lib/media_list.c
index 258b7c0..e89ec62 100644
--- a/lib/media_list.c
+++ b/lib/media_list.c
@@ -2,7 +2,7 @@
  * media_list.c: libvlc new API media list functions
  *****************************************************************************
  * Copyright (C) 2007 VLC authors and VideoLAN
- * $Id: 1d5702539eace11e9bbb47d469f99b123fe0faaa $
+ * $Id: 39bc354b0cd5fcc57f3c645d10c07f402f044f53 $
  *
  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  *
@@ -220,6 +220,7 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
     }
 
     vlc_mutex_destroy( &p_mlist->object_lock );
+    vlc_mutex_destroy( &p_mlist->refcount_lock );
     vlc_array_clear( &p_mlist->items );
 
     free( p_mlist );
diff --git a/lib/media_player.c b/lib/media_player.c
index b75006a..b4a5f10 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -440,6 +440,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     var_Create (mp, "deinterlace-mode", VLC_VAR_STRING);
 
     var_Create (mp, "vbi-page", VLC_VAR_INTEGER);
+    var_SetInteger (mp, "vbi-page", 100);
 
     var_Create (mp, "marq-marquee", VLC_VAR_STRING);
     var_Create (mp, "marq-color", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST
index db5820e..d43d1f4 100644
--- a/modules/MODULES_LIST
+++ b/modules/MODULES_LIST
@@ -249,6 +249,7 @@ $Id$
  * opus: a opus audio decoder/packetizer/encoder using the libopus library
  * os2drive: service discovery for OS/2 drives
  * oss: audio output module using the OSS /dev/dsp interface
+ * packetizer_avparser: libavcodec packetizer
  * packetizer_copy: Simple copy packetizer
  * packetizer_dirac: Dirac video packetizer
  * packetizer_flac: FLAC audio packetizer
diff --git a/modules/access/cdda.c b/modules/access/cdda.c
index ebe4f5f..8da083d 100644
--- a/modules/access/cdda.c
+++ b/modules/access/cdda.c
@@ -2,7 +2,7 @@
  * cdda.c : CD digital audio input module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2003-2006, 2008-2009 VLC authors and VideoLAN
- * $Id: c93995bb81c29b18bfe5300207d9f8ad112042f4 $
+ * $Id: 1958867378139e1fde75970e0bee7e4e47e59ed3 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -652,11 +652,12 @@ static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sector
         goto error;
     }
 
-    int64_t i_length = 0;
+    int64_t i_length = 2000000; /* PreGap */
     for( int i = 0; i < i_titles; i++ )
     {
         cddb_track_t *t = cddb_track_new();
-        cddb_track_set_frame_offset( t, p_sectors[i] );
+        cddb_track_set_frame_offset( t, p_sectors[i] + 150 );  /* Pregap offset */
+
         cddb_disc_add_track( p_disc, t );
         const int64_t i_size = ( p_sectors[i+1] - p_sectors[i] ) *
                                (int64_t)CDDA_DATA_SIZE;
diff --git a/modules/access/dcp/dcpparser.cpp b/modules/access/dcp/dcpparser.cpp
old mode 100644
new mode 100755
index 1482d43..b37015c
--- a/modules/access/dcp/dcpparser.cpp
+++ b/modules/access/dcp/dcpparser.cpp
@@ -248,7 +248,6 @@ int AssetMap::Parse ( )
         }
     }
 
-
     /* Look for PKLs path */
     if ( (_p_asset_list == NULL) ||  (_p_asset_list->size() == 0) ) {
         msg_Err( p_demux, "Asset list empty" );
@@ -423,27 +422,41 @@ int Asset::Parse( xml_reader_t *p_xmlReader, string p_node, int p_type)
                             switch(_tag) {
                                 /* Case of complex nodes */
                                 case ASSET_PACKING_LIST:
-                                    /* case of <PackinkList/> tag, bur not compliant with SMPTE-429-9 2007*/
+                                    /* case of <PackingList/> tag, bur not compliant with SMPTE-429-9 2007*/
                                     if (xml_ReaderIsEmptyElement( p_xmlReader))
+                                    {
                                         this->b_is_packing_list = true;
+                                    }
                                     else if ( XmlFile::ReadEndNode( this->p_demux, p_xmlReader, node, type, s_value ) )
+                                    {
+                                        msg_Err(this->p_demux, "Missing end node in %s", node.c_str());
                                         return -1;
+                                    }
                                     if ( s_value == "true" )
                                         this->b_is_packing_list = true;
                                     break;
                                 case ASSET_CHUNK_LIST:
                                     if ( this->parseChunkList(p_xmlReader, node, type ) )
+                                    {
+                                        msg_Err(this->p_demux, "Error parsing chunk list: %s", node.c_str());
                                         return -1;
+                                    }
                                     this->s_path = this->chunk_vec[0].getPath();
                                     break;
                                 case ASSET_ID:
                                     if ( XmlFile::ReadEndNode( this->p_demux, p_xmlReader, node, type, s_value ) )
+                                    {
+                                        msg_Err(this->p_demux, "Missing end node in %s", node.c_str());
                                         return -1;
+                                    }
                                     this->s_id = s_value;
                                     break;
                                 case ASSET_ANNOTATION_TEXT:
                                     if ( XmlFile::ReadEndNode( this->p_demux, p_xmlReader, node, type, s_value ) )
+                                    {
+                                        msg_Err(this->p_demux, "Missing end node in %s", node.c_str());
                                         return -1;
+                                    }
                                     this->s_annotation = s_value;
                                     break;
                                 case ASSET_ORIGINAL_FILENAME:
@@ -453,7 +466,7 @@ int Asset::Parse( xml_reader_t *p_xmlReader, string p_node, int p_type)
                                     /* Asset tags not in AssetMap */
                                     break;
                                 default:
-                                    msg_Warn(this->p_demux, "Unknow ASSET_TAG: %i", _tag );
+                                    msg_Warn(this->p_demux, "Unknown ASSET_TAG: %i", _tag );
                                     break;
                             }
                             /* break the for loop as a tag is found*/
@@ -461,10 +474,14 @@ int Asset::Parse( xml_reader_t *p_xmlReader, string p_node, int p_type)
                         }
                     }
                     if( _tag == ASSET_UNKNOWN )
+                    {
+                        msg_Err(this->p_demux, "Unknown ASSET_TAG: %s", node.c_str());
                         return -1;
+                    }
                     break;
                 }
             case XML_READER_TEXT:
+                msg_Err(this->p_demux, " Text element found in Asset");
                 return -1;
             case XML_READER_ENDELEM:
                 if ( node != s_root_node) {
@@ -668,6 +685,7 @@ int AssetMap::ParseAssetList (xml_reader_t *p_xmlReader, const string p_node, in
                 if ( unlikely(asset == NULL) )
                     return -1;
                 if (asset->Parse(p_xmlReader, node, type)){
+                    msg_Err(this->p_demux, "Error parsing Asset in AssetMap");
                     delete asset;
                     return -1;
                 }
@@ -766,14 +784,15 @@ int XmlFile::ReadEndNode( demux_t *p_demux, xml_reader_t *p_xmlReader, string p_
     if (p_type != XML_READER_STARTELEM)
         return -1;
 
-    if( XmlFile::ReadNextNode( p_demux, p_xmlReader, node ) == XML_READER_TEXT )
+    int n = XmlFile::ReadNextNode( p_demux, p_xmlReader, node );
+    if( n == XML_READER_TEXT )
     {
         s_value = node;
-        if( ( XmlFile::ReadNextNode( p_demux, p_xmlReader, node ) == XML_READER_ENDELEM ) &&
-                node == p_node)
+        n = XmlFile::ReadNextNode( p_demux, p_xmlReader, node );
+        if( ( n == XML_READER_ENDELEM ) && node == p_node)
             return 0;
     }
-    return -1;
+    return n == XML_READER_ENDELEM ? 0 : -1;
 }
 /*
  * Reads first node in XML and returns
diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 95b1dd7..f7d3bef 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -151,6 +151,8 @@ static const char *const hierarchy_user[] = { N_("Automatic"),
 #define TIME_INTERLEAVING_B_TEXT N_("Layer B time interleaving")
 #define TIME_INTERLEAVING_C_TEXT N_("Layer C time interleaving")
 
+#define STREAM_ID_TEXT N_("Stream identifier")
+
 #define PILOT_TEXT N_("Pilot")
 
 #define ROLLOFF_TEXT N_("Roll-off factor")
@@ -301,7 +303,7 @@ vlc_module_begin ()
         change_integer_list (hierarchy_vlc, hierarchy_user)
         change_safe ()
     add_integer ("dvb-plp-id", 0, PLP_ID_TEXT, PLP_ID_TEXT, false)
-        change_integer_range (0, 0xFFFFFFFF)
+        change_integer_range (0, 255)
         change_safe ()
 
     set_section (N_("ISDB-T reception parameters"), NULL)
@@ -358,6 +360,9 @@ vlc_module_begin ()
         change_safe ()
 
     set_section (N_("DVB-S2 parameters"), NULL)
+    add_integer ("dvb-stream", 0, STREAM_ID_TEXT, STREAM_ID_TEXT, false)
+        change_integer_range (0, 255)
+        change_safe ()
     add_integer ("dvb-pilot", -1, PILOT_TEXT, PILOT_TEXT, true)
         change_integer_list (auto_off_on_vlc, auto_off_on_user)
         change_safe ()
@@ -872,8 +877,9 @@ static int dvbs2_setup (vlc_object_t *obj, dvb_device_t *dev, uint64_t freq)
     uint32_t srate = var_InheritInteger (obj, "dvb-srate");
     int pilot = var_InheritInteger (obj, "dvb-pilot");
     int rolloff = var_InheritInteger (obj, "dvb-rolloff");
+    uint8_t sid = var_InheritInteger (obj, "dvb-stream");
 
-    int ret = dvb_set_dvbs2 (dev, freq, mod, srate, fec, pilot, rolloff);
+    int ret = dvb_set_dvbs2 (dev, freq, mod, srate, fec, pilot, rolloff, sid);
     if (ret == 0)
         sec_setup (obj, dev, freq);
     return ret;
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index ae3d306..3ace60f 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -209,7 +209,8 @@ int dvb_set_dvbs (dvb_device_t *d, uint64_t freq, uint32_t srate, uint32_t fec)
 }
 
 int dvb_set_dvbs2 (dvb_device_t *, uint64_t /*freq*/, const char * /*mod*/,
-                   uint32_t /*srate*/, uint32_t /*fec*/, int /*pilot*/, int /*rolloff*/)
+                   uint32_t /*srate*/, uint32_t /*fec*/, int /*pilot*/, int /*rolloff*/,
+                   uint8_t /*sid*/)
 {
     return VLC_EGENERIC;
 }
@@ -237,7 +238,7 @@ int dvb_set_dvbt (dvb_device_t *d, uint32_t freq, const char * /*mod*/,
 
 int dvb_set_dvbt2 (dvb_device_t *, uint32_t /*freq*/, const char * /*mod*/,
                    uint32_t /*fec*/, uint32_t /*bandwidth*/, int /*tx_mode*/,
-                   uint32_t /*guard*/, uint32_t /*plp*/)
+                   uint32_t /*guard*/, uint8_t /*plp*/)
 {
     return VLC_EGENERIC;
 }
diff --git a/modules/access/dtv/dtv.h b/modules/access/dtv/dtv.h
index 6d85924..e218076 100644
--- a/modules/access/dtv/dtv.h
+++ b/modules/access/dtv/dtv.h
@@ -75,7 +75,8 @@ int dvb_set_dvbc (dvb_device_t *, uint32_t freq, const char *mod,
 /* DVB-S */
 int dvb_set_dvbs (dvb_device_t *, uint64_t freq, uint32_t srate, uint32_t fec);
 int dvb_set_dvbs2 (dvb_device_t *, uint64_t freq, const char *mod,
-                   uint32_t srate, uint32_t fec, int pilot, int rolloff);
+                   uint32_t srate, uint32_t fec, int pilot, int rolloff,
+                   uint8_t sid);
 int dvb_set_sec (dvb_device_t *, uint64_t freq, char pol,
                  uint32_t lowf, uint32_t highf, uint32_t switchf);
 
@@ -85,7 +86,7 @@ int dvb_set_dvbt (dvb_device_t *, uint32_t freq, const char *mod,
                   int transmission, uint32_t guard, int hierarchy);
 int dvb_set_dvbt2 (dvb_device_t *, uint32_t freq, const char *mod,
                    uint32_t fec, uint32_t bandwidth,
-                   int transmission, uint32_t guard, uint32_t plp);
+                   int transmission, uint32_t guard, uint8_t plp);
 
 /* ATSC */
 int dvb_set_atsc (dvb_device_t *, uint32_t freq, const char *mod);
diff --git a/modules/access/dtv/en50221.c b/modules/access/dtv/en50221.c
index ac9bb4c..1832f87 100644
--- a/modules/access/dtv/en50221.c
+++ b/modules/access/dtv/en50221.c
@@ -34,6 +34,7 @@
 #include <assert.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
+#include <sys/uio.h>
 #include <poll.h>
 #include <netinet/in.h>
 
@@ -243,64 +244,29 @@ static void Dump( bool b_outgoing, uint8_t *p_data, int i_size )
  * TPDUSend
  *****************************************************************************/
 static int TPDUSend( cam_t * p_cam, uint8_t i_slot, uint8_t i_tag,
-                     const uint8_t *p_content, int i_length )
+                     const uint8_t *p_content, size_t i_length )
 {
-    uint8_t i_tcid = i_slot + 1;
-    uint8_t p_data[MAX_TPDU_SIZE];
-    int i_size;
-
-    i_size = 0;
-    p_data[0] = i_slot;
-    p_data[1] = i_tcid;
-    p_data[2] = i_tag;
-
-    switch ( i_tag )
-    {
-    case T_RCV:
-    case T_CREATE_TC:
-    case T_CTC_REPLY:
-    case T_DELETE_TC:
-    case T_DTC_REPLY:
-    case T_REQUEST_TC:
-        p_data[3] = 1; /* length */
-        p_data[4] = i_tcid;
-        i_size = 5;
-        break;
-
-    case T_NEW_TC:
-    case T_TC_ERROR:
-        p_data[3] = 2; /* length */
-        p_data[4] = i_tcid;
-        p_data[5] = p_content[0];
-        i_size = 6;
-        break;
+    uint8_t p_data[9], *p = p_data;
 
-    case T_DATA_LAST:
-    case T_DATA_MORE:
-    {
-        /* i_length <= MAX_TPDU_DATA */
-        uint8_t *p = p_data + 3;
-        p = SetLength( p, i_length + 1 );
-        *p++ = i_tcid;
+    *(p++) = i_slot;
+    *(p++) = i_slot + 1; /* TCID */
+    *(p++) = i_tag;
+    p = SetLength( p, i_length + 1 );
 
-        if ( i_length )
-            memcpy( p, p_content, i_length );
-        i_size = i_length + (p - p_data);
-        break;
-    }
+    *(p++) = i_slot + 1;
+    Dump( true, p_data, p - p_data );
 
-    default:
-        break;
-    }
-    Dump( true, p_data, i_size );
+    const struct iovec iov[2] = {
+        { p_data, p - p_data },
+        { (void *)p_content, i_length },
+    };
 
-    if ( write( p_cam->fd, p_data, i_size ) != i_size )
+    if ( writev( p_cam->fd, iov, 2 ) <= 0 )
     {
         msg_Err( p_cam->obj, "cannot write to CAM device: %s",
                  vlc_strerror_c(errno) );
         return VLC_EGENERIC;
     }
-
     return VLC_SUCCESS;
 }
 
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 9f289a3..6c6c072 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -875,7 +875,8 @@ int dvb_set_dvbs (dvb_device_t *d, uint64_t freq_Hz,
 }
 
 int dvb_set_dvbs2 (dvb_device_t *d, uint64_t freq_Hz, const char *modstr,
-                   uint32_t srate, uint32_t fec, int pilot, int rolloff)
+                   uint32_t srate, uint32_t fec, int pilot, int rolloff,
+                   uint8_t sid)
 {
     uint32_t freq = freq_Hz / 1000;
     unsigned mod = dvb_parse_modulation (modstr, QPSK);
@@ -898,10 +899,24 @@ int dvb_set_dvbs2 (dvb_device_t *d, uint64_t freq_Hz, const char *modstr,
 
     if (dvb_find_frontend (d, DVB_S2))
         return -1;
-    return dvb_set_props (d, 8, DTV_CLEAR, 0, DTV_DELIVERY_SYSTEM, SYS_DVBS2,
+#if DVBv5(8)
+    return dvb_set_props (d, 9, DTV_CLEAR, 0, DTV_DELIVERY_SYSTEM, SYS_DVBS2,
+                          DTV_FREQUENCY, freq, DTV_MODULATION, mod,
+                          DTV_SYMBOL_RATE, srate, DTV_INNER_FEC, fec,
+                          DTV_PILOT, pilot, DTV_ROLLOFF, rolloff,
+                          DTV_STREAM_ID, (uint32_t)sid);
+#else
+# warning DVB-S2 needs Linux DVB version 5.8 or later.
+    if (sid != 0)
+    {
+        msg_Err (d->obj, "DVB-S2 stream ID support not compiled-in");
+        return -1;
+    }
+    return dvb_set_props (d, 8, DTV_CLEAR, 0,  DTV_DELIVERY_SYSTEM, SYS_DVBS2,
                           DTV_FREQUENCY, freq, DTV_MODULATION, mod,
                           DTV_SYMBOL_RATE, srate, DTV_INNER_FEC, fec,
                           DTV_PILOT, pilot, DTV_ROLLOFF, rolloff);
+#endif
 }
 
 
@@ -991,7 +1006,7 @@ int dvb_set_dvbt (dvb_device_t *d, uint32_t freq, const char *modstr,
 
 int dvb_set_dvbt2 (dvb_device_t *d, uint32_t freq, const char *modstr,
                    uint32_t fec, uint32_t bandwidth,
-                   int transmit_mode, uint32_t guard, uint32_t plp)
+                   int transmit_mode, uint32_t guard, uint8_t plp)
 {
 #if DVBv5(3)
     uint32_t mod = dvb_parse_modulation (modstr, QAM_AUTO);
@@ -1012,7 +1027,7 @@ int dvb_set_dvbt2 (dvb_device_t *d, uint32_t freq, const char *modstr,
 # else
                           DTV_DVBT2_PLP_ID,
 # endif
-                          plp);
+                          (uint32_t)plp);
 #else
 # warning DVB-T2 needs Linux DVB version 5.3 or later.
     msg_Err (d->obj, "DVB-T2 support not compiled-in");
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index ad3f9a9..8f0193c 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -2,7 +2,7 @@
  * dvdnav.c: DVD module using the dvdnav library.
  *****************************************************************************
  * Copyright (C) 2004-2009 VLC authors and VideoLAN
- * $Id: eb65815ada3a75249a22bf7299ba48bc9185d530 $
+ * $Id: 2f08bbfcc649bc8706d7087a2371a30207c2fa99 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -79,9 +79,14 @@
 
 #define LANGUAGE_DEFAULT ("en")
 
-static int  Open ( vlc_object_t * );
+static int  AccessDemuxOpen ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
+#if DVDREAD_VERSION >= 50300
+#define HAVE_DVDNAV_DEMUX
+static int  DemuxOpen ( vlc_object_t * );
+#endif
+
 vlc_module_begin ()
     set_shortname( N_("DVD with menus") )
     set_description( N_("DVDnav Input") )
@@ -93,7 +98,16 @@ vlc_module_begin ()
         MENU_TEXT, MENU_LONGTEXT, false )
     set_capability( "access_demux", 5 )
     add_shortcut( "dvd", "dvdnav", "file" )
-    set_callbacks( Open, Close )
+    set_callbacks( AccessDemuxOpen, Close )
+#ifdef HAVE_DVDNAV_DEMUX
+    add_submodule()
+        set_description( N_("DVDnav demuxer") )
+        set_category( CAT_INPUT )
+        set_subcategory( SUBCAT_INPUT_DEMUX )
+        set_capability( "demux", 0 )
+        set_callbacks( DemuxOpen, Close )
+        add_shortcut( "dvd", "iso" )
+#endif
 vlc_module_end ()
 
 /* Shall we use libdvdnav's read ahead cache? */
@@ -112,6 +126,7 @@ struct demux_sys_t
 
     /* */
     bool        b_reset_pcr;
+    bool        b_readahead;
 
     struct
     {
@@ -176,66 +191,17 @@ static int EventIntf( vlc_object_t *, char const *,
                       vlc_value_t, vlc_value_t, void * );
 
 /*****************************************************************************
- * DemuxOpen:
+ * CommonOpen:
  *****************************************************************************/
-static int Open( vlc_object_t *p_this )
+static int CommonOpen( vlc_object_t *p_this,
+                       dvdnav_t *p_dvdnav, bool b_readahead )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
-    dvdnav_t    *p_dvdnav;
     int         i_angle;
-    char        *psz_file;
     char        *psz_code;
-    bool forced = false;
-
-    if( p_demux->psz_access != NULL
-     && !strncmp(p_demux->psz_access, "dvd", 3) )
-        forced = true;
-
-    if( !p_demux->psz_file || !*p_demux->psz_file )
-    {
-        /* Only when selected */
-        if( !forced )
-            return VLC_EGENERIC;
-
-        psz_file = var_InheritString( p_this, "dvd" );
-    }
-    else
-        psz_file = strdup( p_demux->psz_file );
 
-#if defined( _WIN32 ) || defined( __OS2__ )
-    if( psz_file != NULL )
-    {
-        /* Remove trailing backslash, otherwise dvdnav_open will fail */
-        size_t flen = strlen( psz_file );
-        if( flen > 0 && psz_file[flen - 1] == '\\' )
-            psz_file[flen - 1] = '\0';
-    }
-    else
-        psz_file = strdup("");
-#endif
-    if( unlikely(psz_file == NULL) )
-        return VLC_EGENERIC;
-
-    /* Try some simple probing to avoid going through dvdnav_open too often */
-    if( !forced && ProbeDVD( psz_file ) != VLC_SUCCESS )
-    {
-        free( psz_file );
-        return VLC_EGENERIC;
-    }
-
-    /* Open dvdnav */
-    const char *psz_path = ToLocale( psz_file );
-    if( dvdnav_open( &p_dvdnav, psz_path ) != DVDNAV_STATUS_OK )
-        p_dvdnav = NULL;
-    LocaleFree( psz_path );
-    if( p_dvdnav == NULL )
-    {
-        msg_Warn( p_demux, "cannot open DVD (%s)", psz_file);
-        free( psz_file );
-        return VLC_EGENERIC;
-    }
-    free( psz_file );
+    assert( p_dvdnav );
 
     /* Fill p_demux field */
     DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
@@ -250,6 +216,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_spu_change = false;
     p_sys->i_vobu_index = 0;
     p_sys->i_vobu_flush = 0;
+    p_sys->b_readahead = b_readahead;
 
     if( 1 )
     {
@@ -269,7 +236,7 @@ static int Open( vlc_object_t *p_this )
     }
 
     /* Configure dvdnav */
-    if( dvdnav_set_readahead_flag( p_sys->dvdnav, DVD_READ_CACHE ) !=
+    if( dvdnav_set_readahead_flag( p_sys->dvdnav, p_sys->b_readahead ) !=
           DVDNAV_STATUS_OK )
     {
         msg_Warn( p_demux, "cannot set read-a-head flag" );
@@ -332,7 +299,6 @@ static int Open( vlc_object_t *p_this )
             dialog_Fatal( p_demux, _("Playback failure"), "%s",
                             _("VLC cannot set the DVD's title. It possibly "
                               "cannot decrypt the entire disc.") );
-            dvdnav_close( p_sys->dvdnav );
             free( p_sys );
             return VLC_EGENERIC;
         }
@@ -373,6 +339,162 @@ static int Open( vlc_object_t *p_this )
 }
 
 /*****************************************************************************
+ * AccessDemuxOpen:
+ *****************************************************************************/
+static int AccessDemuxOpen ( vlc_object_t *p_this )
+{
+    demux_t *p_demux = (demux_t*)p_this;
+    dvdnav_t *p_dvdnav = NULL;
+    char *psz_file = NULL;
+    const char *psz_path = NULL;
+    int i_ret = VLC_EGENERIC;
+    bool forced = false;
+
+    if( p_demux->psz_access != NULL
+     && !strncmp(p_demux->psz_access, "dvd", 3) )
+        forced = true;
+
+    if( !p_demux->psz_file || !*p_demux->psz_file )
+    {
+        /* Only when selected */
+        if( !forced )
+            return VLC_EGENERIC;
+
+        psz_file = var_InheritString( p_this, "dvd" );
+    }
+    else
+        psz_file = strdup( p_demux->psz_file );
+
+#if defined( _WIN32 ) || defined( __OS2__ )
+    if( psz_file != NULL )
+    {
+        /* Remove trailing backslash, otherwise dvdnav_open will fail */
+        size_t flen = strlen( psz_file );
+        if( flen > 0 && psz_file[flen - 1] == '\\' )
+            psz_file[flen - 1] = '\0';
+    }
+    else
+        psz_file = strdup("");
+#endif
+
+    if( unlikely(psz_file == NULL) )
+        return VLC_EGENERIC;
+
+    /* Try some simple probing to avoid going through dvdnav_open too often */
+    if( !forced && ProbeDVD( psz_file ) != VLC_SUCCESS )
+        goto bailout;
+
+    /* Open dvdnav */
+    psz_path = ToLocale( psz_file );
+    if( dvdnav_open( &p_dvdnav, psz_path ) != DVDNAV_STATUS_OK )
+    {
+        msg_Warn( p_demux, "cannot open DVD (%s)", psz_file);
+        goto bailout;
+    }
+
+    i_ret = CommonOpen( p_this, p_dvdnav, !!DVD_READ_CACHE );
+    if( i_ret != VLC_SUCCESS )
+        dvdnav_close( p_dvdnav );
+
+bailout:
+    free( psz_file );
+    if( psz_path )
+        LocaleFree( psz_path );
+    return i_ret;
+}
+
+#ifdef HAVE_DVDNAV_DEMUX
+/*****************************************************************************
+ * StreamProbeDVD: very weak probing that avoids going too often into a dvdnav_open()
+ *****************************************************************************/
+static int StreamProbeDVD( stream_t *s )
+{
+    /* ISO 9660 volume descriptor */
+    char iso_dsc[6];
+    if( stream_Seek( s, 0x8000 + 1 ) != VLC_SUCCESS
+     || stream_Read( s, iso_dsc, sizeof (iso_dsc) ) < (int)sizeof (iso_dsc)
+     || memcmp( iso_dsc, "CD001\x01", 6 ) )
+        return VLC_EGENERIC;
+
+    /* Try to find the anchor (2 bytes at LBA 256) */
+    uint16_t anchor;
+
+    if( stream_Seek( s, 256 * DVD_VIDEO_LB_LEN ) == VLC_SUCCESS
+     && stream_Read( s, &anchor, 2 ) == 2
+     && GetWLE( &anchor ) == 2 )
+        return VLC_SUCCESS;
+    else
+        return VLC_EGENERIC;
+}
+
+/*****************************************************************************
+ * dvdnav stream callbacks
+ *****************************************************************************/
+static int stream_cb_seek( void *s, uint64_t pos )
+{
+    return stream_Seek( (stream_t *)s, pos );
+}
+
+static int stream_cb_read( void *s, void* buffer, int size )
+{
+    return stream_Read( (stream_t *)s, buffer, size );
+}
+
+/*****************************************************************************
+ * DemuxOpen:
+ *****************************************************************************/
+static int DemuxOpen ( vlc_object_t *p_this )
+{
+    demux_t *p_demux = (demux_t*)p_this;
+    dvdnav_t *p_dvdnav = NULL;
+    int i_ret = VLC_EGENERIC;
+    int64_t i_init_pos;
+    bool forced = false, b_seekable = false;
+
+    if( p_demux->psz_demux != NULL
+     && !strncmp(p_demux->psz_demux, "dvd", 3) )
+        forced = true;
+
+    /* StreamProbeDVD need FASTSEEK, but if dvd is forced, we don't probe thus
+     * don't need fastseek */
+    stream_Control( p_demux->s, forced ? STREAM_CAN_SEEK : STREAM_CAN_FASTSEEK,
+                    &b_seekable );
+    if( !b_seekable )
+        return VLC_EGENERIC;
+
+    i_init_pos = stream_Tell( p_demux->s );
+
+    /* Try some simple probing to avoid going through dvdnav_open too often */
+    if( !forced && StreamProbeDVD( p_demux->s ) != VLC_SUCCESS )
+        goto bailout;
+
+    static dvdnav_stream_cb stream_cb =
+    {
+        .pf_seek = stream_cb_seek,
+        .pf_read = stream_cb_read,
+        .pf_readv = NULL,
+    };
+
+    /* Open dvdnav with stream callbacks */
+    if( dvdnav_open_stream( &p_dvdnav, p_demux->s,
+                            &stream_cb ) != DVDNAV_STATUS_OK )
+    {
+        msg_Warn( p_demux, "cannot open DVD with open_stream" );
+        goto bailout;
+    }
+
+    i_ret = CommonOpen( p_this, p_dvdnav, false );
+    if( i_ret != VLC_SUCCESS )
+        dvdnav_close( p_dvdnav );
+
+bailout:
+    if( i_ret != VLC_SUCCESS )
+        stream_Seek( p_demux->s, i_init_pos );
+    return i_ret;
+}
+#endif
+
+/*****************************************************************************
  * Close:
  *****************************************************************************/
 static void Close( vlc_object_t *p_this )
@@ -639,14 +761,15 @@ static int Demux( demux_t *p_demux )
     uint8_t *packet = buffer;
     int i_event;
     int i_len;
+    dvdnav_status_t status;
 
-#if DVD_READ_CACHE
-    if( dvdnav_get_next_cache_block( p_sys->dvdnav, &packet, &i_event, &i_len )
-        == DVDNAV_STATUS_ERR )
-#else
-    if( dvdnav_get_next_block( p_sys->dvdnav, packet, &i_event, &i_len )
-        == DVDNAV_STATUS_ERR )
-#endif
+    if( p_sys->b_readahead )
+        status = dvdnav_get_next_cache_block( p_sys->dvdnav, &packet, &i_event,
+                                              &i_len );
+    else
+        status = dvdnav_get_next_block( p_sys->dvdnav, packet, &i_event,
+                                        &i_len );
+    if( status == DVDNAV_STATUS_ERR )
     {
         msg_Warn( p_demux, "cannot get next block (%s)",
                   dvdnav_err_to_string( p_sys->dvdnav ) );
@@ -905,9 +1028,8 @@ static int Demux( demux_t *p_demux )
     case DVDNAV_STOP:   /* EOF */
         msg_Dbg( p_demux, "DVDNAV_STOP" );
 
-#if DVD_READ_CACHE
-        dvdnav_free_cache_block( p_sys->dvdnav, packet );
-#endif
+        if( p_sys->b_readahead )
+            dvdnav_free_cache_block( p_sys->dvdnav, packet );
         return 0;
 
     case DVDNAV_HIGHLIGHT:
@@ -948,9 +1070,8 @@ static int Demux( demux_t *p_demux )
         break;
     }
 
-#if DVD_READ_CACHE
-    dvdnav_free_cache_block( p_sys->dvdnav, packet );
-#endif
+    if( p_sys->b_readahead )
+        dvdnav_free_cache_block( p_sys->dvdnav, packet );
 
     return 1;
 }
diff --git a/modules/access/http.c b/modules/access/http.c
index 5cadd97..9edd771 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: 78a186c6653cc5df1a62c7ed42b0da4cb0ff326d $
+ * $Id: 65fee248c9d37d02555e1b1b32e30c22a88cf31d $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -1459,6 +1459,8 @@ static int Request( access_t *p_access, uint64_t i_tell )
             p_sys->psz_icy_name = EnsureUTF8( psz_tmp );
             if( !p_sys->psz_icy_name )
                 free( psz_tmp );
+            else
+                resolve_xml_special_chars( p_sys->psz_icy_name );
             msg_Dbg( p_access, "Icy-Name: %s", p_sys->psz_icy_name );
             input_thread_t *p_input = access_GetParentInput( p_access );
             if ( p_input )
@@ -1480,6 +1482,8 @@ static int Request( access_t *p_access, uint64_t i_tell )
             p_sys->psz_icy_genre = EnsureUTF8( psz_tmp );
             if( !p_sys->psz_icy_genre )
                 free( psz_tmp );
+            else
+                resolve_xml_special_chars( p_sys->psz_icy_genre );
             msg_Dbg( p_access, "Icy-Genre: %s", p_sys->psz_icy_genre );
             input_thread_t *p_input = access_GetParentInput( p_access );
             if( p_input )
diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 69275af..8e0aa57 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -2,7 +2,7 @@
  * live555.cpp : LIVE555 Streaming Media support.
  *****************************************************************************
  * Copyright (C) 2003-2007 VLC authors and VideoLAN
- * $Id: 163ae2dd52c2fea9186e3474858d0c06bfcdebba $
+ * $Id: e8ba5a2bdf82259a7dcdd430bd3096cbc5f9c9fa $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Derk-Jan Hartman <hartman at videolan. org>
@@ -1292,7 +1292,7 @@ static int Demux( demux_t *p_demux )
         {
             bool b;
             es_out_Control( p_demux->out, ES_OUT_GET_ES_STATE, tk->p_es, &b );
-            if( !b && tk->b_selected )
+            if( !b && tk->b_selected && p_sys->rtsp )
             {
                 tk->b_selected = false;
                 p_sys->rtsp->sendTeardownCommand( *tk->sub, NULL );
diff --git a/modules/access/rtsp/access.c b/modules/access/rtsp/access.c
index 3048882..1144d02 100644
--- a/modules/access/rtsp/access.c
+++ b/modules/access/rtsp/access.c
@@ -2,7 +2,7 @@
  * access.c: Real rtsp input
  *****************************************************************************
  * Copyright (C) 2005 VideoLAN
- * $Id: dd786bec42a4e21d43ee21713150b5bed5bf7d3b $
+ * $Id: e8b0ceca98d336fefb1ad2c5e5de3e3221452569 $
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *
@@ -155,6 +155,13 @@ static int Open( vlc_object_t *p_this )
             return VLC_EGENERIC;
     }
 
+    /* Discard legacy username/password syntax - not supported */
+    const char *psz_location = strchr( p_access->psz_location, '@' );
+    if( psz_location != NULL )
+        psz_location++;
+    else
+        psz_location = p_access->psz_location;
+
     p_access->pf_read = NULL;
     p_access->pf_block = BlockRead;
     p_access->pf_seek = Seek;
@@ -179,10 +186,10 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_rtsp->pf_read_line = RtspReadLine;
     p_sys->p_rtsp->pf_write = RtspWrite;
 
-    i_result = rtsp_connect( p_sys->p_rtsp, p_access->psz_location, 0 );
+    i_result = rtsp_connect( p_sys->p_rtsp, psz_location, 0 );
     if( i_result )
     {
-        msg_Dbg( p_access, "could not connect to: %s", p_access->psz_location );
+        msg_Dbg( p_access, "could not connect to: %s", psz_location );
         free( p_sys->p_rtsp );
         p_sys->p_rtsp = NULL;
         goto error;
diff --git a/modules/access/sftp.c b/modules/access/sftp.c
index 21b5e54..62f2db2 100644
--- a/modules/access/sftp.c
+++ b/modules/access/sftp.c
@@ -2,7 +2,7 @@
  * sftp.c: SFTP input module
  *****************************************************************************
  * Copyright (C) 2009 VLC authors and VideoLAN
- * $Id: 4152d2a3058c95ab5ffe1eeabe3cbfec6fb94dea $
+ * $Id: b4577ac939a5b53180eac92afc80a7e8ec56533f $
  *
  * Authors: Rémi Duraffort <ivoire@videolan.org>
  *
@@ -107,6 +107,7 @@ static int Open( vlc_object_t* p_this )
         return VLC_EGENERIC;
 
     STANDARD_BLOCK_ACCESS_INIT;
+    p_sys->i_socket = -1;
 
     /* Parse the URL */
     const char* path = p_access->psz_location;
@@ -143,6 +144,11 @@ static int Open( vlc_object_t* p_this )
 
     /* Connect to the server using a regular socket */
     p_sys->i_socket = net_Connect( p_access, url.psz_host, i_port, SOCK_STREAM, 0 );
+    if( p_sys->i_socket < 0 )
+    {
+        msg_Err( p_access, "Impossible to open the connection to %s:%i", url.psz_host, i_port );
+        goto error;
+    }
 
     /* Create the ssh connexion and wait until the server answer */
     if( ( p_sys->ssh_session = libssh2_session_init() ) == NULL )
@@ -244,11 +250,14 @@ static int Open( vlc_object_t* p_this )
     return VLC_SUCCESS;
 
 error:
+    if( p_sys->file )
+        libssh2_sftp_close_handle( p_sys->file );
     if( p_sys->ssh_session )
         libssh2_session_free( p_sys->ssh_session );
     free( psz_password );
     free( psz_username );
     vlc_UrlClean( &url );
+    net_Close( p_sys->i_socket );
     free( p_sys );
     return VLC_EGENERIC;
 }
@@ -264,6 +273,7 @@ static void Close( vlc_object_t* p_this )
     libssh2_sftp_shutdown( p_sys->sftp_session );
 
     libssh2_session_free( p_sys->ssh_session );
+    net_Close( p_sys->i_socket );
     free( p_sys );
 }
 
@@ -299,6 +309,7 @@ static block_t* Block( access_t* p_access )
     }
     else
     {
+        p_block->i_buffer = i_ret;
         p_access->info.i_pos += i_ret;
         return p_block;
     }
diff --git a/modules/access/udp.c b/modules/access/udp.c
index e135a96..a146ec0 100644
--- a/modules/access/udp.c
+++ b/modules/access/udp.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2001-2005 VLC authors and VideoLAN
  * Copyright (C) 2007 Remi Denis-Courmont
- * $Id: 00f298919c40ba9660ddecb4b88ead6adfcd21b7 $
+ * $Id: 8139d05a0079b5e3d9506eb5010aedfa8c6b8d00 $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Tristan Leteurtre <tooney@via.ecp.fr>
@@ -232,8 +232,14 @@ static int Control( access_t *p_access, int i_query, va_list args )
 static block_t *BlockUDP( access_t *p_access )
 {
     access_sys_t *sys = p_access->p_sys;
+    block_t *block;
 
-    return block_FifoGet( sys->fifo );
+    if( p_access->info.b_eof )
+        return NULL;
+
+    block = block_FifoGet( sys->fifo );
+    p_access->info.b_eof = block == NULL;
+    return block;
 }
 
 /*****************************************************************************
diff --git a/modules/access/v4l2/lib.c b/modules/access/v4l2/lib.c
index cf2b480..3a4400a 100644
--- a/modules/access/v4l2/lib.c
+++ b/modules/access/v4l2/lib.c
@@ -48,7 +48,11 @@ static int fd_open (int fd, int flags)
 
 static void v4l2_lib_load (void)
 {
-    void *h = dlopen ("libv4l2.so.0", RTLD_LAZY | RTLD_LOCAL);
+    void *h;
+
+    h = dlopen ("libmediaclient.so", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);
+    if (h == NULL)
+        h = dlopen ("libv4l2.so.0", RTLD_LAZY | RTLD_LOCAL);
     if (h == NULL)
         goto fallback;
 
diff --git a/modules/access/vdr.c b/modules/access/vdr.c
index d2686c6..bad2ffd 100644
--- a/modules/access/vdr.c
+++ b/modules/access/vdr.c
@@ -201,6 +201,8 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    free( p_access->psz_demux );
+    p_access->psz_demux = strdup( p_sys->b_ts_format ? "ts" : "ps" );
     return VLC_SUCCESS;
 }
 
@@ -292,7 +294,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
                 return VLC_EGENERIC;
             ppp_title = va_arg( args, input_title_t*** );
             *va_arg( args, int* ) = 1;
-            *ppp_title = malloc( sizeof( input_title_t* ) );
+            *ppp_title = malloc( sizeof( **ppp_title ) );
             if( !*ppp_title )
                 return VLC_ENOMEM;
             **ppp_title = vlc_input_title_Duplicate( p_sys->p_marks );
diff --git a/modules/access/vnc.c b/modules/access/vnc.c
index 0aaa17e..256efb9 100644
--- a/modules/access/vnc.c
+++ b/modules/access/vnc.c
@@ -452,10 +452,9 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_client->appData.viewOnly = TRUE;
     p_sys->p_client->serverPort = ( url.i_port > 0 ) ? url.i_port : 5900;
 
-    msg_Dbg( p_demux, "VNC init %s host=%s pass=%s port=%d",
+    msg_Dbg( p_demux, "VNC init %s host=%s port=%d",
              p_demux->psz_location,
              p_sys->p_client->serverHost,
-             url.psz_password,
              p_sys->p_client->serverPort );
 
     vlc_UrlClean( &url );
diff --git a/modules/access/zip/zipstream.c b/modules/access/zip/zipstream.c
index 601c0a5..493d8eb 100644
--- a/modules/access/zip/zipstream.c
+++ b/modules/access/zip/zipstream.c
@@ -2,7 +2,7 @@
  * zipstream.c: stream_filter that creates a XSPF playlist from a Zip archive
  *****************************************************************************
  * Copyright (C) 2009 VLC authors and VideoLAN
- * $Id: 8fd966d64c3d030445813aa05238663e68767aa4 $
+ * $Id: 8820a799198be195b87c5d083d9df9c8f756cd21 $
  *
  * Authors: Jean-Philippe André <jpeg@videolan.org>
  *
@@ -713,7 +713,7 @@ static node* findOrCreateParentNode( node *root, const char *fullpath )
 
     while( current )
     {
-        if( !strcmp( current->name, folder ) )
+        if( current->name && !strcmp( current->name, folder ) )
         {
             /* We found the folder, go recursively deeper */
             node *parentNode = findOrCreateParentNode( current, sep );
diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index a1b6131..0563f8d 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -182,6 +182,7 @@ struct sout_access_out_sys_t
     char *psz_keyfile;
     mtime_t i_keyfile_modification;
     mtime_t i_opendts;
+    mtime_t i_dts_offset;
     mtime_t  i_seglenm;
     uint32_t i_segment;
     size_t  i_seglen;
@@ -195,6 +196,7 @@ struct sout_access_out_sys_t
     bool b_splitanywhere;
     bool b_caching;
     bool b_generate_iv;
+    bool b_segment_has_data;
     uint8_t aes_ivs[16];
     gcry_cipher_hd_t aes_ctx;
     char *key_uri;
@@ -240,11 +242,13 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_ratecontrol = var_GetBool( p_access, SOUT_CFG_PREFIX "ratecontrol") ;
     p_sys->b_caching = var_GetBool( p_access, SOUT_CFG_PREFIX "caching") ;
     p_sys->b_generate_iv = var_GetBool( p_access, SOUT_CFG_PREFIX "generate-iv") ;
+    p_sys->b_segment_has_data = false;
 
     p_sys->segments_t = vlc_array_new();
 
     p_sys->stuffing_size = 0;
     p_sys->i_opendts = VLC_TS_INVALID;
+    p_sys->i_dts_offset  = 0;
 
     p_sys->psz_indexPath = NULL;
     psz_idx = var_GetNonEmptyString( p_access, SOUT_CFG_PREFIX "index" );
@@ -762,10 +766,11 @@ static void Close( vlc_object_t * p_this )
 
         /* Since we are flushing, check the segment change by hand and don't wait
          * possible keyframe*/
-        if( ((float)(output_block->i_length * CLOCK_FREQ / INT64_C(1000000) ) +
-            (float)(output_block->i_dts - p_sys->i_opendts)) >= p_sys->i_seglenm )
+        if( p_sys->b_segment_has_data &&  (float)(output_block->i_length + p_sys->i_dts_offset +
+                     output_block->i_dts - p_sys->i_opendts) >= p_sys->i_seglenm )
         {
             closeCurrentSegment( p_access, p_sys, false );
+            p_sys->i_dts_offset = 0;
             if( unlikely(openNextFile( p_access, p_sys ) < 0 ) )
             {
                 block_ChainRelease( output_block );
@@ -893,6 +898,7 @@ static ssize_t openNextFile( sout_access_out_t *p_access, sout_access_out_sys_t
     p_sys->psz_cursegPath = strdup(segment->psz_filename);
     p_sys->i_handle = fd;
     p_sys->i_segment = i_newseg;
+    p_sys->b_segment_has_data = false;
     return fd;
 }
 /*****************************************************************************
@@ -903,16 +909,28 @@ static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer )
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     block_t *output = p_sys->block_buffer;
 
-    if( p_sys->i_handle > 0 &&
-        ( ( p_buffer->i_dts - p_sys->i_opendts +
-          ( p_buffer->i_length * CLOCK_FREQ / INT64_C(1000000) )
-        ) >= p_sys->i_seglenm ) )
-     {
+    /* let's check if we need to store offset to keep
+     * better count of actual duration */
+    if( unlikely( p_buffer->i_dts < p_sys->i_opendts ) )
+    {
+        block_t *last_buffer = p_sys->block_buffer;
+        while( last_buffer->p_next )
+            last_buffer = last_buffer->p_next;
+        p_sys->i_dts_offset += last_buffer->i_dts - p_sys->i_opendts;
+        p_sys->i_opendts    = p_buffer->i_dts;
+        msg_Dbg( p_access, "dts offset %"PRId64, p_sys->i_dts_offset );
+    }
+
+    if( p_sys->i_handle > 0 && p_sys->b_segment_has_data &&
+       (( p_buffer->i_length + p_buffer->i_dts - p_sys->i_opendts +
+          p_sys->i_dts_offset ) >= p_sys->i_seglenm ) )
+    {
         closeCurrentSegment( p_access, p_sys, false );
-     }
+    }
 
-    if ( p_sys->i_handle < 0 )
+    if ( unlikely( p_sys->i_handle < 0 ) )
     {
+        p_sys->i_dts_offset = 0;
         p_sys->i_opendts = output ? output->i_dts : p_buffer->i_dts;
         //For first segment we can get negative duration otherwise...?
         if( ( p_sys->i_opendts != VLC_TS_INVALID ) &&
@@ -928,7 +946,7 @@ static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer )
 static ssize_t writeSegment( sout_access_out_t *p_access )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
-    block_t *output = p_sys->block_buffer;
+    block_t *output = p_sys->block_buffer ? block_ChainGather( p_sys->block_buffer ) : NULL;
     p_sys->block_buffer = NULL;
     ssize_t i_write=0;
     bool crypted = false;
@@ -973,8 +991,8 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
         }
 
         p_sys->f_seglen =
-            (float)(output->i_length / INT64_C(1000000) ) +
-            (float)(output->i_dts - p_sys->i_opendts) / CLOCK_FREQ;
+            (float)(output->i_length +
+                    output->i_dts - p_sys->i_opendts + p_sys->i_dts_offset) / CLOCK_FREQ;
 
         if ( (size_t)val >= output->i_buffer )
         {
@@ -1017,6 +1035,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
                 block_ChainRelease ( p_buffer );
                 return -1;
             }
+            p_sys->b_segment_has_data = true;
             i_write += writevalue;
         }
 
diff --git a/modules/audio_filter/resampler/speex.c b/modules/audio_filter/resampler/speex.c
index 774fc8f..9b967bf 100644
--- a/modules/audio_filter/resampler/speex.c
+++ b/modules/audio_filter/resampler/speex.c
@@ -22,6 +22,8 @@
 # include <config.h>
 #endif
 
+#include <inttypes.h>
+
 #include <vlc_common.h>
 #include <vlc_aout.h>
 #include <vlc_filter.h>
@@ -124,7 +126,8 @@ static block_t *Resample (filter_t *filter, block_t *in)
     const unsigned orate = filter->fmt_out.audio.i_rate;
 
     spx_uint32_t ilen = in->i_nb_samples;
-    spx_uint32_t olen = ((ilen + 2) * orate * 11) / (irate * 10);
+    spx_uint32_t olen = ((ilen + 2) * orate * UINT64_C(11))
+                      / (irate * UINT64_C(10));
 
     block_t *out = block_Alloc (olen * framesize);
     if (unlikely(out == NULL))
diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 1aafeb6..229d188 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -325,10 +325,32 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     }
 
     const char *device = sys->device;
-    char *devbuf = NULL;
+
     /* Choose the IEC device for S/PDIF output */
+    char sep = '\0';
     if (spdif)
     {
+        const char *opt;
+
+        if (!strcmp (device, "default"))
+            device = "iec958"; /* TODO: hdmi */
+
+        if (!strncmp (device, "iec958", 6))
+            opt = device + 6;
+        if (!strncmp (device, "hdmi", 4))
+            opt = device + 4;
+
+        if (opt != NULL)
+            switch (*opt)
+            {
+                case ':':  sep = ','; break;
+                case '\0': sep = ':'; break;
+            }
+    }
+
+    char *devbuf = NULL;
+    if (sep != '\0')
+    {
         unsigned aes3;
 
         switch (fmt->i_rate)
@@ -345,23 +367,8 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
                 break;
         }
 
-        char *opt = NULL;
-        if (!strcmp (device, "default"))
-            device = "iec958"; /* TODO: hdmi */
-        else
-        {
-            opt = strchr(device, ':');
-            if (opt && opt[1] == '\0') {
-                /* if device is terminated by : but there's no options,
-                 * remove ':', we'll add it back in the format string. */
-                *opt = '\0';
-                opt = NULL;
-            }
-        }
-
-        if (asprintf (&devbuf,
-                      "%s%cAES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x", device,
-                      opt ? ',' : ':',
+        if (asprintf (&devbuf, "%s%cAES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x",
+                      device, sep,
                       IEC958_AES0_CON_EMPHASIS_NONE | IEC958_AES0_NONAUDIO,
                       IEC958_AES1_CON_ORIGINAL | IEC958_AES1_CON_PCM_CODER,
                       0, aes3) == -1)
@@ -375,20 +382,21 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     const int mode = SND_PCM_NO_AUTO_RESAMPLE;
 
     int val = snd_pcm_open (&pcm, device, SND_PCM_STREAM_PLAYBACK, mode);
-    free (devbuf);
     if (val != 0)
     {
-        msg_Err (aout, "cannot open ALSA device \"%s\": %s", sys->device,
+        msg_Err (aout, "cannot open ALSA device \"%s\": %s", device,
                  snd_strerror (val));
         dialog_Fatal (aout, _("Audio output failed"),
                       _("The audio device \"%s\" could not be used:\n%s."),
                       sys->device, snd_strerror (val));
+        free (devbuf);
         return VLC_EGENERIC;
     }
     sys->pcm = pcm;
 
     /* Print some potentially useful debug */
-    msg_Dbg (aout, "using ALSA device: %s", sys->device);
+    msg_Dbg (aout, "using ALSA device: %s", device);
+    free (devbuf);
     DumpDevice (VLC_OBJECT(aout), pcm);
 
     /* Get Initial hardware parameters */
@@ -487,15 +495,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     }
     sys->rate = fmt->i_rate;
 
-#if 1 /* work-around for period-long latency outputs (e.g. PulseAudio): */
-    param = AOUT_MIN_PREPARE_TIME;
-    val = snd_pcm_hw_params_set_period_time_near (pcm, hw, &param, NULL);
-    if (val)
-    {
-        msg_Err (aout, "cannot set period: %s", snd_strerror (val));
-        goto error;
-    }
-#endif
     /* Set buffer size */
     param = AOUT_MAX_ADVANCE_TIME;
     val = snd_pcm_hw_params_set_buffer_time_near (pcm, hw, &param, NULL);
@@ -504,22 +503,14 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
         msg_Err (aout, "cannot set buffer duration: %s", snd_strerror (val));
         goto error;
     }
-#if 0
-    val = snd_pcm_hw_params_get_buffer_time (hw, &param, NULL);
-    if (val)
-    {
-        msg_Warn (aout, "cannot get buffer time: %s", snd_strerror(val));
-        param = AOUT_MIN_PREPARE_TIME;
-    }
-    else
-        param /= 2;
+
+    param = AOUT_MIN_PREPARE_TIME;
     val = snd_pcm_hw_params_set_period_time_near (pcm, hw, &param, NULL);
     if (val)
     {
         msg_Err (aout, "cannot set period: %s", snd_strerror (val));
         goto error;
     }
-#endif
 
     /* Commit hardware parameters */
     val = snd_pcm_hw_params (pcm, hw);
diff --git a/modules/audio_output/audioqueue.c b/modules/audio_output/audioqueue.c
index 2d8ba64..c4b2f70 100644
--- a/modules/audio_output/audioqueue.c
+++ b/modules/audio_output/audioqueue.c
@@ -1,6 +1,6 @@
 /*****************************************************************************
  * Copyright (C) 2000-2013 VLC authors and VideoLAN
- * $Id: c945a85bc7084d81cccc6d31eb9545ed093cc78b $
+ * $Id: 312fcb9eada673f7c71d034a26cd1d078c8de202 $
  *
  * Authors: Felix Paul Kühne <fkuehne at videolan dot org>
  *          Rémi Denis-Courmont
@@ -144,7 +144,7 @@ static int Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
     if (error != noErr)
         return VLC_EGENERIC;
     fmt->i_format = VLC_CODEC_FL32;
-    fmt->i_physical_channels = AOUT_CHANS_STEREO;
+    fmt->i_original_channels = fmt->i_physical_channels = AOUT_CHANS_STEREO;
     aout_FormatPrepare(fmt);
     p_aout->sys->i_rate = fmt->i_rate;
 
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index d84fa6d..1a9573d 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -2,7 +2,7 @@
  * auhal.c: AUHAL and Coreaudio output plugin
  *****************************************************************************
  * Copyright (C) 2005 - 2014 VLC authors and VideoLAN
- * $Id: 9bdd4fd6d835e78390eb200a4b48d5a48ddc11af $
+ * $Id: 10459f06c4940d210ec622bb256e9b061c139ea4 $
  *
  * Authors: Derk-Jan Hartman <hartman at videolan dot org>
  *          Felix Paul Kühne <fkuehne at videolan dot org>
@@ -635,6 +635,7 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
         msg_Warn(p_aout, "device driver does not support kAudioDevicePropertyPreferredChannelLayout - using stereo fallback [%4.4s]", (char *)&err);
         fmt->i_physical_channels = AOUT_CHANS_STEREO;
     }
+    fmt->i_original_channels = fmt->i_physical_channels;
 
     msg_Dbg(p_aout, "selected %d physical channels for device output", aout_FormatNbChannels(fmt));
     msg_Dbg(p_aout, "VLC will output: %s", aout_FormatPrintChannels(fmt));
diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c
index 1afd03d..9453d5c 100644
--- a/modules/audio_output/oss.c
+++ b/modules/audio_output/oss.c
@@ -394,6 +394,7 @@ static int Open (vlc_object_t *obj)
     aout->start = Start;
     aout->stop = Stop;
     aout->device_select = DeviceSelect;
+    aout_DeviceReport (aout, sys->device);
     aout_SoftVolumeInit (aout);
 
     DevicesEnum (aout);
diff --git a/modules/audio_output/sndio.c b/modules/audio_output/sndio.c
index a60c309..ecc0bfd 100644
--- a/modules/audio_output/sndio.c
+++ b/modules/audio_output/sndio.c
@@ -76,7 +76,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     struct sio_par par;
     sio_initpar (&par);
     switch (fmt->i_format) {
-    case VLC_CODEC_S8:
+    case VLC_CODEC_U8:
 	par.bits = 8;
 	par.sig = 0;
 	break;
diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index b825128..bc39a4f 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -266,9 +266,9 @@ libavcodec_plugin_la_LIBADD = $(AVCODEC_LIBS) $(LIBM)
 libavcodec_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(SYMBOLIC_LDFLAGS)
 
 if MERGE_FFMPEG
-libavcodec_plugin_la_SOURCES += demux/avformat/demux.c access/avio.c
-libavcodec_plugin_la_CFLAGS += $(AVFORMAT_CFLAGS)
-libavcodec_plugin_la_LIBADD += $(AVFORMAT_LIBS)
+libavcodec_plugin_la_SOURCES += demux/avformat/demux.c access/avio.c packetizer/avparser.c
+libavcodec_plugin_la_CFLAGS += $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS)
+libavcodec_plugin_la_LIBADD += $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(LIBM)
 if ENABLE_SOUT
 libavcodec_plugin_la_SOURCES += demux/avformat/mux.c
 endif
diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index bd91326..5b5d309 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -2,7 +2,7 @@
  * avcodec.c: video and audio decoder and encoder using libavcodec
  *****************************************************************************
  * Copyright (C) 1999-2008 VLC authors and VideoLAN
- * $Id: 2a710f3db23bd9355b50568fbcf164f65c9accae $
+ * $Id: bea5374122f072c75faaeabae078f432e8c0c7cc $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -76,6 +76,7 @@ static const char *const enc_hq_list_text[] = {
 #ifdef MERGE_FFMPEG
 # include "../../demux/avformat/avformat.h"
 # include "../../access/avio.h"
+# include "../../packetizer/avparser.h"
 #endif
 
 /*****************************************************************************
@@ -135,7 +136,13 @@ vlc_module_begin ()
     add_obsolete_string( "ffmpeg-codec" ) /* removed since 2.1.0 */
     add_string( "avcodec-codec", NULL, CODEC_TEXT, CODEC_LONGTEXT, true )
     add_obsolete_bool( "ffmpeg-hw" ) /* removed since 2.1.0 */
-    add_module( "avcodec-hw", "hw decoder", "any", HW_TEXT, HW_LONGTEXT, false )
+    add_module( "avcodec-hw", "hw decoder",
+#ifdef _WIN32
+            "none"
+#else
+            "any"
+#endif
+            , HW_TEXT, HW_LONGTEXT, false )
 #if defined(FF_THREAD_FRAME)
     add_obsolete_integer( "ffmpeg-threads" ) /* removed since 2.1.0 */
     add_integer( "avcodec-threads", 0, THREADS_TEXT, THREADS_LONGTEXT, true );
@@ -215,7 +222,7 @@ vlc_module_begin ()
                  ENC_QMAX_TEXT, ENC_QMAX_LONGTEXT, true )
     add_bool( ENC_CFG_PREFIX "trellis", false,
               ENC_TRELLIS_TEXT, ENC_TRELLIS_LONGTEXT, true )
-    add_float( ENC_CFG_PREFIX "qscale", 0,
+    add_float( ENC_CFG_PREFIX "qscale", 3,
                ENC_QSCALE_TEXT, ENC_QSCALE_LONGTEXT, true )
     add_integer( ENC_CFG_PREFIX "strict", 0,
                  ENC_STRICT_TEXT, ENC_STRICT_LONGTEXT, true )
@@ -245,6 +252,8 @@ vlc_module_begin ()
 #   include "../../demux/avformat/avformat.c"
     add_submodule ()
         AVIO_MODULE
+    add_submodule ()
+        AVPARSER_MODULE
 #endif
 vlc_module_end ()
 
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 5b6c59c..df25cd2 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -2,7 +2,7 @@
  * encoder.c: video and audio encoder using the libavcodec library
  *****************************************************************************
  * Copyright (C) 1999-2004 VLC authors and VideoLAN
- * $Id: c0098d34448cef24a9f6cf3672374951a547aa23 $
+ * $Id: 0b25b6c3f5658f9c0defa34532fb4ecd123d8613 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -627,7 +627,7 @@ int OpenEncoder( vlc_object_t *p_this )
 
         p_context->mb_decision = p_sys->i_hq;
 
-        if( p_sys->i_quality )
+        if( p_sys->i_quality && !p_enc->fmt_out.i_bitrate )
         {
             p_context->flags |= CODEC_FLAG_QSCALE;
             p_context->global_quality = p_sys->i_quality;
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 512d5d3..778162d 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: ad9be3b695901e0428aaa8b9981e8f7fef3f66c8 $
+ * $Id: a063754229315e3383bca4dce2aa6c026aa26bc0 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -441,6 +441,9 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
         return VLC_EGENERIC;
     }
 
+    if ( p_dec->fmt_in.i_codec == VLC_CODEC_VP9 )
+        p_dec->b_need_packetized = true;
+
     return VLC_SUCCESS;
 }
 
diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 7931e31..b0bff90 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -773,7 +773,7 @@ static bool Eia608ParseData( eia608_t *h, uint8_t d1, uint8_t d2 )
         ON( 0x20, 0x2f, Eia608ParseCommand0x14( h, d2 ) );
         break;
     case 0x17:
-        ON( 0x21, 0x22, Eia608ParseCommand0x17( h, d2 ) );
+        ON( 0x21, 0x23, Eia608ParseCommand0x17( h, d2 ) );
         ON( 0x2e, 0x2f, Eia608ParseTextAttribute( h, d2 ) );
         break;
     }
diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c
index 50c6e2d..4bb2e9b 100644
--- a/modules/codec/dmo/dmo.c
+++ b/modules/codec/dmo/dmo.c
@@ -2,7 +2,7 @@
  * dmo.c : DirectMedia Object decoder module for vlc
  *****************************************************************************
  * Copyright (C) 2002, 2003 VLC authors and VideoLAN
- * $Id: 161fd1778e3642772107d41da1871be68518b0b2 $
+ * $Id: 461aa8e0b9930ffc86542225c87cd82765618151 $
  *
  * Author: Gildas Bazin <gbazin@videolan.org>
  *
@@ -1319,6 +1319,9 @@ static int EncoderSetAudioType( encoder_t *p_enc, IMediaObject *p_dmo )
         msg_Dbg( p_enc, "found cbSize: %i", p_wf->cbSize );
         p_enc->fmt_out.i_extra = p_wf->cbSize;
         p_enc->fmt_out.p_extra = malloc( p_enc->fmt_out.i_extra );
+        if( p_enc->fmt_out.p_extra == NULL)
+            return VLC_EGENERIC;
+
         memcpy( p_enc->fmt_out.p_extra, &p_wf[1], p_enc->fmt_out.i_extra );
     }
 
diff --git a/modules/codec/dts.c b/modules/codec/dts.c
index 51f736e..5218a8e 100644
--- a/modules/codec/dts.c
+++ b/modules/codec/dts.c
@@ -2,7 +2,7 @@
  * dts.c: parse DTS audio sync info and packetize the stream
  *****************************************************************************
  * Copyright (C) 2003-2009 VLC authors and VideoLAN
- * $Id: 09ebc0d75727cb402aa26df3cefc97a58785d9bb $
+ * $Id: 5d777d4f01eb29dd47e0d4fb5693d7e52e9d49f3 $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -548,18 +548,20 @@ static int SyncInfo( const uint8_t *p_buf,
                                 AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE;
             break;
 
+        case 0xF:
         default:
-            if( i_audio_mode <= 63 )
+            if( (i_audio_mode & 0xFFFF) >= 0x10 )
             {
                 /* User defined */
                 *pi_channels = 0;
                 *pi_channels_conf = 0;
             }
             else return 0;
+
             break;
     }
 
-    if( i_audio_mode & 0x10000 )
+    if( *pi_channels && (i_audio_mode & 0x10000) )
     {
         (*pi_channels)++;
         *pi_channels_conf |= AOUT_CHAN_LFE;
diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index 4c2b511..63da198 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -2,7 +2,7 @@
  * faad.c: AAC decoder using libfaad2
  *****************************************************************************
  * Copyright (C) 2001, 2003 VLC authors and VideoLAN
- * $Id: 9aaaed63e9977324bdccdbe1d6588f5a90e9637f $
+ * $Id: 99a9bbd8b6c6ce8dca06c436268bdaf6ce87e02d $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -183,6 +183,8 @@ static int Open( vlc_object_t *p_this )
 
     /* Set the faad config */
     cfg = faacDecGetCurrentConfiguration( p_sys->hfaad );
+    if( p_dec->fmt_in.audio.i_rate )
+        cfg->defSampleRate = p_dec->fmt_in.audio.i_rate;
     cfg->outputFormat = HAVE_FPU ? FAAD_FMT_FLOAT : FAAD_FMT_16BIT;
     faacDecSetConfiguration( p_sys->hfaad, cfg );
 
@@ -313,7 +315,7 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     }
 
     /* Decode all data */
-    if( p_sys->i_buffer )
+    if( p_sys->i_buffer > 1)
     {
         void *samples;
         faacDecFrameInfo frame;
@@ -395,11 +397,16 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
 
             /* Flush the buffer */
             p_sys->i_buffer -= frame.bytesconsumed;
-            if( p_sys->i_buffer > 0 )
+            if( p_sys->i_buffer > 1 )
             {
                 memmove( p_sys->p_buffer,&p_sys->p_buffer[frame.bytesconsumed],
                          p_sys->i_buffer );
             }
+            else
+            {
+                /* Drop byte of padding */
+                p_sys->i_buffer = 0;
+            }
             block_Release( p_block );
             return NULL;
         }
@@ -491,23 +498,17 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         p_sys->i_buffer -= frame.bytesconsumed;
         if( p_sys->i_buffer > 0 )
         {
-            /* drop byte of raw AAC padding (if present) */
-            if ( frame.header_type == RAW &&
-                 p_sys->i_buffer == 1 &&
-                 p_sys->p_buffer[0] == 0x21 &&
-                 p_sys->p_buffer[frame.bytesconsumed] == 0 )
-            {
-                p_sys->i_buffer = 0;
-            }
-            else
-            {
-                memmove( p_sys->p_buffer, &p_sys->p_buffer[frame.bytesconsumed],
-                         p_sys->i_buffer );
-            }
+            memmove( p_sys->p_buffer, &p_sys->p_buffer[frame.bytesconsumed],
+                     p_sys->i_buffer );
         }
 
         return p_out;
     }
+    else
+    {
+        /* Drop byte of padding */
+        p_sys->i_buffer = 0;
+    }
 
     block_Release( p_block );
     return NULL;
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index b8c0c60..49b7516 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -2,7 +2,7 @@
  * SSA/ASS subtitle decoder using libass.
  *****************************************************************************
  * Copyright (C) 2008-2009 VLC authors and VideoLAN
- * $Id: dc247f419aaf7db703091c6d21095b893205e9b7 $
+ * $Id: 8e32d64f9010ff50428662094c0c1d4db22a8a67 $
  *
  * Authors: Laurent Aimar <fenrir@videolan.org>
  *
@@ -394,15 +394,13 @@ static int SubpictureValidate( subpicture_t *p_subpic,
     video_format_t fmt = *p_fmt_dst;
     fmt.i_chroma         = VLC_CODEC_RGBA;
     fmt.i_bits_per_pixel = 0;
-    fmt.i_visible_width  = fmt.i_width;
-    fmt.i_visible_height = fmt.i_height;
     fmt.i_x_offset       = 0;
     fmt.i_y_offset       = 0;
     if( b_fmt_src || b_fmt_dst )
     {
-        ass_set_frame_size( p_sys->p_renderer, fmt.i_width, fmt.i_height );
-        const double src_ratio = (double)p_fmt_src->i_width / p_fmt_src->i_height;
-        const double dst_ratio = (double)p_fmt_dst->i_width / p_fmt_dst->i_height;
+        ass_set_frame_size( p_sys->p_renderer, fmt.i_visible_width, fmt.i_visible_height );
+        const double src_ratio = (double)p_fmt_src->i_visible_width / p_fmt_src->i_visible_height;
+        const double dst_ratio = (double)p_fmt_dst->i_visible_width / p_fmt_dst->i_visible_height;
         ass_set_aspect_ratio( p_sys->p_renderer, dst_ratio / src_ratio, 1 );
         p_sys->fmt = fmt;
     }
@@ -438,8 +436,8 @@ static void SubpictureUpdate( subpicture_t *p_subpic,
     ASS_Image *p_img = p_subpic->updater.p_sys->p_img;
 
     /* */
-    p_subpic->i_original_picture_height = fmt.i_height;
-    p_subpic->i_original_picture_width = fmt.i_width;
+    p_subpic->i_original_picture_height = fmt.i_visible_height;
+    p_subpic->i_original_picture_width = fmt.i_visible_width;
 
     /* XXX to improve efficiency we merge regions that are close minimizing
      * the lost surface.
diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c
index 5ca44d0..54bbaaa 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: e3dad879f32c7d1ab1041ce23a33a834819943e7 $
+ * $Id: e040133d96548037b9ddd19f0d3f5221c41f178b $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Henri Fallon <henri@videolan.org>
@@ -434,13 +434,6 @@ 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;
 
-        if( p_sys->i_chans_to_reorder )
-        {
-            aout_ChannelReorder( p_block->p_buffer, p_block->i_buffer,
-                                 p_sys->i_chans_to_reorder, p_sys->pi_chan_table,
-                                 p_dec->fmt_out.i_codec );
-        }
-
         switch( p_sys->i_type )
         {
         case LPCM_WIDI:
@@ -457,6 +450,13 @@ static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
             break;
         }
 
+        if( p_sys->i_chans_to_reorder )
+        {
+            aout_ChannelReorder( p_aout_buffer->p_buffer, p_aout_buffer->i_buffer,
+                                 p_sys->i_chans_to_reorder, p_sys->pi_chan_table,
+                                 p_dec->fmt_out.i_codec );
+        }
+
         block_Release( p_block );
         return p_aout_buffer;
     }
diff --git a/modules/codec/mft.c b/modules/codec/mft.c
index 143a308..89567bd 100644
--- a/modules/codec/mft.c
+++ b/modules/codec/mft.c
@@ -172,7 +172,9 @@ static const pair_format_guid video_format_table[] =
     { 0, NULL }
 };
 
+#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 4
 DEFINE_GUID(MFAudioFormat_Dolby_AC3, 0xe06d802c, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea);
+#endif
 /*
  * We cannot use the FOURCC code for audio either since the
  * WAVE_FORMAT value is used to create the GUID.
diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c
index 8178553..a816e59 100644
--- a/modules/codec/schroedinger.c
+++ b/modules/codec/schroedinger.c
@@ -1548,6 +1548,10 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic )
                      * is appended to the sequence header to allow guard
                      * against poor streaming servers */
                     /* XXX, should this be done using the packetizer ? */
+
+                    if( len > UINT32_MAX - sizeof( eos ) )
+                        return NULL;
+
                     p_enc->fmt_out.p_extra = malloc( len + sizeof( eos ) );
                     if( !p_enc->fmt_out.p_extra )
                         return NULL;
diff --git a/modules/codec/scte27.c b/modules/codec/scte27.c
index 6b58eed..6954124 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: a348da5a9268dd416c13156ddd67360110ee4411 $
+ * $Id: 527e4e45048217fcb2e2157928c02036ef37d00a $
  *
  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *
@@ -252,7 +252,9 @@ static subpicture_region_t *DecodeSimpleBitmap(decoder_t *dec,
     video_format_t fmt = {
         .i_chroma = VLC_CODEC_YUVP,
         .i_width = frame_h,
+        .i_visible_width = frame_h,
         .i_height = frame_v,
+        .i_visible_height = frame_v,
         .i_sar_num = 0, /* Use video AR */
         .i_sar_den = 1,
         .p_palette = &palette,
diff --git a/modules/codec/vpx.c b/modules/codec/vpx.c
index ac7d8d7..1707e72 100644
--- a/modules/codec/vpx.c
+++ b/modules/codec/vpx.c
@@ -103,8 +103,10 @@ static picture_t *Decode(decoder_t *dec, block_t **pp_block)
 
     const void *iter = NULL;
     struct vpx_image *img = vpx_codec_get_frame(ctx, &iter);
-    if (!img)
+    if (!img) {
+        free(pkt_pts);
         return NULL;
+    }
 
     /* fetches back the PTS */
     pkt_pts = img->user_priv;
diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index d37c27e..872269a 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -2,7 +2,7 @@
  * x264.c: h264 video encoder
  *****************************************************************************
  * Copyright (C) 2004-2010 the VideoLAN team
- * $Id: b7778c18f9b3d159ff30c4a3f1edf5eae8b98e6a $
+ * $Id: be5d0006deaba92a6532fa2cfdbd75ccd5f04cf4 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Ilkka Ollakka <ileoo (at)videolan org>
@@ -1150,8 +1150,8 @@ static int  Open ( vlc_object_t *p_this )
        {
            p_sys->param.analyse.i_me_method = X264_ME_TESA;
        }
-       free( psz_val );
     }
+    free( psz_val );
 
     i_val = var_GetInteger( p_enc, SOUT_CFG_PREFIX "merange" );
     if( i_val >= 0 && i_val <= 64 && i_val != 16 )
diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index 364983d..37c7935 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -2,7 +2,7 @@
  * zvbi.c : VBI and Teletext PES demux and decoder using libzvbi
  *****************************************************************************
  * Copyright (C) 2007, M2X
- * $Id: abcd27f5355953f68a13b4e7d6f848d58f7aa4c1 $
+ * $Id: b967f00567a112ed2ad6b599c677f05e13ddc6ee $
  *
  * Authors: Derk-Jan Hartman <djhartman at m2x dot nl>
  *          Jean-Paul Saman <jpsaman at m2x dot nl>
@@ -331,17 +331,20 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
 
             if( ( i_id == 0x02 || i_id == 0x03 ) && i_size >= 44 && i_lines < MAX_SLICES )
             {
-                unsigned line_offset  = p_block->p_buffer[2] & 0x1f;
-                unsigned field_parity = p_block->p_buffer[2] & 0x20;
-
-                p_sliced[i_lines].id = VBI_SLICED_TELETEXT_B;
-                if( line_offset > 0 )
-                    p_sliced[i_lines].line = line_offset + (field_parity ? 0 : 313);
-                else
-                    p_sliced[i_lines].line = 0;
-                for( int i = 0; i < 42; i++ )
-                    p_sliced[i_lines].data[i] = vbi_rev8( p_block->p_buffer[4 + i] );
-                i_lines++;
+                if(p_block->p_buffer[3] == 0xE4 )    /* framing_code */
+                {
+                    unsigned line_offset  = p_block->p_buffer[2] & 0x1f;
+                    unsigned field_parity = p_block->p_buffer[2] & 0x20;
+
+                    p_sliced[i_lines].id = VBI_SLICED_TELETEXT_B;
+                    if( line_offset > 0 )
+                        p_sliced[i_lines].line = line_offset + (field_parity ? 0 : 313);
+                    else
+                        p_sliced[i_lines].line = 0;
+                    for( int i = 0; i < 42; i++ )
+                        p_sliced[i_lines].data[i] = vbi_rev8( p_block->p_buffer[4 + i] );
+                    i_lines++;
+                }
             }
 
             p_block->i_buffer -= 2 + i_size;
@@ -522,6 +525,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
         fmt.i_width = fmt.i_visible_width = i_columns * 12;
         fmt.i_height = fmt.i_visible_height = i_rows * 10;
         fmt.i_bits_per_pixel = 32;
+        fmt.i_sar_num = fmt.i_sar_den = 0; /* let the vout set the correct AR */
     }
     fmt.i_x_offset = fmt.i_y_offset = 0;
 
diff --git a/modules/control/gestures.c b/modules/control/gestures.c
index 5bb1448..a9d058d 100644
--- a/modules/control/gestures.c
+++ b/modules/control/gestures.c
@@ -2,7 +2,7 @@
  * gestures.c: control vlc with mouse gestures
  *****************************************************************************
  * Copyright (C) 2004-2009 the VideoLAN team
- * $Id: 2e50eecc1a99e5c564614f1cae230b3c6701e79d $
+ * $Id: 3aa2ff27990b680533a485f4c28856e2b3ad5be9 $
  *
  * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
  *
@@ -419,6 +419,11 @@ static int MovedEvent( vlc_object_t *p_this, char const *psz_var,
                 p_sys->i_pattern |= pattern << ( p_sys->i_num_gestures * 4 );
                 p_sys->i_num_gestures++;
             }
+            else if( p_sys->i_num_gestures == 0 )
+            {
+                p_sys->i_pattern = pattern;
+                p_sys->i_num_gestures++;
+            }
         }
 
     }
diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 0c6ba0b..b133410 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -430,7 +430,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         int i_ret;
         if ( i >= 0 )
         {
-            i++; /* video/audio-es variable starts 0 */
             msg_Dbg( p_demux, "Requesting access to enable stream %d", i );
             i_ret = stream_Control( p_demux->s, STREAM_SET_PRIVATE_ID_STATE, i, true );
         }
@@ -1500,6 +1499,8 @@ static int DemuxInit( demux_t *p_demux )
                     es_format_Copy( tk->p_fmt, &fmt );
             }
 
+            fmt.i_id = tk->p_sp->i_stream_number;
+
             tk->p_es = es_out_Add( p_demux->out, &fmt );
 
             if( !stream_Control( p_demux->s, STREAM_GET_PRIVATE_ID_STATE,
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 4e19878..e407117 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -2,7 +2,7 @@
  * matroska_segment_parse.cpp : matroska demuxer
  *****************************************************************************
  * Copyright (C) 2003-2010 VLC authors and VideoLAN
- * $Id: 036403b9e29eb89cf10ace3768b68d561a6f9eca $
+ * $Id: 0aa5924173a22fc4497821121265c6be174ce81a $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Steve Lhomme <steve.lhomme@free.fr>
@@ -1369,6 +1369,8 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
     else if( !strncmp( p_tk->psz_codec, "V_VP9", 5 ) )
     {
         p_tk->fmt.i_codec = VLC_CODEC_VP9;
+        p_tk->fmt.b_packetized = false;
+        p_tk->b_pts_only = true;
         fill_extra_data( p_tk, 0 );
     }
     else if( !strncmp( p_tk->psz_codec, "V_MPEG4", 7 ) )
@@ -1496,6 +1498,12 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
     }
     else if( !strcmp( p_tk->psz_codec, "A_AC3" ) )
     {
+        // the AC-3 default duration cannot be trusted, see #8512
+        if ( p_tk->fmt.audio.i_rate == 8000 )
+        {
+            p_tk->b_no_duration = true;
+            p_tk->i_default_duration = 0;
+        }
         p_tk->fmt.i_codec = VLC_CODEC_A52;
     }
     else if( !strcmp( p_tk->psz_codec, "A_EAC3" ) )
@@ -1681,7 +1689,10 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
                     p_tk->fmt.audio.i_blockalign = hton16(priv->sub_packet_size);
                 }
                 else if( !strcmp( p_tk->psz_codec, "A_REAL/ATRC" ) )
+                {
                     p_tk->fmt.i_codec = VLC_CODEC_ATRAC3;
+                    p_tk->fmt.audio.i_blockalign = hton16(priv->sub_packet_size);
+                }
                 else if( !strcmp( p_tk->psz_codec, "A_REAL/28_8" ) )
                     p_tk->fmt.i_codec = VLC_CODEC_RA_288;
                 /* FIXME RALF and SIPR */
diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
index daa5b5f..4a6aa1e 100644
--- a/modules/demux/mkv/mkv.hpp
+++ b/modules/demux/mkv/mkv.hpp
@@ -2,7 +2,7 @@
  * mkv.hpp : matroska demuxer
  *****************************************************************************
  * Copyright (C) 2003-2005, 2008 VLC authors and VideoLAN
- * $Id: 063891462fe164830b02a39675f74bbefd5c2f58 $
+ * $Id: 36938e84f5d1900c5a2706719ceaac70b8af0cb1 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Steve Lhomme <steve.lhomme@free.fr>
@@ -45,9 +45,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 
-#ifdef HAVE_TIME_H
-#   include <time.h>                                               /* time() */
-#endif
+#include <time.h>
 
 #include <vlc_meta.h>
 #include <vlc_charset.h>
diff --git a/modules/demux/mkv/stream_io_callback.cpp b/modules/demux/mkv/stream_io_callback.cpp
index 73cfccf..ba749c5 100644
--- a/modules/demux/mkv/stream_io_callback.cpp
+++ b/modules/demux/mkv/stream_io_callback.cpp
@@ -2,7 +2,7 @@
  * stream_io_callback.cpp : matroska demuxer
  *****************************************************************************
  * Copyright (C) 2003-2004, 2010 VLC authors and VideoLAN
- * $Id: 5b539deb708b568dc4ae7848307cc74c5c5226f3 $
+ * $Id: 7af087182118601d3c4d20e2f770882491703676 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Steve Lhomme <steve.lhomme@free.fr>
@@ -47,6 +47,7 @@ uint32 vlc_stream_io_callback::read( void *p_buffer, size_t i_size )
 void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode )
 {
     int64_t i_pos, i_size;
+    int64_t i_current = stream_Tell( s );
 
     switch( mode )
     {
@@ -57,10 +58,13 @@ void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode )
             i_pos = stream_Size( s ) - i_offset;
             break;
         default:
-            i_pos= stream_Tell( s ) + i_offset;
+            i_pos= i_current + i_offset;
             break;
     }
 
+    if(i_pos == i_current)
+        return;
+
     if( i_pos < 0 || ( ( i_size = stream_Size( s ) ) != 0 && i_pos >= i_size ) )
     {
         mb_eof = true;
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 19e84d3..3912e7e 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2667,6 +2667,9 @@ static int MP4_ReadBox_name( stream_t *p_stream, MP4_Box_t *p_box )
 {
     MP4_READBOX_ENTER( MP4_Box_data_name_t );
 
+    if( p_box->i_size < 8 || p_box->i_size > SIZE_MAX )
+        MP4_READBOX_EXIT( 0 );
+
     p_box->data.p_name->psz_text = malloc( p_box->i_size + 1 - 8 ); /* +\0, -name, -size */
     if( p_box->data.p_name->psz_text == NULL )
         MP4_READBOX_EXIT( 0 );
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 8b9bf6c..7a52103 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -214,7 +214,7 @@ static inline int64_t MP4_TrackGetDTS( demux_t *p_demux, mp4_track_t *p_track )
     unsigned int i_sample = p_track->i_sample - chunk.i_sample_first;
     int64_t i_dts = chunk.i_first_dts;
 
-    while( i_sample > 0 )
+    while( i_sample > 0 && i_index < chunk.i_entries_dts )
     {
         if( i_sample > chunk.p_sample_count_dts[i_index] )
         {
@@ -269,7 +269,7 @@ static inline int64_t MP4_TrackGetPTSDelta( demux_t *p_demux, mp4_track_t *p_tra
     if( ck->p_sample_count_pts == NULL || ck->p_sample_offset_pts == NULL )
         return -1;
 
-    for( i_index = 0;; i_index++ )
+    for( i_index = 0; i_index < ck->i_entries_pts ; i_index++ )
     {
         if( i_sample < ck->p_sample_count_pts[i_index] )
             return ck->p_sample_offset_pts[i_index] * CLOCK_FREQ /
@@ -1657,7 +1657,7 @@ static void LoadChapter( demux_t  *p_demux )
             {
                 mp4_track_t *tk = &p_sys->track[j];
                 if( tk->b_ok && tk->i_track_ID == p_chap->i_track_ID[i] &&
-                    tk->fmt.i_cat == SPU_ES && tk->fmt.i_codec == VLC_CODEC_SUBT )
+                    tk->fmt.i_cat == SPU_ES && tk->fmt.i_codec == VLC_CODEC_TX3G )
                     break;
             }
             if( j < p_sys->i_tracks )
@@ -1715,8 +1715,10 @@ static int TrackCreateChunksIndex( demux_t *p_demux,
         ck->i_offset = BOXDATA(p_co64)->i_chunk_offset[i_chunk];
 
         ck->i_first_dts = 0;
+        ck->i_entries_dts = 0;
         ck->p_sample_count_dts = NULL;
         ck->p_sample_delta_dts = NULL;
+        ck->i_entries_pts = 0;
         ck->p_sample_count_pts = NULL;
         ck->p_sample_offset_pts = NULL;
     }
@@ -1787,7 +1789,7 @@ static int xTTS_CountEntries( demux_t *p_demux, uint32_t *pi_entry /* out */,
         if ( i_array_offset >= i_table_count )
         {
             msg_Err( p_demux, "invalid index counting total samples %u %u", i_array_offset,  i_table_count );
-            return VLC_EGENERIC;
+            return VLC_ENOVAR;
         }
 
         if ( i_index_samples_left )
@@ -1923,7 +1925,7 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
         for( uint32_t i_chunk = 0; i_chunk < p_demux_track->i_chunk_count; i_chunk++ )
         {
             mp4_chunk_t *ck = &p_demux_track->chunk[i_chunk];
-            uint32_t i_entry, i_sample_count;
+            uint32_t i_sample_count;
 
             /* save first dts */
             ck->i_first_dts = i_next_dts;
@@ -1931,29 +1933,32 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
 
             /* count how many entries are needed for this chunk
              * for p_sample_delta_dts and p_sample_count_dts */
-            i_entry = 0;
+            ck->i_entries_dts = 0;
 
-            int i_ret = xTTS_CountEntries( p_demux, &i_entry, i_index,
+            int i_ret = xTTS_CountEntries( p_demux, &ck->i_entries_dts, i_index,
                                            i_current_index_samples_left,
                                            ck->i_sample_count,
                                            stts->pi_sample_count,
                                            stts->i_entry_count );
-            if ( i_ret != VLC_SUCCESS )
+            if ( i_ret == VLC_EGENERIC )
                 return i_ret;
 
             /* allocate them */
-            ck->p_sample_count_dts = calloc( i_entry, sizeof( uint32_t ) );
-            ck->p_sample_delta_dts = calloc( i_entry, sizeof( uint32_t ) );
+            ck->p_sample_count_dts = calloc( ck->i_entries_dts, sizeof( uint32_t ) );
+            ck->p_sample_delta_dts = calloc( ck->i_entries_dts, sizeof( uint32_t ) );
             if( !ck->p_sample_count_dts || !ck->p_sample_delta_dts )
             {
-                msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, i_entry );
+                free( ck->p_sample_count_dts );
+                free( ck->p_sample_delta_dts );
+                msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, ck->i_entries_dts );
+                ck->i_entries_dts = 0;
                 return VLC_ENOMEM;
             }
 
             /* now copy */
             i_sample_count = ck->i_sample_count;
 
-            for( uint32_t i = 0; i < i_entry; i++ )
+            for( uint32_t i = 0; i < ck->i_entries_dts; i++ )
             {
                 if ( i_current_index_samples_left )
                 {
@@ -1965,7 +1970,7 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
                         i_next_dts += ck->p_sample_count_dts[i] * stts->pi_sample_delta[i_index];
                         i_current_index_samples_left -= i_sample_count;
                         i_sample_count = 0;
-                        assert( i == i_entry - 1 );
+                        assert( i == ck->i_entries_dts - 1 );
                         break;
                     }
                     else
@@ -1989,7 +1994,7 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
                         i_next_dts += ck->p_sample_count_dts[i] * stts->pi_sample_delta[i_index];
                         i_current_index_samples_left = stts->pi_sample_count[i_index] - i_sample_count;
                         i_sample_count = 0;
-                        assert( i == i_entry - 1 );
+                        assert( i == ck->i_entries_dts - 1 );
                         // keep building from same index
                     }
                     else
@@ -2025,32 +2030,35 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
         for( uint32_t i_chunk = 0; i_chunk < p_demux_track->i_chunk_count; i_chunk++ )
         {
             mp4_chunk_t *ck = &p_demux_track->chunk[i_chunk];
-            uint32_t i_entry, i_sample_count;
+            uint32_t i_sample_count;
 
             /* count how many entries are needed for this chunk
              * for p_sample_offset_pts and p_sample_count_pts */
-            i_entry = 0;
-            int i_ret = xTTS_CountEntries( p_demux, &i_entry, i_index,
+            ck->i_entries_pts = 0;
+            int i_ret = xTTS_CountEntries( p_demux, &ck->i_entries_pts, i_index,
                                            i_current_index_samples_left,
                                            ck->i_sample_count,
                                            ctts->pi_sample_count,
                                            ctts->i_entry_count );
-            if ( i_ret != VLC_SUCCESS )
+            if ( i_ret == VLC_EGENERIC )
                 return i_ret;
 
             /* allocate them */
-            ck->p_sample_count_pts = calloc( i_entry, sizeof( uint32_t ) );
-            ck->p_sample_offset_pts = calloc( i_entry, sizeof( int32_t ) );
+            ck->p_sample_count_pts = calloc( ck->i_entries_pts, sizeof( uint32_t ) );
+            ck->p_sample_offset_pts = calloc( ck->i_entries_pts, sizeof( int32_t ) );
             if( !ck->p_sample_count_pts || !ck->p_sample_offset_pts )
             {
-                msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, i_entry );
+                free( ck->p_sample_count_pts );
+                free( ck->p_sample_offset_pts );
+                msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, ck->i_entries_pts );
+                ck->i_entries_pts = 0;
                 return VLC_ENOMEM;
             }
 
             /* now copy */
             i_sample_count = ck->i_sample_count;
 
-            for( uint32_t i = 0; i < i_entry; i++ )
+            for( uint32_t i = 0; i < ck->i_entries_pts; i++ )
             {
                 if ( i_current_index_samples_left )
                 {
@@ -2060,7 +2068,7 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
                         ck->p_sample_offset_pts[i] = ctts->pi_sample_offset[i_index];
                         i_current_index_samples_left -= i_sample_count;
                         i_sample_count = 0;
-                        assert( i == i_entry - 1 );
+                        assert( i == ck->i_entries_pts - 1 );
                         break;
                     }
                     else
@@ -2080,7 +2088,7 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
                         ck->p_sample_offset_pts[i] = ctts->pi_sample_offset[i_index];
                         i_current_index_samples_left = ctts->pi_sample_count[i_index] - i_sample_count;
                         i_sample_count = 0;
-                        assert( i == i_entry - 1 );
+                        assert( i == ck->i_entries_pts - 1 );
                         // keep building from same index
                     }
                     else
@@ -3051,6 +3059,7 @@ static int TrackGotoChunkSample( demux_t *p_demux, mp4_track_t *p_track,
     }
 
     p_track->i_chunk    = i_chunk;
+    p_track->chunk[i_chunk].i_sample = i_sample - p_track->chunk[i_chunk].i_sample_first;
     p_track->i_sample   = i_sample;
 
     return p_track->b_selected ? VLC_SUCCESS : VLC_EGENERIC;
@@ -3151,7 +3160,6 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
         case( ATOM_text ):
         case( ATOM_subp ):
         case( ATOM_sbtl ):
-            p_track->fmt.i_codec = VLC_CODEC_TX3G;
             p_track->fmt.i_cat = SPU_ES;
             break;
 
@@ -3486,6 +3494,9 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
             (*pi_nb_samples)++;
             if ( p_track->i_sample_size == 0 )
                 i_size += p_track->p_sample_size[i];
+            /* broken stsz sample size == 1 */
+            else if ( p_track->i_sample_size == 1 && p_soun->i_samplesize > p_track->i_sample_size * 8 )
+                i_size += p_soun->i_samplesize * p_soun->i_channelcount / 8;
             else
                 i_size += p_track->i_sample_size;
             if ( *pi_nb_samples == QT_V0_MAX_SAMPLES )
@@ -3510,7 +3521,8 @@ static uint64_t MP4_TrackGetPos( mp4_track_t *p_track )
             p_track->p_sample->data.p_sample_soun;
 
         if( p_track->fmt.i_cat != AUDIO_ES || p_soun->i_qt_version == 0 ||
-            p_track->fmt.audio.i_blockalign <= 1 )
+            p_track->fmt.audio.i_blockalign <= 1 ||
+            p_soun->i_sample_per_packet * p_soun->i_bytes_per_frame == 0 )
         {
             i_pos += ( p_track->i_sample -
                        p_track->chunk[p_track->i_chunk].i_sample_first ) *
@@ -4053,11 +4065,17 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
     ret->p_sample_delta_dts = calloc( ret->i_sample_count, sizeof( uint32_t ) );
 
     if( !ret->p_sample_count_dts || !ret->p_sample_delta_dts )
+    {
+        free( ret->p_sample_count_dts );
+        free( ret->p_sample_delta_dts );
         return VLC_ENOMEM;
+    }
+    ret->i_entries_dts = ret->i_sample_count;
 
     ret->p_sample_count_pts = calloc( ret->i_sample_count, sizeof( uint32_t ) );
     if( !ret->p_sample_count_pts )
         return VLC_ENOMEM;
+    ret->i_entries_pts = ret->i_sample_count;
 
     if( p_trun_data->i_flags & MP4_TRUN_SAMPLE_TIME_OFFSET )
     {
diff --git a/modules/demux/mp4/mp4.h b/modules/demux/mp4/mp4.h
index 813dfd8..a3064f0 100644
--- a/modules/demux/mp4/mp4.h
+++ b/modules/demux/mp4/mp4.h
@@ -47,9 +47,12 @@ typedef struct
     /* with this we can calculate dts/pts without waste memory */
     uint64_t     i_first_dts;   /* DTS of the first sample */
     uint64_t     i_last_dts;    /* DTS of the last sample */
+
+    uint32_t     i_entries_dts;
     uint32_t     *p_sample_count_dts;
     uint32_t     *p_sample_delta_dts;   /* dts delta */
 
+    uint32_t     i_entries_pts;
     uint32_t     *p_sample_count_pts;
     int32_t      *p_sample_offset_pts;  /* pts-dts */
 
diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c
index 955cf39..13ca5fe 100644
--- a/modules/demux/mpc.c
+++ b/modules/demux/mpc.c
@@ -2,7 +2,7 @@
  * mpc.c : MPC stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 the VideoLAN team
- * $Id: 989eca49c7be41b2768563f98eb64ff69b0a2dbb $
+ * $Id: 838f7fe6ef6933b1c968e1447623834f49626341 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr.com>
  *
@@ -192,21 +192,33 @@ static int Open( vlc_object_t * p_this )
     fmt.audio.i_bitspersample = 32;
     fmt.i_bitrate = fmt.i_bitrate * fmt.audio.i_channels *
                     fmt.audio.i_bitspersample;
+
+#ifdef HAVE_MPC_MPCDEC_H
+#   define CONVERT_PEAK( mpc_peak ) (pow( 10, (mpc_peak) / 256.0 / 20.0 ) / 32767.0)
+#   define CONVERT_GAIN( mpc_gain ) (MPC_OLD_GAIN_REF - (mpc_gain) / 256.0)
+#else
+#   define CONVERT_PEAK( mpc_peak ) ((mpc_peak) / 32767.0)
+#   define CONVERT_GAIN( mpc_gain ) ((mpc_gain) / 100.0)
+#endif
+
     if( p_sys->info.peak_title > 0 )
     {
         fmt.audio_replay_gain.pb_peak[AUDIO_REPLAY_GAIN_TRACK] = true;
-        fmt.audio_replay_gain.pf_peak[AUDIO_REPLAY_GAIN_TRACK] = (float)p_sys->info.peak_title / 32767.0;
+        fmt.audio_replay_gain.pf_peak[AUDIO_REPLAY_GAIN_TRACK] = (float) CONVERT_PEAK( p_sys->info.peak_title );
         fmt.audio_replay_gain.pb_gain[AUDIO_REPLAY_GAIN_TRACK] = true;
-        fmt.audio_replay_gain.pf_gain[AUDIO_REPLAY_GAIN_TRACK] = (float)p_sys->info.gain_title / 100.0;
+        fmt.audio_replay_gain.pf_gain[AUDIO_REPLAY_GAIN_TRACK] = (float) CONVERT_GAIN( p_sys->info.gain_title );
     }
     if( p_sys->info.peak_album > 0 )
     {
         fmt.audio_replay_gain.pb_peak[AUDIO_REPLAY_GAIN_ALBUM] = true;
-        fmt.audio_replay_gain.pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = (float)p_sys->info.peak_album / 32767.0;
+        fmt.audio_replay_gain.pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = (float) CONVERT_PEAK( p_sys->info.peak_album );
         fmt.audio_replay_gain.pb_gain[AUDIO_REPLAY_GAIN_ALBUM] = true;
-        fmt.audio_replay_gain.pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = (float)p_sys->info.gain_album / 100.0;
+        fmt.audio_replay_gain.pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = (float) CONVERT_GAIN( p_sys->info.gain_album );
     }
 
+#undef CONVERT_GAIN
+#undef CONVERT_PEAK
+
     p_sys->p_es = es_out_Add( p_demux->out, &fmt );
     if( !p_sys->p_es )
         goto error;
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index d06b41b..ae7ed7b 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -2,7 +2,7 @@
  * es.c : Generic audio ES input module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2008 VLC authors and VideoLAN
- * $Id: 5f10f692122e8da24967daa27772cf4a2d051641 $
+ * $Id: 819b89be9b54feb03ccee5c70dc72aa9f286699b $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -612,7 +612,12 @@ static int GenericProbe( demux_t *p_demux, int64_t *pi_offset,
             for( int t = 0; t < 1 + !!b_wav; t++ )
             {
                 if( t == 1 )
+                {
+                    if(!i_samples)
+                        break;
                     i_size = i_samples * 2 * 2;
+                }
+
                 if( i_skip + i_check_size + i_size <= i_peek )
                 {
                     b_ok = pf_check( &p_peek[i_skip+i_size], NULL ) >= 0;
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index fd3addf..aba3775 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -2,7 +2,7 @@
  * ogg.c : ogg stream demux module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2007 VLC authors and VideoLAN
- * $Id: 5fd8e9aa468de00df524a3559cc718723db2f0fc $
+ * $Id: 9982367c0b0a171c5daf353dd095a9de6e5b93c6 $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Andre Pang <Andre.Pang@csiro.au> (Annodex support)
@@ -302,6 +302,7 @@ static int Demux( demux_t * p_demux )
             }
             Ogg_EndOfStream( p_demux );
             p_sys->b_chained_boundary = true;
+            p_sys->i_nzpcr_offset = p_sys->i_nzlast_pts;
         }
 
         if( Ogg_BeginningOfStream( p_demux ) != VLC_SUCCESS )
@@ -397,8 +398,7 @@ static int Demux( demux_t * p_demux )
             {
                 msg_Err( p_demux, "Broken Ogg stream (serialno) mismatch" );
                 Ogg_ResetStream( p_stream );
-                p_sys->i_nzpcr_offset = (p_sys->i_pcr >= VLC_TS_INVALID) ?
-                                         p_sys->i_pcr - VLC_TS_0 : 0;
+                p_sys->i_nzpcr_offset = p_sys->i_nzlast_pts;
                 ogg_stream_reset_serialno( &p_stream->os, ogg_page_serialno( &p_sys->current_page ) );
             }
 
@@ -574,7 +574,9 @@ static int Demux( demux_t * p_demux )
                     if ( p_stream->fmt.i_cat == VIDEO_ES )
                     {
                         pagestamp = pagestamp - ( CLOCK_FREQ / p_stream->f_rate );
-                        p_block->i_pts = p_sys->i_nzpcr_offset + pagestamp;
+                        if( pagestamp < 0 )
+                            pagestamp = 0;
+                        p_block->i_pts = VLC_TS_0 + p_sys->i_nzpcr_offset + pagestamp;
                         b_fixed = true;
                     }
                 }
@@ -1099,8 +1101,19 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
                 temp = temp->p_next;
                 tosend->p_next = NULL;
 
-                DemuxDebug( msg_Dbg( p_demux, "block sent from preparse > pts %"PRId64" spcr %"PRId64" pcr %"PRId64,
-                         tosend->i_pts, p_stream->i_pcr, p_ogg->i_pcr ); )
+                if( tosend->i_pts < VLC_TS_0 )
+                {
+                    /* Don't send metadata from chained streams */
+                    block_Release( tosend );
+                    continue;
+                }
+                else if( tosend->i_dts < VLC_TS_0 )
+                {
+                    tosend->i_dts = tosend->i_pts;
+                }
+
+                DemuxDebug( msg_Dbg( p_demux, "block sent from preparse > dts %"PRId64" pts %"PRId64" spcr %"PRId64" pcr %"PRId64,
+                         tosend->i_dts, tosend->i_pts, p_stream->i_pcr, p_ogg->i_pcr ); )
                 es_out_Send( p_demux->out, p_stream->p_es, tosend );
 
                 if ( p_ogg->i_pcr < VLC_TS_0 && i_firstpts > VLC_TS_INVALID )
@@ -1114,6 +1127,7 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
 
         if ( p_block )
         {
+            p_ogg->i_nzlast_pts = (p_block->i_pts > VLC_TS_INVALID) ? p_block->i_pts - VLC_TS_0 : 0;
             DemuxDebug( msg_Dbg( p_demux, "block sent directly > pts %"PRId64" spcr %"PRId64" pcr %"PRId64,
                      p_block->i_pts, p_stream->i_pcr, p_ogg->i_pcr ) );
             es_out_Send( p_demux->out, p_stream->p_es, p_block );
@@ -1394,6 +1408,13 @@ static void Ogg_DecodePacket( demux_t *p_demux,
         i_header_len = (*p_oggpacket->packet & PACKET_LEN_BITS01) >> 6;
         i_header_len |= (*p_oggpacket->packet & PACKET_LEN_BITS2) << 1;
 
+        if( i_header_len >= p_oggpacket->bytes )
+        {
+            msg_Dbg( p_demux, "discarding invalid packet" );
+            block_Release( p_block );
+            return;
+        }
+
         if( p_stream->fmt.i_codec == VLC_CODEC_SUBT)
         {
             /* But with subtitles we need to retrieve the duration first */
@@ -2056,8 +2077,8 @@ static void Ogg_CreateES( demux_t *p_demux )
                 p_stream->b_reinit = false;
                 p_stream->b_initializing = false;
                 p_stream->i_pre_skip = 0;
-                bool b_resetdecoder = Ogg_LogicalStreamResetEsFormat( p_demux, p_stream );
                 es_format_Copy( &p_stream->fmt_old, &p_old_stream->fmt );
+                bool b_resetdecoder = Ogg_LogicalStreamResetEsFormat( p_demux, p_stream );
 
                 p_old_stream->p_es = NULL;
                 p_old_stream = NULL;
diff --git a/modules/demux/ogg.h b/modules/demux/ogg.h
index ff6d538..c30b799 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -179,6 +179,7 @@ struct demux_sys_t
      * the sub-streams */
     mtime_t i_pcr;
     mtime_t i_nzpcr_offset;
+    mtime_t i_nzlast_pts;
     /* informative only */
     mtime_t i_pcr_jitter;
     int64_t i_access_delay;
diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index 5fa809c..6a3e31b 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * asx.c : ASX playlist format import
  *****************************************************************************
- * Copyright (C) 2005-2013 VLC authors and VideoLAN
- * $Id: 099cc5e08f4a2bac6eff1628ef9baab1158b4063 $
+ * Copyright (C) 2005-2006 VLC authors and VideoLAN
+ * $Id: 50dedfa339c104af8763369e8955c12081f2e912 $
  *
  * Authors: Derk-Jan Hartman <hartman at videolan dot org>
  *
@@ -21,8 +21,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-/* See also:
- * http://msdn.microsoft.com/en-us/library/windows/desktop/dd564668.aspx
+/* See also: http://msdn.microsoft.com/library/en-us/wmplay10/mmp_sdk/windowsmediametafilereference.asp
  */
 
 /*****************************************************************************
@@ -34,15 +33,19 @@
 
 #include <vlc_common.h>
 #include <vlc_demux.h>
-#include <vlc_xml.h>
-#include <vlc_strings.h>
 
 #include <ctype.h>
-
+#include <vlc_charset.h>
 #include "playlist.h"
+#include <vlc_meta.h>
 
 struct demux_sys_t
 {
+    char    *psz_prefix;
+    char    *psz_data;
+    int64_t i_data_len;
+    bool b_utf8;
+    bool b_skip_ads;
 };
 
 /*****************************************************************************
@@ -50,408 +53,721 @@ struct demux_sys_t
  *****************************************************************************/
 static int Demux( demux_t *p_demux);
 
-static mtime_t ParseTime(xml_reader_t *p_xml_reader)
+static int StoreString( demux_t *p_demux, char **ppsz_string,
+                        const char *psz_source_start,
+                        const char *psz_source_end )
 {
-    char *psz_value = NULL;
-    char *psz_start = NULL;
-
-    const char *psz_node = NULL;
-    const char *psz_txt = NULL;
+    demux_sys_t *p_sys = p_demux->p_sys;
+    unsigned len = psz_source_end - psz_source_start;
 
-    int i_subfractions = -1;
+    free( *ppsz_string );
 
-    int i_subresult = 0;
-    mtime_t i_result = 0;
+    char *buf = *ppsz_string = malloc ((len * (1 + !p_sys->b_utf8)) + 1);
+    if (buf == NULL)
+        return VLC_ENOMEM;
 
-    do
+    if( p_sys->b_utf8 )
     {
-        psz_txt = xml_ReaderNextAttr( p_xml_reader, &psz_node );
+        memcpy (buf, psz_source_start, len);
+        (*ppsz_string)[len] = '\0';
+        EnsureUTF8 (*ppsz_string);
     }
-    while( psz_txt && strncasecmp( psz_txt, "VALUE", 5 ) );
-
-    psz_value = strdup( psz_node );
-    psz_start = psz_value;
-
-    while( *psz_value )
+    else
     {
-        if( isdigit( *psz_value ) )
-        {
-            i_subresult = i_subresult * 10;
-            i_subresult += *psz_value - '0';
-            if( i_subfractions != -1 )
-                i_subfractions++;
-        }
-        else if( *psz_value == ':' )
+        /* Latin-1 -> UTF-8 */
+        for (unsigned i = 0; i < len; i++)
         {
-            i_result += i_subresult;
-            i_result = i_result * 60;
-            i_subresult = 0;
-        }
-        else if( *psz_value == '.' )
-        {
-            i_subfractions = 0;
-            i_result += i_subresult;
-            i_subresult = 0;
+            unsigned char c = psz_source_start[i];
+            if (c & 0x80)
+            {
+                *buf++ = 0xc0 | (c >> 6);
+                *buf++ = 0x80 | (c & 0x3f);
+            }
+            else
+                *buf++ = c;
         }
-        psz_value++;
+        *buf++ = '\0';
 
+        buf = realloc (*ppsz_string, buf - *ppsz_string);
+        if( buf )
+            *ppsz_string = buf;
     }
-    if( i_subfractions == -1)
-        i_result += i_subresult;
-
-    /* Convert to microseconds */
-    if( i_subfractions == -1)
-        i_subfractions = 0;
-    while( i_subfractions < 6 )
-    {
-        i_subresult = i_subresult * 10;
-        i_subfractions++;
-    }
-    i_result = i_result * 1000000;
-    if( i_subfractions != -1)
-        i_result += i_subresult;
-
-    free( psz_start );
-    return i_result;
+    return VLC_SUCCESS;
 }
 
-static void ReadElement( xml_reader_t *p_xml_reader, char **ppsz_txt )
+static char *SkipBlanks(char *s, size_t i_strlen )
 {
-    const char *psz_node = NULL;
-
-    /* Read the text node */
-    xml_ReaderNextNode( p_xml_reader, &psz_node );
-    free( *ppsz_txt );
-    *ppsz_txt = strdup( psz_node );
-    resolve_xml_special_chars( *ppsz_txt );
-
-    /* Read the end element */
-    xml_ReaderNextNode( p_xml_reader, &psz_node );
-    /* TODO :
-     * Currently we don't check the agreement of start and end element
-     * This function is only used to read the element that cannot have child
-     * according to the reference.
-     */
+    while( i_strlen > 0 ) {
+        switch( *s )
+        {
+            case ' ':
+            case '\t':
+            case '\r':
+            case '\n':
+                --i_strlen;
+                ++s;
+                break;
+            default:
+                i_strlen = 0;
+        }
+    }
+    return s;
 }
 
-static bool PeekASX( demux_t *p_demux )
+static int ParseTime(char *s, size_t i_strlen)
 {
-    const uint8_t *p_peek;
-    return ( stream_Peek( p_demux->s, &p_peek, 12 ) == 12
-             && !memcmp( p_peek, "<asx version", 12 ) );
+    // need to parse hour:minutes:sec.fraction string
+    int result = 0;
+    int val;
+    const char *end = s + i_strlen;
+    // skip leading spaces if any
+    s = SkipBlanks(s, i_strlen);
+
+    val = 0;
+    while( (s < end) && isdigit((unsigned char)*s) )
+    {
+        int newval = val*10 + (*s - '0');
+        if( newval < val )
+        {
+            // overflow
+            val = 0;
+            break;
+        }
+        val = newval;
+        ++s;
+    }
+    result = val;
+    s = SkipBlanks(s, end-s);
+    if( *s == ':' )
+    {
+        ++s;
+        s = SkipBlanks(s, end-s);
+        result = result * 60;
+        val = 0;
+        while( (s < end) && isdigit((unsigned char)*s) )
+        {
+            int newval = val*10 + (*s - '0');
+            if( newval < val )
+            {
+                // overflow
+                val = 0;
+                break;
+            }
+            val = newval;
+            ++s;
+        }
+        result += val;
+        s = SkipBlanks(s, end-s);
+        if( *s == ':' )
+        {
+            ++s;
+            s = SkipBlanks(s, end-s);
+            result = result * 60;
+            val = 0;
+            while( (s < end) && isdigit((unsigned char)*s) )
+            {
+                int newval = val*10 + (*s - '0');
+                if( newval < val )
+                {
+                    // overflow
+                    val = 0;
+                    break;
+                }
+                val = newval;
+                ++s;
+            }
+            result += val;
+            // TODO: one day, we may need to parse fraction for sub-second resolution
+        }
+    }
+    return result;
 }
 
 /*****************************************************************************
  * Import_ASX: main import function
  *****************************************************************************/
-
 int Import_ASX( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
+    const uint8_t *p_peek;
+    CHECK_PEEK( p_peek, 10 );
+
+    // skip over possible leading empty lines and empty spaces
+    p_peek = (uint8_t *)SkipBlanks((char *)p_peek, 6);
 
-    if( demux_IsPathExtension( p_demux, ".asx" ) ||
-        demux_IsPathExtension( p_demux, ".wax" ) ||
-        demux_IsPathExtension( p_demux, ".wvx" ) ||
-        (
-          ( CheckContentType( p_demux->s, "video/x-ms-asf" ) ||
-            CheckContentType( p_demux->s, "audio/x-ms-wax" ) ) && PeekASX( p_demux )
-        ) ||
+    if( POKE( p_peek, "<asx", 4 ) || demux_IsPathExtension( p_demux, ".asx" ) ||
+        demux_IsPathExtension( p_demux, ".wax" ) || demux_IsPathExtension( p_demux, ".wvx" ) ||
         demux_IsForced( p_demux, "asx-open" ) )
     {
-        STANDARD_DEMUX_INIT_MSG( "found valid ASX playlist" );
-        return VLC_SUCCESS;
+        ;
     }
     else
         return VLC_EGENERIC;
+
+    STANDARD_DEMUX_INIT_MSG( "found valid ASX playlist" );
+    p_demux->p_sys->psz_prefix = FindPrefix( p_demux );
+    p_demux->p_sys->psz_data = NULL;
+    p_demux->p_sys->i_data_len = -1;
+    p_demux->p_sys->b_utf8 = false;
+    p_demux->p_sys->b_skip_ads =
+        var_InheritBool( p_demux, "playlist-skip-ads" );
+
+    return VLC_SUCCESS;
 }
 
 /*****************************************************************************
  * Deactivate: frees unused data
  *****************************************************************************/
-
 void Close_ASX( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
     demux_sys_t *p_sys = p_demux->p_sys;
 
+    free( p_sys->psz_prefix );
+    free( p_sys->psz_data );
     free( p_sys );
 }
 
-static void ProcessEntry( int *pi_n_entry, xml_reader_t *p_xml_reader,
-                         input_item_node_t *p_subitems,
-                         input_item_t *p_current_input, char *psz_prefix )
+static int Demux( demux_t *p_demux )
 {
-    const char *psz_node = NULL;
-    const char *psz_txt = NULL;
-    int i_type;
-
-    char *psz_title = NULL;
-    char *psz_artist = NULL;
-    char *psz_copyright = NULL;
-    char *psz_moreinfo = NULL;
-    char *psz_description = NULL;
-    char *psz_name = NULL;
-    char *psz_mrl = NULL;
-    char *psz_href = NULL;
-
-    input_item_t *p_entry = NULL;
-
-    int i_options;
-    mtime_t i_start = 0;
-    mtime_t i_duration = 0;
-    char *ppsz_options[2];
-
-    do
+    demux_sys_t *p_sys = p_demux->p_sys;
+    char        *psz_parse = NULL;
+    char        *psz_backup = NULL;
+    bool  b_entry = false;
+    input_item_t *p_current_input = GetCurrentItem(p_demux);
+
+    /* init txt */
+    if( p_sys->i_data_len < 0 )
     {
-        i_type = xml_ReaderNextNode( p_xml_reader, &psz_node );
+        int64_t i_pos = 0;
+        p_sys->i_data_len = stream_Size( p_demux->s ) + 1; /* This is a cheat to prevent unnecessary realloc */
+        if( p_sys->i_data_len <= 0 || p_sys->i_data_len > 16384 ) p_sys->i_data_len = 1024;
+        p_sys->psz_data = xmalloc( p_sys->i_data_len +1);
 
-        if( i_type == XML_READER_STARTELEM )
+        /* load the complete file */
+        for( ;; )
         {
-            /* Metadata Node */
-            if( !strncasecmp( psz_node, "TITLE", 5 ) )
-                ReadElement( p_xml_reader, &psz_title );
-            else if( !strncasecmp( psz_node, "AUTHOR", 6 ) )
-                ReadElement( p_xml_reader, &psz_artist );
-            else if( !strncasecmp( psz_node, "COPYRIGHT", 9 ) )
-                ReadElement( p_xml_reader, &psz_copyright );
-            else if( !strncasecmp( psz_node,"MOREINFO", 8 ) )
+            int i_read = stream_Read( p_demux->s, &p_sys->psz_data[i_pos], p_sys->i_data_len - i_pos );
+            p_sys->psz_data[i_pos + i_read] = '\0';
+
+            if( i_read < p_sys->i_data_len - i_pos ) break; /* Done */
+
+            i_pos += i_read;
+            p_sys->i_data_len <<= 1 ;
+            p_sys->psz_data = xrealloc( p_sys->psz_data,
+                                   p_sys->i_data_len * sizeof( char * ) + 1 );
+        }
+        if( p_sys->i_data_len <= 0 ) return -1;
+    }
+
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
+    psz_parse = p_sys->psz_data;
+    /* Find first element */
+    if( ( psz_parse = strcasestr( psz_parse, "<ASX" ) ) )
+    {
+        /* ASX element */
+        char *psz_string = NULL;
+        int i_strlen = 0;
+
+        char *psz_base_asx = NULL;
+        char *psz_title_asx = NULL;
+        char *psz_artist_asx = NULL;
+        char *psz_copyright_asx = NULL;
+        char *psz_moreinfo_asx = NULL;
+        char *psz_abstract_asx = NULL;
+
+        char *psz_base_entry = NULL;
+        char *psz_title_entry = NULL;
+        char *psz_artist_entry = NULL;
+        char *psz_copyright_entry = NULL;
+        char *psz_moreinfo_entry = NULL;
+        char *psz_abstract_entry = NULL;
+        int i_entry_count = 0;
+        bool b_skip_entry = false;
+
+        char *psz_href = NULL;
+        int i_starttime = 0;
+        int i_duration = 0;
+
+        psz_parse = strcasestr( psz_parse, ">" );
+
+        /* counter for single ad item */
+        input_item_t *uniq_entry_ad_backup = NULL;
+        int i_inserted_entries = 0;
+
+        while( psz_parse && ( psz_parse = strcasestr( psz_parse, "<" ) ) )
+        {
+            if( !strncasecmp( psz_parse, "<!--", 4 ) )
             {
-                do
+                /* this is a comment */
+                if( ( psz_parse = strcasestr( psz_parse, "-->" ) ) )
+                    psz_parse+=3;
+                else continue;
+            }
+            else if( !strncasecmp( psz_parse, "<PARAM ", 7 ) )
+            {
+                bool b_encoding_flag = false;
+                psz_parse = SkipBlanks(psz_parse+7, (unsigned)-1);
+                if( !strncasecmp( psz_parse, "name", 4 ) )
                 {
-                    psz_txt = xml_ReaderNextAttr( p_xml_reader, &psz_node );
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            i_strlen = psz_parse-psz_backup;
+                            if( i_strlen < 1 ) continue;
+                            msg_Dbg( p_demux, "param name strlen: %d", i_strlen);
+                            psz_string = xmalloc( i_strlen + 1);
+                            memcpy( psz_string, psz_backup, i_strlen );
+                            psz_string[i_strlen] = '\0';
+                            msg_Dbg( p_demux, "param name: %s", psz_string);
+                            b_encoding_flag = !strcasecmp( psz_string, "encoding" );
+                            free( psz_string );
+                        }
+                        else continue;
+                    }
+                    else continue;
                 }
-                while(psz_txt && strncasecmp( psz_txt, "HREF", 4 ) );
-
-                if( !psz_txt )
-                    ReadElement( p_xml_reader, &psz_moreinfo );
-                else
-                    psz_moreinfo = strdup( psz_node );
-                resolve_xml_special_chars( psz_moreinfo );
+                psz_parse++;
+                if( !strncasecmp( psz_parse, "value", 5 ) )
+                {
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            i_strlen = psz_parse-psz_backup;
+                            if( i_strlen < 1 ) continue;
+                            msg_Dbg( p_demux, "param value strlen: %d", i_strlen);
+                            psz_string = xmalloc( i_strlen +1);
+                            memcpy( psz_string, psz_backup, i_strlen );
+                            psz_string[i_strlen] = '\0';
+                            msg_Dbg( p_demux, "param value: %s", psz_string);
+                            if( b_encoding_flag && !strcasecmp( psz_string, "utf-8" ) ) p_sys->b_utf8 = true;
+                            free( psz_string );
+                        }
+                        else continue;
+                    }
+                    else continue;
+                }
+                if( ( psz_parse = strcasestr( psz_parse, "/>" ) ) )
+                    psz_parse += 2;
+                else continue;
             }
-            else if( !strncasecmp( psz_node, "ABSTRACT", 8 ) )
-                ReadElement( p_xml_reader, &psz_description );
-            else if( !strncasecmp( psz_node, "DURATION", 8 ) )
-                i_duration = ParseTime( p_xml_reader );
-            else if( !strncasecmp( psz_node, "STARTTIME", 9 ) )
-                i_start = ParseTime( p_xml_reader );
-            else
-            /* Reference Node */
-            /* All ref node will be converted into an entry */
-            if( !strncasecmp( psz_node, "REF", 3 ) )
+            else if( !strncasecmp( psz_parse, "<BANNER", 7 ) )
+            {
+                /* We skip this element */
+                if( ( psz_parse = strcasestr( psz_parse, "</BANNER>" ) ) )
+                    psz_parse += 9;
+                else continue;
+            }
+            else if( !strncasecmp( psz_parse, "<PREVIEWDURATION", 16 ) ||
+                     !strncasecmp( psz_parse, "<LOGURL", 7 ) ||
+                     !strncasecmp( psz_parse, "<Skin", 5 ) )
+            {
+                /* We skip this element */
+                if( ( psz_parse = strcasestr( psz_parse, "/>" ) ) )
+                    psz_parse += 2;
+                else continue;
+            }
+            else if( !strncasecmp( psz_parse, "<BASE ", 6 ) )
             {
-                *pi_n_entry = *pi_n_entry + 1;
-
-                if( !psz_title )
-                    psz_title = input_item_GetTitle( p_current_input );
-                if( !psz_artist )
-                    psz_artist = input_item_GetArtist( p_current_input );
-                if( !psz_copyright )
-                    psz_copyright = input_item_GetCopyright( p_current_input );
-                if( !psz_description )
-                    psz_description = input_item_GetDescription( p_current_input );
-
-                do
+                psz_parse = SkipBlanks(psz_parse+6, (unsigned)-1);
+                if( !strncasecmp( psz_parse, "HREF", 4 ) )
                 {
-                    psz_txt = xml_ReaderNextAttr( p_xml_reader, &psz_node );
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            StoreString( p_demux, (b_entry ? &psz_base_entry : &psz_base_asx), psz_backup, psz_parse );
+                        }
+                        else continue;
+                    }
+                    else continue;
                 }
-                while( strncasecmp( psz_txt, "HREF", 4) );
-                psz_href = strdup( psz_node );
-
-                if( asprintf( &psz_name, "%d. %s", *pi_n_entry, psz_title ) == -1)
-                    psz_name = strdup( psz_title );
-                resolve_xml_special_chars( psz_href );
-                psz_mrl = ProcessMRL( psz_href, psz_prefix );
-
-                /* Add Time information */
-                i_options = 0;
-                if( i_start )
+                if( ( psz_parse = strcasestr( psz_parse, "/>" ) ) )
+                    psz_parse += 2;
+                else continue;
+            }
+            else if( !strncasecmp( psz_parse, "<TITLE>", 7 ) )
+            {
+                psz_backup = psz_parse+=7;
+                if( ( psz_parse = strcasestr( psz_parse, "</TITLE>" ) ) )
                 {
-                    if( asprintf( ppsz_options, ":start-time=%d" ,(int) i_start/1000000 ) != -1)
-                        i_options++;
+                    StoreString( p_demux, (b_entry ? &psz_title_entry : &psz_title_asx), psz_backup, psz_parse );
+                    psz_parse += 8;
                 }
-                if( i_duration)
+                else continue;
+            }
+            else if( !strncasecmp( psz_parse, "<Author>", 8 ) )
+            {
+                psz_backup = psz_parse+=8;
+                if( ( psz_parse = strcasestr( psz_parse, "</Author>" ) ) )
                 {
-                    if( asprintf( ppsz_options + i_options, ":stop-time=%d",
-                                (int) (i_start+i_duration)/1000000 ) != -1)
-                        i_options++;
+                    StoreString( p_demux, (b_entry ? &psz_artist_entry : &psz_artist_asx), psz_backup, psz_parse );
+                    psz_parse += 9;
                 }
-
-                /* Create the input item */
-                p_entry = input_item_NewExt( psz_mrl, psz_name, i_options,
-                        (const char* const*) ppsz_options, VLC_INPUT_OPTION_TRUSTED, i_duration );
-                input_item_CopyOptions( p_current_input, p_entry );
-
-                /* Add the metadata */
-                if( psz_name )
-                    input_item_SetTitle( p_entry, psz_name );
-                if( psz_artist )
-                    input_item_SetArtist( p_entry, psz_artist );
-                if( psz_copyright )
-                    input_item_SetCopyright( p_entry, psz_copyright );
-                if( psz_moreinfo )
-                    input_item_SetURL( p_entry, psz_moreinfo );
-                if( psz_description )
-                    input_item_SetDescription( p_entry, psz_description );
-                if( i_duration > 0)
-                    input_item_SetDuration( p_entry, i_duration );
-
-                input_item_node_AppendItem( p_subitems, p_entry );
-
-                while( i_options )
-                    free( ppsz_options[--i_options] );
-                free( psz_name );
-                free( psz_mrl );
+                else continue;
             }
-        }
-    }
-    while( i_type != XML_READER_ENDELEM || strncasecmp( psz_node, "ENTRY", 5 ) );
-
-    free( psz_href );
-    free( psz_title );
-    free( psz_artist );
-    free( psz_copyright );
-    free( psz_moreinfo );
-    free( psz_description );
-}
-
-static int Demux( demux_t *p_demux )
-{
-    const char *psz_node = NULL;
-    char *psz_txt = NULL;
-    char *psz_base = FindPrefix( p_demux );
-    char *psz_title_asx = NULL;
-    char *psz_entryref = NULL;
-
-    xml_reader_t *p_xml_reader = NULL;
-    input_item_t *p_current_input = GetCurrentItem( p_demux );
-    input_item_node_t *p_subitems = NULL;
-
-    bool b_first_node = false;
-    int i_type;
-    int i_n_entry = 0;
-
-    p_xml_reader = xml_ReaderCreate( p_demux, p_demux->s );
-    if( !p_xml_reader )
-    {
-        msg_Err( p_demux, "Cannot parse ASX input file as XML");
-        goto error;
-    }
-
-    p_subitems = input_item_node_Create( p_current_input );
-
-    do
-    {
-        i_type = xml_ReaderNextNode( p_xml_reader, &psz_node );
-        if( i_type == XML_READER_STARTELEM )
-        {
-            if( !b_first_node )
+            else if( !strncasecmp( psz_parse, "<Copyright", 10 ) )
             {
-                if(!strncasecmp( psz_node, "ASX", 3 ) )
-                    b_first_node = true;
-                else
+                psz_backup = psz_parse+=11;
+                if( ( psz_parse = strcasestr( psz_parse, "</Copyright>" ) ) )
                 {
-                    msg_Err( p_demux, "invalid root node" );
-                    goto error;
+                    StoreString( p_demux, (b_entry ? &psz_copyright_entry : &psz_copyright_asx), psz_backup, psz_parse );
+                    psz_parse += 12;
                 }
+                else continue;
             }
-
-            /* Metadata Node Handler */
-            if( !strncasecmp( psz_node, "TITLE", 5 ) )
+            else if( !strncasecmp( psz_parse, "<MoreInfo ", 10 ) )
             {
-                ReadElement( p_xml_reader, &psz_title_asx );
-                input_item_SetTitle( p_current_input, psz_title_asx );
+                psz_parse = SkipBlanks(psz_parse+10, (unsigned)-1);
+                if( !strncasecmp( psz_parse, "HREF", 4 ) )
+                {
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            StoreString( p_demux, (b_entry ? &psz_moreinfo_entry : &psz_moreinfo_asx), psz_backup, psz_parse );
+                        }
+                        else continue;
+                    }
+                    else continue;
+                }
+                if( ( psz_backup = strcasestr( psz_parse, "/>" ) ) )
+                    psz_parse = psz_backup + 2;
+                else if( ( psz_backup = strcasestr( psz_parse, "</MoreInfo>") ) )
+                    psz_parse = psz_backup + 11;
+                else
+                {
+                    psz_parse = NULL;
+                    continue;
+                }
             }
-            else if( !strncasecmp( psz_node, "AUTHOR", 6 ) )
+            else if( !strncasecmp( psz_parse, "<ABSTRACT>", 10 ) )
             {
-                ReadElement( p_xml_reader, &psz_txt );
-                input_item_SetArtist( p_current_input, psz_txt );
+                psz_backup = psz_parse+=10;
+                if( ( psz_parse = strcasestr( psz_parse, "</ABSTRACT>" ) ) )
+                {
+                    StoreString( p_demux, (b_entry ? &psz_abstract_entry : &psz_abstract_asx), psz_backup, psz_parse );
+                    psz_parse += 11;
+                }
+                else continue;
             }
-            else if( !strncasecmp( psz_node, "COPYRIGHT", 9 ) )
+            else if( !strncasecmp( psz_parse, "<EntryRef ", 10 ) )
             {
-                ReadElement( p_xml_reader, &psz_txt );
-                input_item_SetCopyright( p_current_input, psz_txt );
+                psz_parse = SkipBlanks(psz_parse+10, (unsigned)-1);
+                if( !strncasecmp( psz_parse, "HREF", 4 ) )
+                {
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            i_strlen = psz_parse-psz_backup;
+                            if( i_strlen < 1 ) continue;
+                            psz_string = xmalloc( i_strlen +1);
+                            memcpy( psz_string, psz_backup, i_strlen );
+                            psz_string[i_strlen] = '\0';
+                            input_item_t *p_input;
+                            p_input = input_item_New( psz_string, psz_title_asx );
+                            input_item_CopyOptions( p_current_input, p_input );
+                            input_item_node_AppendItem( p_subitems, p_input );
+                            vlc_gc_decref( p_input );
+                            free( psz_string );
+                        }
+                        else continue;
+                    }
+                    else continue;
+                }
+                if( ( psz_parse = strcasestr( psz_parse, "/>" ) ) )
+                    psz_parse += 2;
             }
-            else if( !strncasecmp( psz_node, "MOREINFO", 8 ) )
+            else if( !strncasecmp( psz_parse, "</Entry>", 8 ) )
             {
-                const char *psz_tmp;
-                do
+                input_item_t *p_entry = NULL;
+                char *psz_name = NULL;
+
+                char * ppsz_options[2];
+                int i_options = 0;
+
+                /* add a new entry */
+                psz_parse+=8;
+                if( !b_entry )
                 {
-                    psz_tmp = xml_ReaderNextAttr( p_xml_reader, &psz_node );
+                    msg_Err( p_demux, "end of entry without start?" );
+                    continue;
                 }
-                while( psz_tmp && strncasecmp( psz_tmp, "HREF", 4 ) );
 
-                if( !psz_tmp )  // If HREF attribute doesn't exist
-                    ReadElement( p_xml_reader, &psz_txt );
+                if( !psz_href )
+                {
+                    msg_Err( p_demux, "entry without href?" );
+                    continue;
+                }
+                /* An skip entry is an ad only if other entries exist without skip */
+                if( p_sys->b_skip_ads && b_skip_entry && i_inserted_entries != 0 )
+                {
+                    char *psz_current_input_name = input_item_GetName( p_current_input );
+                    msg_Dbg( p_demux, "skipped entry %d %s (%s)",
+                             i_entry_count,
+                             ( psz_title_entry ? psz_title_entry : psz_current_input_name ), psz_href );
+                    free( psz_current_input_name );
+                }
                 else
-                    psz_txt = strdup( psz_node );
+                {
+                    if( i_starttime || i_duration )
+                    {
+                        if( i_starttime )
+                        {
+                            if( asprintf(ppsz_options+i_options, ":start-time=%d", i_starttime) == -1 )
+                                *(ppsz_options+i_options) = NULL;
+                            else
+                                ++i_options;
+                        }
+                        if( i_duration )
+                        {
+                            if( asprintf(ppsz_options+i_options, ":stop-time=%d", i_starttime + i_duration) == -1 )
+                                *(ppsz_options+i_options) = NULL;
+                            else
+                                ++i_options;
+                        }
+                    }
+
+                    /* create the new entry */
+                    char *psz_current_input_name = input_item_GetName( p_current_input );
+                    if( asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : psz_current_input_name ) ) != -1 )
+                    {
+                        char *psz_mrl = ProcessMRL( psz_href, p_demux->p_sys->psz_prefix );
+                        p_entry = input_item_NewExt( psz_mrl, psz_name,
+                                                     i_options, (const char * const *)ppsz_options, VLC_INPUT_OPTION_TRUSTED, -1 );
+                        free( psz_name );
+                        free( psz_mrl );
+                        input_item_CopyOptions( p_current_input, p_entry );
+                        while( i_options )
+                        {
+                            psz_name = ppsz_options[--i_options];
+                            free( psz_name );
+                        }
+                        psz_name = NULL;
+
+                        if( psz_title_entry ) input_item_SetTitle( p_entry, psz_title_entry );
+                        if( psz_artist_entry ) input_item_SetArtist( p_entry, psz_artist_entry );
+                        if( psz_copyright_entry ) input_item_SetCopyright( p_entry, psz_copyright_entry );
+                        if( psz_moreinfo_entry ) input_item_SetURL( p_entry, psz_moreinfo_entry );
+                        if( psz_abstract_entry ) input_item_SetDescription( p_entry, psz_abstract_entry );
+
+                        i_inserted_entries++;
+                        if( p_sys->b_skip_ads && b_skip_entry )
+                        {
+                            // We put the entry as a backup for unique ad case
+                            uniq_entry_ad_backup = p_entry;
+                        }
+                        else
+                        {
+                            if( uniq_entry_ad_backup != NULL )
+                            {
+                                vlc_gc_decref( uniq_entry_ad_backup );
+                                uniq_entry_ad_backup = NULL;
+                            }
+                            input_item_node_AppendItem( p_subitems, p_entry );
+                            vlc_gc_decref( p_entry );
+                        }
+                    }
+                    free( psz_current_input_name );
+                }
 
-                resolve_xml_special_chars( psz_txt );
-                input_item_SetURL( p_current_input, psz_txt );
+                /* cleanup entry */;
+                FREENULL( psz_href );
+                FREENULL( psz_title_entry );
+                FREENULL( psz_base_entry );
+                FREENULL( psz_artist_entry );
+                FREENULL( psz_copyright_entry );
+                FREENULL( psz_moreinfo_entry );
+                FREENULL( psz_abstract_entry );
+                b_entry = false;
             }
-            else if( !strncasecmp( psz_node, "ABSTRACT", 8 ) )
+            else if( !strncasecmp( psz_parse, "<Entry", 6 ) )
             {
-                ReadElement( p_xml_reader, &psz_txt );
-                input_item_SetDescription( p_current_input, psz_txt );
+                char *psz_clientskip;
+                psz_parse+=6;
+                if( b_entry )
+                {
+                    msg_Err( p_demux, "We already are in an entry section" );
+                    continue;
+                }
+                i_entry_count += 1;
+                b_entry = true;
+                psz_clientskip = strcasestr( psz_parse, "clientskip=\"no\"" );
+                psz_parse = strcasestr( psz_parse, ">" );
+
+                /* If clientskip was enabled ... this is an ad */
+                b_skip_entry = (NULL != psz_clientskip) && (psz_clientskip < psz_parse);
+
+                // init entry details
+                FREENULL(psz_href);
+                i_starttime = 0;
+                i_duration = 0;
             }
-            else
-            /* Base Node handler */
-            if( !strncasecmp( psz_node, "BASE", 4 ) )
-                ReadElement( p_xml_reader, &psz_base );
-            else
-            /* Entry Ref Handler */
-            if( !strncasecmp( psz_node, "ENTRYREF", 7 ) )
+            else if( !strncasecmp( psz_parse, "<Ref ", 5 ) )
             {
-                const char *psz_tmp;
-                do
+                psz_parse = SkipBlanks(psz_parse+5, (unsigned)-1);
+                if( !b_entry )
                 {
-                    psz_tmp = xml_ReaderNextAttr( p_xml_reader, &psz_node );
+                    msg_Err( p_demux, "A ref outside an entry section" );
+                    continue;
                 }
-                while( psz_tmp && !strncasecmp( psz_tmp, "HREF", 4 ) );
 
-                /* Create new input item */
-                input_item_t *p_input;
-                psz_txt = strdup( psz_node );
-                resolve_xml_special_chars( psz_txt );
-                p_input = input_item_New( psz_txt, psz_title_asx );
-                input_item_CopyOptions( p_current_input, p_input );
-                input_item_node_AppendItem( p_subitems, p_input );
+                if( !strncasecmp( psz_parse, "HREF", 4 ) )
+                {
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        psz_backup = SkipBlanks(psz_backup, (unsigned)-1);
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            char *psz_tmp;
+                            i_strlen = psz_parse-psz_backup;
+                            if( i_strlen < 1 ) continue;
+
+                            if( psz_href )
+                            {
+                                /* we have allready one href in this entry, lets make new input from it and
+                                continue with new href, don't free meta/options*/
+                                input_item_t *p_entry = NULL;
+                                char *psz_name = input_item_GetName( p_current_input );
+
+                                char *psz_mrl = ProcessMRL( psz_href, p_demux->p_sys->psz_prefix );
+                                p_entry = input_item_NewExt( psz_mrl, psz_name,
+                                                     0, NULL, VLC_INPUT_OPTION_TRUSTED, -1 );
+                                free( psz_mrl );
+                                input_item_CopyOptions( p_current_input, p_entry );
+                                if( psz_title_entry ) input_item_SetTitle( p_entry, psz_title_entry );
+                                if( psz_artist_entry ) input_item_SetArtist( p_entry, psz_artist_entry );
+                                if( psz_copyright_entry ) input_item_SetCopyright( p_entry, psz_copyright_entry );
+                                if( psz_moreinfo_entry ) input_item_SetURL( p_entry, psz_moreinfo_entry );
+                                if( psz_abstract_entry ) input_item_SetDescription( p_entry, psz_abstract_entry );
+                                input_item_node_AppendItem( p_subitems, p_entry );
+                                vlc_gc_decref( p_entry );
+                            }
+
+                            free( psz_href );
+                            psz_href = xmalloc( i_strlen +1);
+                            memcpy( psz_href, psz_backup, i_strlen );
+                            psz_href[i_strlen] = '\0';
+                            psz_tmp = psz_href + (i_strlen-1);
+                            while( psz_tmp >= psz_href &&
+                                 ( *psz_tmp == '\r' || *psz_tmp == '\n' ) )
+                            {
+                                *psz_tmp = '\0';
+                                psz_tmp++;
+                            }
+                        }
+                        else continue;
+                    }
+                    else continue;
+                }
+                if( ( psz_parse = strcasestr( psz_parse, ">" ) ) )
+                    psz_parse++;
+                else continue;
+            }
+            else if( !strncasecmp( psz_parse, "<starttime ", 11 ) )
+            {
+                psz_parse = SkipBlanks(psz_parse+11, (unsigned)-1);
+                if( !b_entry )
+                {
+                    msg_Err( p_demux, "starttime outside an entry section" );
+                    continue;
+                }
 
-                vlc_gc_decref( p_input );
+                if( !strncasecmp( psz_parse, "value", 5 ) )
+                {
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            i_strlen = psz_parse-psz_backup;
+                            if( i_strlen < 1 ) continue;
+
+                            i_starttime = ParseTime(psz_backup, i_strlen);
+                        }
+                        else continue;
+                    }
+                    else continue;
+                }
+                if( ( psz_parse = strcasestr( psz_parse, ">" ) ) )
+                    psz_parse++;
+                else continue;
             }
-            else
-            /* Entry Handler */
-            if( !strncasecmp( psz_node, "ENTRY", 5 ) )
+            else if( !strncasecmp( psz_parse, "<duration ", 11 ) )
             {
-                ProcessEntry( &i_n_entry, p_xml_reader, p_subitems,
-                              p_current_input, psz_base);
+                psz_parse = SkipBlanks(psz_parse+5, (unsigned)-1);
+                if( !b_entry )
+                {
+                    msg_Err( p_demux, "duration outside an entry section" );
+                    continue;
+                }
+
+                if( !strncasecmp( psz_parse, "value", 5 ) )
+                {
+                    if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                    {
+                        psz_backup = ++psz_parse;
+                        if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
+                        {
+                            i_strlen = psz_parse-psz_backup;
+                            if( i_strlen < 1 ) continue;
+
+                            i_duration = ParseTime(psz_backup, i_strlen);
+                        }
+                        else continue;
+                    }
+                    else continue;
+                }
+                if( ( psz_parse = strcasestr( psz_parse, ">" ) ) )
+                    psz_parse++;
+                else continue;
+            }
+            else if( !strncasecmp( psz_parse, "</ASX", 5 ) )
+            {
+                if( psz_title_asx ) input_item_SetTitle( p_current_input, psz_title_asx );
+                if( psz_artist_asx ) input_item_SetArtist( p_current_input, psz_artist_asx );
+                if( psz_copyright_asx ) input_item_SetCopyright( p_current_input, psz_copyright_asx );
+                if( psz_moreinfo_asx ) input_item_SetURL( p_current_input, psz_moreinfo_asx );
+                if( psz_abstract_asx ) input_item_SetDescription( p_current_input, psz_abstract_asx );
+                FREENULL( psz_base_asx );
+                FREENULL( psz_title_asx );
+                FREENULL( psz_artist_asx );
+                FREENULL( psz_copyright_asx );
+                FREENULL( psz_moreinfo_asx );
+                FREENULL( psz_abstract_asx );
+                psz_parse++;
             }
-        /* FIXME Unsupported elements
+            else psz_parse++;
+        }
+        if ( uniq_entry_ad_backup != NULL )
+        {
+            msg_Dbg( p_demux, "added unique entry even if ad");
+            /* If ASX contains a unique entry, we add it, it is probably not an ad */
+            input_item_node_AppendItem( p_subitems, uniq_entry_ad_backup );
+            vlc_gc_decref( uniq_entry_ad_backup);
+        }
+#if 0
+/* FIXME Unsupported elements */
             PARAM
             EVENT
             REPEAT
             ENDMARK
             STARTMARK
-        */
-        }
+#endif
     }
-    while( i_type != XML_READER_ENDELEM || strncasecmp( psz_node, "ASX", 3 ) );
 
     input_item_node_PostAndDelete( p_subitems );
-    p_subitems = NULL;
-
-
-error:
-    free( psz_base );
-    free( psz_title_asx );
-    free( psz_entryref );
-    free( psz_txt );
-
-    if( p_xml_reader)
-        xml_ReaderDelete( p_xml_reader );
-    if( p_subitems )
-        input_item_node_Delete( p_subitems );
-
-    vlc_gc_decref( p_current_input );
 
-    return 0;
+    vlc_gc_decref(p_current_input);
+    return 0; /* Needed for correct operation of go back */
 }
diff --git a/modules/demux/playlist/m3u.c b/modules/demux/playlist/m3u.c
index cb67315..6d7a914 100644
--- a/modules/demux/playlist/m3u.c
+++ b/modules/demux/playlist/m3u.c
@@ -2,7 +2,7 @@
  * m3u.c : M3U playlist format import
  *****************************************************************************
  * Copyright (C) 2004 VLC authors and VideoLAN
- * $Id: 02a95984d5fe1968163cb435268a9874f0c65eb9 $
+ * $Id: 58f6006deb41b13fe9fac8b90cbdb8d8961bb1bf $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Sigmund Augdal Helberg <dnumgis@videolan.org>
@@ -48,6 +48,7 @@ struct demux_sys_t
 static int Demux( demux_t *p_demux);
 static void parseEXTINF( char *psz_string, char **ppsz_artist, char **ppsz_name, int *pi_duration );
 static bool ContainsURL( demux_t *p_demux );
+static bool CheckContentType( stream_t * p_stream, const char * psz_ctype );
 
 static char *GuessEncoding (const char *str)
 {
@@ -148,6 +149,24 @@ static bool ContainsURL( demux_t *p_demux )
     return false;
 }
 
+static bool CheckContentType( stream_t * p_stream, const char * psz_ctype )
+{
+    char *psz_check = stream_ContentType( p_stream );
+    if( !psz_check ) return false;
+
+    int i_len = strlen( psz_check );
+    if ( i_len == 0 )
+    {
+        free( psz_check );
+        return false;
+    }
+
+    int i_res = strncasecmp( psz_check, psz_ctype, i_len );
+    free( psz_check );
+
+    return ( i_res == 0 ) ? true : false;
+}
+
 /*****************************************************************************
  * Deactivate: frees unused data
  *****************************************************************************/
diff --git a/modules/demux/playlist/playlist.c b/modules/demux/playlist/playlist.c
index 5d679f5..d8a26a6 100644
--- a/modules/demux/playlist/playlist.c
+++ b/modules/demux/playlist/playlist.c
@@ -2,7 +2,7 @@
  * playlist.c :  Playlist import module
  *****************************************************************************
  * Copyright (C) 2004 VLC authors and VideoLAN
- * $Id: 0b4a053ad2ed4bfa037a7fd2d86524bc85203dc1 $
+ * $Id: 7991cec5d5b99e20f25251477b9bc3e0a15ef96f $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *
@@ -224,29 +224,3 @@ char *ProcessMRL( const char *psz_mrl, const char *psz_prefix )
 uri:
     return vlc_path2uri( psz_mrl, NULL );
 }
-
-/**
- * Checks stream Content-Type against a known one
- */
-bool CheckContentType( stream_t * p_stream, const char * psz_ctype )
-{
-    char *psz_check = stream_ContentType( p_stream );
-    if( !psz_check ) return false;
-
-    int i_len = strlen( psz_check );
-    if ( i_len == 0 )
-    {
-        free( psz_check );
-        return false;
-    }
-
-    /* check for Content-Type: foo-type; charset=... */
-    const char * psz_sep = strchr( psz_check, ';' );
-    if ( psz_sep )
-        i_len = __MIN( i_len, psz_sep - psz_check );
-
-    int i_res = strncasecmp( psz_check, psz_ctype, i_len );
-    free( psz_check );
-
-    return ( i_res == 0 ) ? true : false;
-}
diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h
index b0ad76d..ff61df9 100644
--- a/modules/demux/playlist/playlist.h
+++ b/modules/demux/playlist/playlist.h
@@ -2,7 +2,7 @@
  * playlist.h:  Playlist import module common functions
  *****************************************************************************
  * Copyright (C) 2004 VLC authors and VideoLAN
- * $Id: 5f7db991eeecd7c97da3e82e7796617d29730570 $
+ * $Id: 657a34456bf4bcf1691c90477892ee3ca0aed226 $
  *
  * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
  *
@@ -80,8 +80,6 @@ void Close_ZPL ( vlc_object_t * );
 
 extern input_item_t * GetCurrentItem(demux_t *p_demux);
 
-bool CheckContentType( stream_t * p_stream, const char * psz_ctype );
-
 #define STANDARD_DEMUX_INIT_MSG( msg ) do { \
     DEMUX_INIT_COMMON();                    \
     msg_Dbg( p_demux, "%s", msg ); } while(0)
diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index 7da41ca..66f6750 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -2,7 +2,7 @@
  * xspf.c : XSPF playlist import functions
  *******************************************************************************
  * Copyright (C) 2006-2011 VLC authors and VideoLAN
- * $Id: a58782b9a77dcaf01be62106ceabe2019f70fae7 $
+ * $Id: a8083477f1178e83fe782fbe4947b2bcf94bc4a6 $
  *
  * Authors: Daniel Stränger <vlc at schmaller dot de>
  *          Yoann Peronneau <yoann@videolan.org>
@@ -86,6 +86,7 @@ int Import_xspf(vlc_object_t *p_this)
 {
     DEMUX_BY_EXTENSION_OR_MIMETYPE(".xspf", "application/xspf+xml",
                                       "using XSPF playlist reader");
+
     return VLC_SUCCESS;
 }
 
@@ -113,7 +114,7 @@ static int Demux(demux_t *p_demux)
     p_demux->p_sys->pp_tracklist = NULL;
     p_demux->p_sys->i_tracklist_entries = 0;
     p_demux->p_sys->i_track_id = -1;
-    p_demux->p_sys->psz_base = NULL;
+    p_demux->p_sys->psz_base = FindPrefix(p_demux);
 
     /* create new xml parser from stream */
     p_xml_reader = xml_ReaderCreate(p_demux, p_demux->s);
@@ -479,8 +480,6 @@ static bool parse_track_node COMPLEX_INTERFACE
              * and anchors (#...) are not resolved correctly. Also,
              * host-relative (/...) and directory-relative locations
              * ("relative path" in vernacular) should be resolved.
-             * Last, psz_base should default to the XSPF resource
-             * location if missing (not the current working directory).
              * -- Courmisch */
             if (p_sys->psz_base && !strstr(psz_value, "://"))
             {
diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c
index 63bbede..2d1d4e0 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -2,7 +2,7 @@
  * rawvid.c : raw video input module for vlc
  *****************************************************************************
  * Copyright (C) 2007 VLC authors and VideoLAN
- * $Id: 239f1ca160adec834b1e010fac7a006237f75593 $
+ * $Id: a69b0b3572c7d2ba047d46eba9d95bec4f10e6c4 $
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *          Antoine Cellerier <dionoea at videolan d.t org>
@@ -129,10 +129,10 @@ static int Open( vlc_object_t * p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
     int i_width=-1, i_height=-1;
-    unsigned u_fps_num=0, u_fps_den=1;
+    unsigned u_fps_num, u_fps_den;
     vlc_fourcc_t i_chroma = 0;
-    unsigned int i_sar_num = 0;
-    unsigned int i_sar_den = 0;
+    unsigned int i_sar_num;
+    unsigned int i_sar_den;
     const struct preset_t *p_preset = NULL;
     const uint8_t *p_peek;
     bool b_y4m = false;
@@ -295,47 +295,15 @@ valid:
         free( psz_tmp );
     }
 
-    psz_tmp = var_CreateGetNonEmptyString( p_demux, "rawvid-fps" );
-    if( psz_tmp )
+    if( var_InheritURational( p_demux, &u_fps_num, &u_fps_den, "rawvid-fps" ) )
     {
-        char *p_ptr;
-        /* fps can either be n/d or q.f
-         * for accuracy, avoid representation in float */
-        u_fps_num = strtol( psz_tmp, &p_ptr, 10 );
-        if( *p_ptr == '/' )
-        {
-            p_ptr++;
-            u_fps_den = strtol( p_ptr, NULL, 10 );
-        }
-        else if( *p_ptr == '.' )
-        {
-            char *p_end;
-            p_ptr++;
-            int i_frac =  strtol( p_ptr, &p_end, 10 );
-            u_fps_den = (p_end - p_ptr) * 10;
-            if( !u_fps_den )
-                u_fps_den = 1;
-            u_fps_num = u_fps_num * u_fps_den + i_frac;
-        }
-        else if( *p_ptr == '\0')
-        {
-            u_fps_den = 1;
-        }
-        free( psz_tmp );
+        u_fps_num = 0;
+        u_fps_den = 1;
     }
 
-    psz_tmp = var_CreateGetNonEmptyString( p_demux, "rawvid-aspect-ratio" );
-    if( psz_tmp )
-    {
-        char *psz_denominator = strchr( psz_tmp, ':' );
-        if( psz_denominator )
-        {
-            *psz_denominator++ = '\0';
-            i_sar_num = atoi( psz_tmp )         * i_height;
-            i_sar_den = atoi( psz_denominator ) * i_width;
-        }
-        free( psz_tmp );
-    }
+    if( var_InheritURational( p_demux, &i_sar_num, &i_sar_den,
+                              "rawvid-aspect-ratio" ) )
+        i_sar_num = i_sar_den = 1;
 
     /* moan about anything wrong */
     if( i_width <= 0 || i_height <= 0 )
diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index b79b063..2b95948 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -2,7 +2,7 @@
  * subtitle.c: Demux for subtitle text files.
  *****************************************************************************
  * Copyright (C) 1999-2007 VLC authors and VideoLAN
- * $Id: c2a7642643b05a9832f99c1dc38f5160461b9d50 $
+ * $Id: c2877a0b9f45bdabcfeed75edae2ac8577035fa6 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Derk-Jan Hartman <hartman at videolan dot org>
@@ -1156,6 +1156,9 @@ static int  ParseSSA( demux_t *p_demux, subtitle_t *p_subtitle,
         free( psz_text );
 
         /* All the other stuff we add to the header field */
+        if( header_len == 0 && p_sys->psz_header )
+            header_len = strlen( p_sys->psz_header );
+
         size_t s_len = strlen( s );
         p_sys->psz_header = realloc_or_free( p_sys->psz_header, header_len + s_len + 2 );
         if( !p_sys->psz_header )
diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 89d1eb9..8dd38c8 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -2,7 +2,7 @@
  * ts.c: Transport Stream input module for VLC.
  *****************************************************************************
  * Copyright (C) 2004-2005 VLC authors and VideoLAN
- * $Id: 8c78b5f2d3852945a444dbff875a38a84ae4cb59 $
+ * $Id: 377db21ebba5ffddc3047bdb32a4e85c6c899eab $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Jean-Paul Saman <jpsaman #_at_# m2x.nl>
@@ -2025,6 +2025,29 @@ static int Seek( demux_t *p_demux, double f_percent )
     }
     else
     {
+        for( int i = 2; i < 8192; i++ )
+        {
+            ts_pid_t *pid = &p_sys->pid[i];
+
+            if( !pid->b_valid || !pid->es || !pid->es->id )
+                continue;
+
+            if( pid->es->p_data )
+            {
+                block_ChainRelease( pid->es->p_data );
+                pid->es->p_data = NULL;
+                pid->es->i_data_size = 0;
+                pid->es->i_data_gathered = 0;
+                pid->es->pp_last = &pid->es->p_data;
+            }
+            block_t *p_reset = block_Alloc(1);
+            if( p_reset )
+            {
+                p_reset->i_buffer = 0;
+                p_reset->i_flags = BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED;
+                es_out_Send( p_demux->out, pid->es->id, p_reset );
+            }
+        }
         msg_Dbg( p_demux, "Seek():can find a time position. i_cnt:%d", i_cnt );
         return VLC_SUCCESS;
     }
@@ -2161,10 +2184,10 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk )
         p_sys->i_current_pcr = AdjustPCRWrapAround( p_demux, i_pcr );
 
     /* Search program and set the PCR */
-    int i_group = -1;
-    for( int i = 0; i < p_sys->i_pmt && i_group < 0 ; i++ )
+    for( int i = 0; i < p_sys->i_pmt; i++ )
     {
         bool b_pmt_has_es = false;
+        int i_group = -1;
 
         for( int i_prg = 0; i_prg < p_sys->pmt[i]->psi->i_prg; i_prg++ )
         {
diff --git a/modules/gui/macosx/bookmarks.h b/modules/gui/macosx/bookmarks.h
index 49f8990..46cc972 100644
--- a/modules/gui/macosx/bookmarks.h
+++ b/modules/gui/macosx/bookmarks.h
@@ -2,7 +2,7 @@
  * bookmarks.h: MacOS X Bookmarks window
  *****************************************************************************
  * Copyright (C) 2005, 2007 VLC authors and VideoLAN
- * $Id: dbeec5cd4fe85cadbf97f62e1c9c085c5876e7ae $
+ * $Id: 17087451ede09ad5111d1010e3c433417afae40f $
  *
  * Authors: Felix Kühne <fkuehne at videolan dot org>
  *
@@ -42,10 +42,8 @@
     IBOutlet id o_edit_btn_cancel;
     IBOutlet id o_edit_lbl_name;
     IBOutlet id o_edit_lbl_time;
-    IBOutlet id o_edit_lbl_bytes;
     IBOutlet id o_edit_fld_name;
     IBOutlet id o_edit_fld_time;
-    IBOutlet id o_edit_fld_bytes;
 
     input_thread_t *p_old_input;
 }
diff --git a/modules/gui/qt4/Makefile.am b/modules/gui/qt4/Makefile.am
index c608999..1a564cf 100644
--- a/modules/gui/qt4/Makefile.am
+++ b/modules/gui/qt4/Makefile.am
@@ -20,7 +20,7 @@ libqt4_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(guidir)'
 if HAVE_OS2
 else
 if HAVE_WIN32
-libqt4_plugin_la_LIBADD += -lole32
+libqt4_plugin_la_LIBADD += -lole32 -lcomctl32 -luuid
 else
 libqt4_plugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIB) -lX11
 endif
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index f099ce0..d4c4581 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: a006ff0a8e7eb51ceb06082ee97aa8ba39a433af $
+ * $Id: 6624509b787beb230406d1f5a9018a2fe7193434 $
  *
  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
  *          Ilkka Ollakka <ileoo@videolan.org>
@@ -953,7 +953,7 @@ void FullscreenControllerWidget::toggleFullwidth()
 
 int FullscreenControllerWidget::targetScreen()
 {
-    if( i_screennumber == -1 || i_screennumber > QApplication::desktop()->numScreens() )
+    if( i_screennumber < 0 || i_screennumber > QApplication::desktop()->numScreens() )
         return QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
     return i_screennumber;
 }
diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index df6fc35..94875ba 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -2,7 +2,7 @@
  * extended_panels.cpp : Extended controls panels
  ****************************************************************************
  * Copyright (C) 2006-2013 the VideoLAN team
- * $Id: 4ee8eed31ed8626fa7feac855cfe2fd5a3197a53 $
+ * $Id: 00c0cdbd2438ede0dd920c56658e7d9d28bd150f $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Antoine Cellerier <dionoea .t videolan d@t org>
@@ -548,7 +548,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
         else if( checkbox ) checkbox->setCheckState( val.i_int? Qt::Checked
                                                               : Qt::Unchecked );
         else if( spinbox )  spinbox->setValue( val.i_int );
-        else if( dial )     dial->setValue( ( 540-val.i_int )%360 );
+        else if( dial )     dial->setValue( (360 - val.i_int) % 360 );
         else if( lineedit )
         {
             char str[30];
@@ -563,7 +563,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
     {
         if( slider ) slider->setValue( ( int )( val.f_float*( double )slider->tickInterval() ) ); /* hack alert! */
         else if( doublespinbox ) doublespinbox->setValue( val.f_float );
-        else if( dial ) dial->setValue( (540 - lroundf(val.f_float)) % 360 );
+        else if( dial ) dial->setValue( (360 - lroundf(val.f_float)) % 360 );
         else msg_Warn( p_intf, "Could not find the correct Float widget" );
     }
     else if( i_type == VLC_VAR_STRING )
@@ -682,8 +682,8 @@ void ExtVideo::updateFilterOptions()
     else if( spinbox ) i_int = spinbox->value();
     else if( doublespinbox ) f_float = doublespinbox->value();
     else if( dial ) {
-        i_int = (540 - dial->value()) % 360;
-        f_float = (540 - dial->value()) / 360.;
+        i_int = (360 - dial->value()) % 360;
+        f_float = i_int;
     }
     else if( lineedit ) {
         i_int = lineedit->text().toInt( NULL,16 );
diff --git a/modules/gui/qt4/components/info_panels.cpp b/modules/gui/qt4/components/info_panels.cpp
index d2576a1..bdf145f 100644
--- a/modules/gui/qt4/components/info_panels.cpp
+++ b/modules/gui/qt4/components/info_panels.cpp
@@ -2,7 +2,7 @@
  * info_panels.cpp : Panels for the information dialogs
  ****************************************************************************
  * Copyright (C) 2006-2007 the VideoLAN team
- * $Id: a982b8839f6e3e8100684200e16c7cd3b6b79aa1 $
+ * $Id: a2d8db1bce20f697e0afda6d7b649d35350a4f75 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -158,6 +158,7 @@ MetaPanel::MetaPanel( QWidget *parent,
     lblURL = new QLabel;
     lblURL->setOpenExternalLinks( true );
     lblURL->setTextFormat( Qt::RichText );
+    lblURL->setMaximumWidth( 128 );
     metaLayout->addWidget( lblURL, line -1, 7, 1, -1 );
 
     ADD_META( VLC_META_COPYRIGHT, copyright_text, 0,  7 ); line++;
diff --git a/modules/gui/qt4/components/info_widgets.cpp b/modules/gui/qt4/components/info_widgets.cpp
index fa2df79..b6aa93c 100644
--- a/modules/gui/qt4/components/info_widgets.cpp
+++ b/modules/gui/qt4/components/info_widgets.cpp
@@ -58,6 +58,7 @@ VLCStatsView::VLCStatsView( QWidget *parent ) : QGraphicsView( parent )
     reset();
 
     QPen linepen( Qt::DotLine );
+    linepen.setCosmetic( true );
     linepen.setBrush( QBrush( QColor( 33, 33, 33 ) ) );
     for ( int i=0; i<3; i++ )
         rulers[i] = viewScene->addLine( QLineF(), linepen );
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 3024e8c..5ee0085 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -2,7 +2,7 @@
  * interface_widgets.cpp : Custom widgets for the main interface
  ****************************************************************************
  * Copyright (C) 2006-2010 the VideoLAN team
- * $Id: fce3591e2ebf001cff60136a8a89c6b9cd62f4f4 $
+ * $Id: 8c30ac02124b13f486c7a7d1375dbd79de44c907 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -483,9 +483,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, QWidget *parent )
     DCONNECT( THEMIM, inputChanged( ),
               speedControl, activateOnState() );
 
-    setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
-    setLineWidth( 1 );
-
+    setContentsMargins(4, 0, 4, 0);
     setRate( var_InheritFloat( THEPL, "rate" ) );
 }
 
diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
index 272cf9b..a662a57 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: 45306607ab7596929751dffb71c58c034dc5877b $
+ * $Id: 59f6535d7ccf01c7e44d3cf05bc8449953db2a36 $
  *
  * Authors:         Jean-Baptiste Kempf <jb@videolan.org>
  *
@@ -484,6 +484,9 @@ PicFlowView::PicFlowView( QAbstractItemModel *p_model, QWidget *parent ) : QAbst
     QHBoxLayout *layout = new QHBoxLayout( this );
     layout->setMargin( 0 );
     picFlow = new PictureFlow( this, p_model );
+    picFlow->setContextMenuPolicy( Qt::CustomContextMenu );
+    connect( picFlow, SIGNAL(customContextMenuRequested( const QPoint & )),
+             this,    SIGNAL(customContextMenuRequested( const QPoint & )) );
     layout->addWidget( picFlow );
     picFlow->setSlideSize(QSize( 4*LISTVIEW_ART_SIZE, 3*LISTVIEW_ART_SIZE) );
     setSelectionMode( QAbstractItemView::SingleSelection );
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index ac4c9fc..e5adcc6 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: 5cf8fc930674afea99e8a8b15962c7496ffc2d83 $
+ * $Id: 831ccdf463638076c0aabb671616a220d2caec5e $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Antoine Cellerier <dionoea@videolan.org>
@@ -58,8 +58,12 @@ static const char *const ppsz_language[] =
 {
     "auto",
     "en",
+    "an",
     "ar",
+    "ast",
     "bn",
+    "bn_IN",
+    "bs",
     "pt_BR",
     "en_GB",
     "el",
@@ -87,9 +91,12 @@ static const char *const ppsz_language[] =
     "id",
     "it",
     "ja",
+    "kn",
     "ko",
     "lt",
+    "lv",
     "mn",
+    "mr",
     "ms",
     "nb",
     "nn",
@@ -110,8 +117,10 @@ static const char *const ppsz_language[] =
     "sl",
     "ckb",
     "es",
+    "es_MX",
     "sv",
     "te",
+    "th",
     "tr",
     "uk",
     "vi",
@@ -123,8 +132,12 @@ static const char *const ppsz_language_text[] =
 {
     N_("Auto"),
     "American English",
+    "aragonés",
     "ﻉﺮﺒﻳ",
+    "asturianu",
     "বাংলা",
+    "বাংলা (ভারত)",
+    "bosanski",
     "Português Brasileiro",
     "British English",
     "Νέα Ελληνικά",
@@ -152,9 +165,12 @@ static const char *const ppsz_language_text[] =
     "Bahasa Indonesia",
     "Italiano",
     "日本語",
+    "ಕನ್ನಡ",
     "한국어",
     "lietuvių",
+    "latviešu valoda",
     "Монгол хэл",
+    "मराठी",
     "Melayu",
     "Bokmål",
     "Nynorsk",
@@ -175,8 +191,10 @@ static const char *const ppsz_language_text[] =
     "slovenščina",
     "کوردیی سۆرانی",
     "Español",
+    "Español mexicano",
     "Svenska",
     "తెలుగు",
+    "ภาษาไทย",
     "Türkçe",
     "украї́нська мо́ва",
     "tiếng Việt",
@@ -978,6 +996,11 @@ void SPrefsPanel::updateAudioOptions( int number)
     optionWidgets["spdifChB"]->setVisible( ( value == "alsa" || value == "oss" || value == "auhal" ||
                                            value == "directsound" || value == "waveout" ) );
 
+#ifdef _WIN32
+    // FIXME
+    if( value == "any" )
+        value = "directsound";
+#endif
     int volume = getDefaultAudioVolume(VLC_OBJECT(p_intf), qtu(value));
     bool save = true;
 
@@ -1220,48 +1243,54 @@ bool SPrefsPanel::addType( const char * psz_ext, QTreeWidgetItem* current,
     if( strstr( qvReg->ReadRegistryString( psz_ext, "", "" ), psz_VLC ) )
     {
         current->setCheckState( 0, Qt::Checked );
-        b_temp = false;
+        b_temp = true;
     }
     else
     {
         current->setCheckState( 0, Qt::Unchecked );
-        b_temp = true;
+        b_temp = false;
     }
     listAsso.append( current );
     return b_temp;
 }
 
-void SPrefsPanel::assoDialog()
-{
 #if !defined(__IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__)
 #define __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__
     const GUID IID_IApplicationAssociationRegistrationUI = {0x1f76a169,0xf994,0x40ac, {0x8f,0xc8,0x09,0x59,0xe8,0x87,0x47,0x10}};
-    const GUID CLSID_ApplicationAssociationRegistrationUI = { 0x1968106d,0xf3b5,0x44cf,{0x89,0x0e,0x11,0x6f,0xcb,0x9e,0xce,0xf1}};
-#ifdef __cplusplus
+    extern const GUID CLSID_ApplicationAssociationRegistrationUI;
     interface IApplicationAssociationRegistrationUI : public IUnknown
     {
         virtual HRESULT STDMETHODCALLTYPE LaunchAdvancedAssociationUI(
                 LPCWSTR pszAppRegName) = 0;
     };
-#endif /* __cplusplus */
 #endif /* __IApplicationAssociationRegistrationUI_INTERFACE_DEFINED__ */
 
-    IApplicationAssociationRegistrationUI *p_appassoc;
-    CoInitializeEx( NULL, COINIT_MULTITHREADED );
-
-    if( S_OK == CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
-                NULL, CLSCTX_INPROC_SERVER,
-                IID_IApplicationAssociationRegistrationUI,
-                (void **)&p_appassoc) )
+void SPrefsPanel::assoDialog()
+{
+    HRESULT hr;
+    hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
+    if( hr == RPC_E_CHANGED_MODE )
+        hr = CoInitializeEx( NULL, COINIT_APARTMENTTHREADED );
+    if( SUCCEEDED(hr) )
     {
-        if(S_OK == p_appassoc->LaunchAdvancedAssociationUI(L"VLC" ) )
+        void *p;
+
+        hr = CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
+                              NULL, CLSCTX_INPROC_SERVER,
+                              IID_IApplicationAssociationRegistrationUI, &p);
+        if( SUCCEEDED(hr) )
         {
-            CoUninitialize();
-            return;
+            IApplicationAssociationRegistrationUI *p_regui =
+                (IApplicationAssociationRegistrationUI *)p;
+
+            hr = p_regui->LaunchAdvancedAssociationUI(L"VLC" );
+            p_regui->Release();
         }
+        CoUninitialize();
     }
 
-    CoUninitialize();
+    if( SUCCEEDED(hr) )
+        return;
 
     QDialog *d = new QDialog( this );
     d->setWindowTitle( qtr( "File associations" ) );
@@ -1292,33 +1321,45 @@ void SPrefsPanel::assoDialog()
 #define aTv( name ) i_temp += addType( name, currentItem, videoType, qvReg )
 #define aTo( name ) i_temp += addType( name, currentItem, otherType, qvReg )
 
-    aTa( ".a52" ); aTa( ".aac" ); aTa( ".ac3" ); aTa( ".dts" ); aTa( ".flac" );
-    aTa( ".m4a" ); aTa( ".m4p" ); aTa( ".mka" ); aTa( ".mod" ); aTa( ".mp1" );
-    aTa( ".mp2" ); aTa( ".mp3" ); aTa( ".oma" ); aTa( ".oga" ); aTa( ".opus" );
-    aTa( ".spx" ); aTa( ".tta" ); aTa( ".wav" ); aTa( ".wma" ); aTa( ".xm" );
+    aTa( ".3ga" ); aTa( ".669" ); aTa( ".a52" ); aTa( ".aac" ); aTa( ".ac3" );
+    aTa( ".adt" ); aTa( ".adts" ); aTa( ".aif" ); aTa( ".aifc" ); aTa( ".aiff" );
+    aTa( ".au" ); aTa( ".amr" ); aTa( ".aob" ); aTa( ".ape" ); aTa( ".caf" );
+    aTa( ".cda" ); aTa( ".dts" ); aTa( ".flac" ); aTa( ".it" ); aTa( ".m4a" );
+    aTa( ".m4p" ); aTa( ".mid" ); aTa( ".mka" ); aTa( ".mlp" ); aTa( ".mod" );
+    aTa( ".mp1" ); aTa( ".mp2" ); aTa( ".mp3" ); aTa( ".mpc" ); aTa( ".mpga" );
+    aTa( ".oga" ); aTa( ".oma" ); aTa( ".opus" ); aTa( ".qcp" ); aTa( ".ra" );
+    aTa( ".rmi" ); aTa( ".snd" ); aTa( ".s3m" ); aTa( ".spx" ); aTa( ".tta" );
+    aTa( ".voc" ); aTa( ".vqf" ); aTa( ".w64" ); aTa( ".wav" ); aTa( ".wma" );
+    aTa( ".wv" ); aTa( ".xa" ); aTa( ".xm" );
     audioType->setCheckState( 0, ( i_temp > 0 ) ?
                               ( ( i_temp == audioType->childCount() ) ?
                                Qt::Checked : Qt::PartiallyChecked )
                             : Qt::Unchecked );
 
     i_temp = 0;
-    aTv( ".asf" ); aTv( ".avi" ); aTv( ".divx" ); aTv( ".dv" ); aTv( ".flv" );
-    aTv( ".gxf" ); aTv( ".m1v" ); aTv( ".m2v" ); aTv( ".m2ts" ); aTv( ".m4v" );
-    aTv( ".mkv" ); aTv( ".mov" ); aTv( ".mp2" ); aTv( ".mp4" ); aTv( ".mpeg" );
-    aTv( ".mpeg1" ); aTv( ".mpeg2" ); aTv( ".mpeg4" ); aTv( ".mpg" );
-    aTv( ".mts" ); aTv( ".mtv" ); aTv( ".mxf" );
-    aTv( ".ogg" ); aTv( ".ogm" ); aTv( ".ogx" ); aTv( ".ogv" );  aTv( ".ts" );
-    aTv( ".vob" ); aTv( ".vro" ); aTv( ".wmv" );
+    aTv( ".3g2" ); aTv( ".3gp" ); aTv( ".3gp2" ); aTv( ".3gpp" ); aTv( ".amv" );
+    aTv( ".asf" ); aTv( ".avi" ); aTv( ".bik" ); aTv( ".divx" ); aTv( ".drc" );
+    aTv( ".dv" ); aTv( ".f4v" ); aTv( ".flv" ); aTv( ".gvi" ); aTv( ".gxf" );
+    aTv( ".m1v" ); aTv( ".m2t" ); aTv( ".m2v" ); aTv( ".m2ts" ); aTv( ".m4v" );
+    aTv( ".mkv" ); aTv( ".mov" ); aTv( ".mp2" ); aTv( ".mp2v" ); aTv( ".mp4" );
+    aTv( ".mp4v" ); aTv( ".mpa" ); aTv( ".mpe" ); aTv( ".mpeg" ); aTv( ".mpeg1" );
+    aTv( ".mpeg2" ); aTv( ".mpeg4" ); aTv( ".mpg" ); aTv( ".mpv2" ); aTv( ".mts" );
+    aTv( ".mtv" ); aTv( ".mxf" ); aTv( ".nsv" ); aTv( ".nuv" ); aTv( ".ogg" );
+    aTv( ".ogm" ); aTv( ".ogx" ); aTv( ".ogv" ); aTv( ".rec" ); aTv( ".rm" );
+    aTv( ".rmvb" ); aTv( ".rpl" ); aTv( ".thp" ); aTv( ".tod" ); aTv( ".ts" );
+    aTv( ".tts" ); aTv( ".vob" ); aTv( ".vro" ); aTv( ".webm" ); aTv( ".wmv" );
+    aTv( ".xesc" );
     videoType->setCheckState( 0, ( i_temp > 0 ) ?
-                              ( ( i_temp == audioType->childCount() ) ?
+                              ( ( i_temp == videoType->childCount() ) ?
                                Qt::Checked : Qt::PartiallyChecked )
                             : Qt::Unchecked );
 
     i_temp = 0;
-    aTo( ".asx" ); aTo( ".b4s" ); aTo( ".ifo" ); aTo( ".m3u" ); aTo( ".pls" );
-    aTo( ".sdp" ); aTo( ".vlc" ); aTo( ".xspf" );
+    aTo( ".asx" ); aTo( ".b4s" ); aTo( ".cue" ); aTo( ".ifo" ); aTo( ".m3u" );
+    aTo( ".m3u8" ); aTo( ".pls" ); aTo( ".ram" ); aTo( ".sdp" ); aTo( ".vlc" );
+    aTo( ".wvx" ); aTo( ".xspf" );
     otherType->setCheckState( 0, ( i_temp > 0 ) ?
-                              ( ( i_temp == audioType->childCount() ) ?
+                              ( ( i_temp == otherType->childCount() ) ?
                                Qt::Checked : Qt::PartiallyChecked )
                             : Qt::Unchecked );
 
@@ -1350,7 +1391,7 @@ void addAsso( QVLCRegistry *qvReg, const char *psz_ext )
     /* Save a backup if already assigned */
     char *psz_value = qvReg->ReadRegistryString( psz_ext, "", ""  );
 
-    if( !EMPTY_STR(psz_value) )
+    if( !EMPTY_STR(psz_value) && strcmp( qtu(s_path), psz_value ) )
         qvReg->WriteRegistryString( psz_ext, "VLC.backup", psz_value );
     free( psz_value );
 
@@ -1392,17 +1433,16 @@ void delAsso( QVLCRegistry *qvReg, const char *psz_ext )
         if( psz_value )
             qvReg->WriteRegistryString( psz_ext, "", psz_value );
 
-        qvReg->DeleteKey( psz_ext, "VLC.backup" );
+        qvReg->DeleteValue( psz_ext, "VLC.backup" );
     }
     free( psz_value );
 }
 
 void SPrefsPanel::saveAsso()
 {
-    QVLCRegistry * qvReg = NULL;
+    QVLCRegistry * qvReg = new QVLCRegistry( HKEY_CLASSES_ROOT );
     for( int i = 0; i < listAsso.size(); i ++ )
     {
-        qvReg  = new QVLCRegistry( HKEY_CLASSES_ROOT );
         if( listAsso[i]->checkState( 0 ) > 0 )
         {
             addAsso( qvReg, qtu( listAsso[i]->text( 0 ) ) );
diff --git a/modules/gui/qt4/components/sout/profile_selector.cpp b/modules/gui/qt4/components/sout/profile_selector.cpp
index 19f6974..00e29dd 100644
--- a/modules/gui/qt4/components/sout/profile_selector.cpp
+++ b/modules/gui/qt4/components/sout/profile_selector.cpp
@@ -2,7 +2,7 @@
  * profile_selector.cpp : A small profile selector and editor
  ****************************************************************************
  * Copyright (C) 2009 the VideoLAN team
- * $Id: 032101007e0601f90e668158ba775f9e4e6b9ae7 $
+ * $Id: 858a8ec64c5bfb263c43e489df9b83c07b587fe2 $
  *
  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
  *
@@ -498,8 +498,9 @@ inline void VLCProfileEditor::registerFilters()
 
 inline void VLCProfileEditor::registerCodecs()
 {
-#define SETMUX( button, val,    vid, aud, men, sub, stream, chaps ) \
+#define SETMUX( button, val, mod, vid, aud, men, sub, stream, chaps ) \
     ui.button->setProperty( "sout", val );\
+    ui.button->setProperty( "module", mod );\
     ui.button->setProperty( "capvideo", vid );\
     ui.button->setProperty( "capaudio", aud );\
     ui.button->setProperty( "capmenu", men );\
@@ -507,19 +508,19 @@ inline void VLCProfileEditor::registerCodecs()
     ui.button->setProperty( "capstream", stream );\
     ui.button->setProperty( "capchaps", chaps );\
     CONNECT( ui.button, clicked(bool), this, muxSelected() );
-    SETMUX( PSMux, "ps",        true, true, false, true, false, true )
-    SETMUX( TSMux, "ts",        true, true, false, true, true, false )
-    SETMUX( WEBMux, "webm",     true, true, false, false, true, false )
-    SETMUX( MPEG1Mux, "mpeg1",  true, true, false, false, false, false )
-    SETMUX( OggMux, "ogg",      true, true, false, false, true, true )
-    SETMUX( ASFMux, "asf",      true, true, false, true, true, true )
-    SETMUX( MOVMux, "mp4",      true, true, true, true, true, false )
-    SETMUX( WAVMux, "wav",      false, true, false, false, false, false )
-    SETMUX( RAWMux, "raw",      true, true, false, false, false, false )
-    SETMUX( FLVMux, "flv",      true, true, false, false, true, false )
-    SETMUX( MKVMux, "mkv",      true, true, true, true, true, true )
-    SETMUX( AVIMux, "avi",      true, true, false, false, false, false )
-    SETMUX( MJPEGMux, "mpjpeg", true, false, false, false, false, false )
+    SETMUX( PSMux, "ps", "mux_ps",  true, true, false, true, false, true )
+    SETMUX( TSMux, "ts", "mux_ts",  true, true, false, true, true, false )
+    SETMUX( WEBMux, "webm", "avformat", true, true, false, false, true, false )
+    SETMUX( MPEG1Mux, "mpeg1", "mux_ps", true, true, false, false, false, false )
+    SETMUX( OggMux, "ogg", "mux_ogg", true, true, false, false, true, true )
+    SETMUX( ASFMux, "asf", "mux_asf", true, true, false, true, true, true )
+    SETMUX( MOVMux, "mp4", "mux_mp4", true, true, true, true, true, false )
+    SETMUX( WAVMux, "wav", "mux_wav", false, true, false, false, false, false )
+    SETMUX( RAWMux, "raw", "mux_dummy", true, true, false, false, false, false )
+    SETMUX( FLVMux, "flv", "avformat", true, true, false, false, true, false )
+    SETMUX( MKVMux, "mkv", "avformat", true, true, true, true, true, true )
+    SETMUX( AVIMux, "avi", "mux_avi", true, true, false, false, false, false )
+    SETMUX( MJPEGMux, "mpjpeg", "mux_mpjpeg", true, false, false, false, false, false )
 #undef SETMUX
 
 #define ADD_VCODEC( name, fourcc ) \
@@ -597,12 +598,16 @@ void VLCProfileEditor::muxSelected()
     SETYESNOSTATE( capsubs, "capsubs" );
     SETYESNOSTATE( capstream, "capstream" );
     SETYESNOSTATE( capchaps, "capchaps" );
-    bool b = caps["muxers"].contains( "mux_" + current->property("sout").toString() );
-    if ( !b )
+    if( current->property("module").toString() == "avformat" )
         ui.muxerwarning->setText(
                     QString( "<img src=\":/menu/info\"/> %1" )
                     .arg( qtr( "This muxer is not provided directly by VLC: It could be missing." ) )
                     );
+    else if ( !caps["muxers"].contains( current->property("module").toString() ) )
+        ui.muxerwarning->setText(
+                    QString( "<img src=\":/menu/quit\"/> %1" )
+                    .arg( qtr( "This muxer is missing. Using this profile will fail" ) )
+                    );
     else
         ui.muxerwarning->setText("");
     return;
diff --git a/modules/gui/qt4/dialogs/bookmarks.cpp b/modules/gui/qt4/dialogs/bookmarks.cpp
index 18558db..bfea0eb 100644
--- a/modules/gui/qt4/dialogs/bookmarks.cpp
+++ b/modules/gui/qt4/dialogs/bookmarks.cpp
@@ -278,3 +278,14 @@ void BookmarksDialog::activateItem( QModelIndex index )
 
     input_Control( p_input, INPUT_SET_BOOKMARK, index.row() );
 }
+
+void BookmarksDialog::toggleVisible()
+{
+    /* Update, to show existing bookmarks in case a new playlist
+       was opened */
+    if( !isVisible() )
+    {
+        update();
+    }
+    QVLCFrame::toggleVisible();
+}
diff --git a/modules/gui/qt4/dialogs/bookmarks.hpp b/modules/gui/qt4/dialogs/bookmarks.hpp
index ddf4aaf..52eee64 100644
--- a/modules/gui/qt4/dialogs/bookmarks.hpp
+++ b/modules/gui/qt4/dialogs/bookmarks.hpp
@@ -2,7 +2,7 @@
  * bookmarks.hpp : bookmarks
  ****************************************************************************
  * Copyright (C) 2006 the VideoLAN team
- * $Id: ad81bc2c7009a09adf0f0f985cbabc99e5c0f05a $
+ * $Id: 17c7bdee98df204b998517f011ae89b91bf56348 $
  *
  * Authors: Antoine Lejeune <phytos@via.ecp.fr>
  *
@@ -35,6 +35,8 @@ class QPushButton;
 class BookmarksDialog : public QVLCFrame, public Singleton<BookmarksDialog>
 {
     Q_OBJECT
+public:
+    void toggleVisible();
 private:
     BookmarksDialog( intf_thread_t * );
     virtual ~BookmarksDialog();
diff --git a/modules/gui/qt4/dialogs/mediainfo.cpp b/modules/gui/qt4/dialogs/mediainfo.cpp
index f778994..e58a7fe 100644
--- a/modules/gui/qt4/dialogs/mediainfo.cpp
+++ b/modules/gui/qt4/dialogs/mediainfo.cpp
@@ -2,7 +2,7 @@
  * mediainfo.cpp : Information about an item
  ****************************************************************************
  * Copyright (C) 2006-2008 the VideoLAN team
- * $Id: 23db28089826c0dd69e220e5d7af6775b2a9c8f4 $
+ * $Id: 809ff2878dca199fc86661b035e61ad3a8673d0e $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -54,7 +54,8 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
         setWindowTitle( qtr( "Media Information" ) );
     setWindowRole( "vlc-media-info" );
 
-    setWindowFlags( Qt::Window | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint );
+    setWindowFlags( Qt::Window | Qt::CustomizeWindowHint |
+                    Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint );
 
     /* TabWidgets and Tabs creation */
     infoTabW = new QTabWidget;
diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index 39688ec..a780379 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -2,7 +2,7 @@
  * plugins.cpp : Plug-ins and extensions listing
  ****************************************************************************
  * Copyright (C) 2008-2010 the VideoLAN team
- * $Id: 814eb3353685f1954cdbb52ac1aacc5c4fd06628 $
+ * $Id: ea2602981395e2eb8b960c411c338e26ffa62a7e $
  *
  * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
  *          Jean-Philippe André <jpeg (at) videolan.org>
@@ -383,6 +383,12 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
                   qtr( "Service discoveries adds new sources to your playlist"
                        " such as web radios, video websites, ..." ),
                   ADDON_SERVICE_DISCOVERY );
+    ADD_CATEGORY( qtr("Interfaces"),
+                  "",
+                  ADDON_INTERFACE );
+    ADD_CATEGORY( qtr("Art and meta fetchers"),
+                  qtr( "Retrieves extra info and art for playlist items" ),
+                  ADDON_META );
     ADD_CATEGORY( qtr("Extensions"),
                   qtr( "Extensions brings various enhancements."
                        " Check descriptions for more details" ),
@@ -931,6 +937,12 @@ QColor AddonsListModel::getColorByAddonType( int i_type )
     case ADDON_SKIN2:
         color = QColor(0x8B, 0xD6, 0xFC);
         break;
+    case ADDON_INTERFACE:
+        color = QColor(0x00, 0x13, 0x85);
+        break;
+    case ADDON_META:
+        color = QColor(0xCD, 0x23, 0xBF);
+        break;
     case ADDON_PLUGIN:
     case ADDON_UNKNOWN:
     case ADDON_OTHER:
diff --git a/modules/gui/qt4/dialogs/sout.cpp b/modules/gui/qt4/dialogs/sout.cpp
index 3e0200c..6472e1d 100644
--- a/modules/gui/qt4/dialogs/sout.cpp
+++ b/modules/gui/qt4/dialogs/sout.cpp
@@ -3,7 +3,7 @@
  ****************************************************************************
  * Copyright (C) 2007-2009 the VideoLAN team
  *
- * $Id: b647bded8e00e78bd386e60c64cd1191dfb8c198 $
+ * $Id: cb4fc1e76de074b2bfc600716dd6005c9288b6b1 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -88,7 +88,10 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
     CB( localOutput ); CB( transcodeBox );
     CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() );
 
-    setButtonText( QWizard::FinishButton, "Stream" );
+    setButtonText( QWizard::BackButton, qtr("Back") );
+    setButtonText( QWizard::CancelButton, qtr("Cancel") );
+    setButtonText( QWizard::NextButton, qtr("Next") );
+    setButtonText( QWizard::FinishButton, qtr("Stream") );
 
 #undef CC
 #undef CS
diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp
index 49bcaec..c46a9c6 100644
--- a/modules/gui/qt4/dialogs/toolbar.cpp
+++ b/modules/gui/qt4/dialogs/toolbar.cpp
@@ -2,7 +2,7 @@
  * toolbar.cpp : ToolbarEdit dialog
  ****************************************************************************
  * Copyright (C) 2008-2009 the VideoLAN team
- * $Id: f102133aa1e266ea89ad178b11c860d56852cf02 $
+ * $Id: c1e667ae807669003978d03ac12c3d6be493ee51 $
  *
  * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
  *
@@ -673,7 +673,7 @@ void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout,
         widg->installEventFilter( this );
 
         /* We are in a complex widget, we need to stop events on children too */
-        if( i_type >= VOLUME && i_type < SPECIAL_MAX )
+        if( i_type >= TIME_LABEL && i_type < SPECIAL_MAX )
         {
             QList<QObject *>children = widg->children();
 
@@ -690,7 +690,7 @@ void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout,
 
             /* Decorating the frames when possible */
             QFrame *frame;
-            if( i_type >= MENU_BUTTONS  /* Don't bother to check for volume */
+            if( (i_type >= MENU_BUTTONS || i_type == TIME_LABEL) /* Don't bother to check for volume */
                 && ( frame = qobject_cast<QFrame *>( widg ) ) != NULL )
             {
                 frame->setFrameStyle( QFrame::Panel | QFrame::Raised );
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 09d9235..4ba6eae 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: 1a04f513632a53169fa19efe857a9c1738d08b6e $
+ * $Id: 8283fdc247f736c062bd994641a4fafb7e898217 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Ilkka Ollakka  <ileoo@videolan.org>
@@ -127,18 +127,26 @@ void InputManager::setInput( input_thread_t *_p_input )
         p_item = input_GetItem( p_input );
         emit rateChanged( var_GetFloat( p_input, "rate" ) );
 
+        char *uri = input_item_GetURI( p_item );
+
         /* Get Saved Time */
         if( p_item->i_type == ITEM_TYPE_FILE )
         {
-            int i_time = RecentsMRL::getInstance( p_intf )->time( p_item->psz_uri );
-            if( i_time > 0 &&
+            int i_time = RecentsMRL::getInstance( p_intf )->time( qfu(uri) );
+            if( i_time > 0 && qfu( uri ) != lastURI &&
                     !var_GetFloat( p_input, "run-time" ) &&
                     !var_GetFloat( p_input, "start-time" ) &&
                     !var_GetFloat( p_input, "stop-time" ) )
             {
-                emit continuePlayback( (int64_t)i_time * 1000 );
+                emit resumePlayback( (int64_t)i_time * 1000 );
             }
         }
+
+        // Save the latest URI to avoid asking to restore the
+        // position on the same input file.
+        lastURI = qfu( uri );
+        RecentsMRL::getInstance( p_intf )->addRecent( lastURI );
+        free( uri );
     }
     else
     {
@@ -157,13 +165,18 @@ void InputManager::delInput()
     msg_Dbg( p_intf, "IM: Deleting the input" );
 
     /* Save time / position */
-    float f_pos = var_GetFloat( p_input , "position" );
-    int64_t i_time = var_GetTime( p_input, "time");
-    int i_length = var_GetTime( p_input , "length" ) / CLOCK_FREQ;
-    if( f_pos < 0.05 || f_pos > 0.95 || i_length < 60) {
-        i_time = -1;
+    char *uri = input_item_GetURI( p_item );
+    if( uri != NULL ) {
+        float f_pos = var_GetFloat( p_input , "position" );
+        int64_t i_time = -1;
+
+        if( f_pos >= 0.05f && f_pos <= 0.95f
+         && var_GetTime( p_input, "length" ) >= 60 * CLOCK_FREQ )
+            i_time = var_GetTime( p_input, "time");
+
+        RecentsMRL::getInstance( p_intf )->setTime( qfu(uri), i_time );
+        free(uri);
     }
-    RecentsMRL::getInstance( p_intf )->setTime( p_item->psz_uri, i_time );
 
     delCallbacks();
     i_old_playing_status = END_S;
@@ -1097,6 +1110,7 @@ void MainInputManager::customEvent( QEvent *event )
 void MainInputManager::stop()
 {
    playlist_Stop( THEPL );
+   getIM()->lastURI.clear();
 }
 
 void MainInputManager::next()
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 7f7c88d..ddd273a 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: 60719b88a34cd050380bcb2bb08511432bf1f02f $
+ * $Id: b69b6f930b13712b282f6a1a18374c127b8730f0 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste <jb@videolan.org>
@@ -154,6 +154,7 @@ private:
     input_item_t   *p_item;
     int             i_old_playing_status;
     QString         oldName;
+    QString         lastURI;
     QString         artUrl;
     float           f_rate;
     float           f_cache;
@@ -223,8 +224,8 @@ signals:
     void titleChanged( bool );
     void chapterChanged( bool );
     void inputCanSeek( bool );
-    /// You can continuePlayback
-    void continuePlayback( int64_t );
+    /// You can resume playback
+    void resumePlayback( int64_t );
     /// Statistics are updated
     void statisticsUpdated( input_item_t* );
     void infoChanged( input_item_t* );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index b152ea1..d2fdc6d 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -2,7 +2,7 @@
  * main_interface.cpp : Main interface
  ****************************************************************************
  * Copyright (C) 2006-2011 VideoLAN and AUTHORS
- * $Id: 4734749a0b0e7133563862e5ccd63e887de54031 $
+ * $Id: 8c911e87c7874ab93b84d878e3aaa528e7339704 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -368,54 +368,77 @@ void MainInterface::reloadPrefs()
     }
 }
 
-void MainInterface::createContinueDialog( QWidget *w )
+void MainInterface::createResumePanel( QWidget *w )
 {
-    /* Create non-modal continueDialog */
-    continueDialog = new QWidget( w );
-    continueDialog->hide();
-    QHBoxLayout *continueDialogLayout = new QHBoxLayout( continueDialog );
-    continueDialogLayout->setSpacing( 0 ); continueDialogLayout->setMargin( 0 );
+    resumePanel = new QWidget( w );
+    resumePanel->hide();
+    QHBoxLayout *resumePanelLayout = new QHBoxLayout( resumePanel );
+    resumePanelLayout->setSpacing( 0 ); resumePanelLayout->setMargin( 0 );
+
+    QLabel *continuePixmapLabel = new QLabel();
+    continuePixmapLabel->setPixmap( QPixmap( ":/menu/help" ) );
+    continuePixmapLabel->setContentsMargins( 5, 0, 5, 0 );
 
     QLabel *continueLabel = new QLabel( qtr( "Do you want to restart the playback where left off?") );
-    QToolButton *cancel = new QToolButton( continueDialog );
+
+    QToolButton *cancel = new QToolButton( resumePanel );
     cancel->setAutoRaise( true );
     cancel->setText( "X" );
-    QPushButton *ok = new QPushButton( qtr("&Continue")  );
 
-    continueDialogLayout->addWidget(continueLabel);
-    continueDialogLayout->addStretch( 1 );
-    continueDialogLayout->addWidget( ok );
-    continueDialogLayout->addWidget( cancel );
+    QPushButton *ok = new QPushButton( qtr( "&Continue" )  );
+
+    resumePanelLayout->addWidget( continuePixmapLabel );
+    resumePanelLayout->addWidget( continueLabel );
+    resumePanelLayout->addStretch( 1 );
+    resumePanelLayout->addWidget( ok );
+    resumePanelLayout->addWidget( cancel );
 
-    CONNECT( cancel, clicked(), continueDialog, hide() );
-    BUTTONACT(ok, continuePlayback() );
+    resumeTimer = new QTimer( resumePanel );
+    resumeTimer->setSingleShot( true );
+    resumeTimer->setInterval( 6000 );
 
-    CONNECT( THEMIM->getIM(), continuePlayback(int64_t), this, showContinueDialog(int64_t) );
+    CONNECT( resumeTimer, timeout(), this, hideResumePanel() );
+    CONNECT( cancel, clicked(), this, hideResumePanel() );
+    CONNECT( THEMIM->getIM(), resumePlayback(int64_t), this, showResumePanel(int64_t) );
+    BUTTONACT( ok, resumePlayback() );
 
-    w->layout()->addWidget( continueDialog );
+    w->layout()->addWidget( resumePanel );
 }
 
-void MainInterface::showContinueDialog( int64_t _time ) {
+void MainInterface::showResumePanel( int64_t _time ) {
     int setting = var_InheritInteger( p_intf, "qt-continue" );
 
     if( setting == 0 )
         return;
 
-    i_continueTime = _time;
+    i_resumeTime = _time;
 
     if( setting == 2)
-        continuePlayback();
+        resumePlayback();
     else
     {
-        continueDialog->setVisible(true);
-        QTimer::singleShot(6000, continueDialog, SLOT(hide()));
+        resumePanel->setVisible(true);
+        resumeTimer->start();
     }
 }
 
-void MainInterface::continuePlayback()
+void MainInterface::hideResumePanel()
 {
-    var_SetTime( THEMIM->getInput(), "time", i_continueTime );
-    continueDialog->hide();
+    if( resumePanel->isVisible() )
+    {
+        if( !isFullScreen() && !isMaximized() )
+            resize( width(), height() - resumePanel->height() );
+        resumePanel->hide();
+        resumeTimer->stop();
+    }
+}
+
+void MainInterface::resumePlayback()
+{
+    if( THEMIM->getIM()->hasInput() ) {
+        var_SetTime( THEMIM->getInput(), "time", i_resumeTime );
+    }
+    hideResumePanel();
 }
 
 void MainInterface::createMainWidget( QSettings *creationSettings )
@@ -427,7 +450,7 @@ void MainInterface::createMainWidget( QSettings *creationSettings )
     main->setContentsMargins( 0, 0, 0, 0 );
     mainLayout->setSpacing( 0 ); mainLayout->setMargin( 0 );
 
-    createContinueDialog( main );
+    createResumePanel( main );
     /* */
     stackCentralW = new QVLCStackedWidget( main );
 
@@ -744,6 +767,7 @@ void MainInterface::releaseVideoSlot( void )
     videoWidget->release();
     setVideoOnTop( false );
     setVideoFullScreen( false );
+    hideResumePanel();
 
     if( stackCentralW->currentWidget() == videoWidget )
         restoreStackOldWidget();
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 2e8f2b4..b7cea00 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -2,7 +2,7 @@
  * main_interface.hpp : Main Interface
  ****************************************************************************
  * Copyright (C) 2006-2010 VideoLAN and AUTHORS
- * $Id: e3f36a74158113bdfb364c43380ea966fd80b194 $
+ * $Id: 8d59f653e99cc3fc89819b1d79a6a6ebaef49e58 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *          Jean-Baptiste Kempf <jb@videolan.org>
@@ -54,6 +54,7 @@ class SpeedControlWidget;
 class QVBoxLayout;
 class QMenu;
 class QSize;
+class QTimer;
 class StandardPLPanel;
 
 class MainInterface : public QVLCMW
@@ -111,7 +112,7 @@ private:
     void createMainWidget( QSettings* );
     void createStatusBar();
     void createPlaylist();
-    void createContinueDialog( QWidget *w );
+    void createResumePanel( QWidget *w );
 
     /* Systray */
     void createSystray();
@@ -147,9 +148,10 @@ private:
     PlaylistWidget      *playlistWidget;
     //VisualSelector      *visualSelector;
 
-    /* continue */
-    QWidget             *continueDialog;
-    int64_t             i_continueTime;
+    /* resume panel */
+    QWidget             *resumePanel;
+    QTimer              *resumeTimer;
+    int64_t             i_resumeTime;
 
     /* Status Bar */
     QLabel              *nameLabel;
@@ -259,8 +261,9 @@ private slots:
     void setBoss();
     void setRaise();
 
-    void showContinueDialog( int64_t);
-    void continuePlayback();
+    void showResumePanel( int64_t);
+    void hideResumePanel();
+    void resumePlayback();
 
 signals:
     void askGetVideo( WId *p_id, int *pi_x, int *pi_y,
diff --git a/modules/gui/qt4/managers/addons_manager.cpp b/modules/gui/qt4/managers/addons_manager.cpp
index 7449acc..6309ca3 100644
--- a/modules/gui/qt4/managers/addons_manager.cpp
+++ b/modules/gui/qt4/managers/addons_manager.cpp
@@ -86,6 +86,10 @@ QString AddonsManager::getAddonType( int i_type )
         return qtr("Playlist parsers");
     case ADDON_SERVICE_DISCOVERY:
         return qtr("Service Discovery");
+    case ADDON_INTERFACE:
+        return qtr("Interfaces");
+    case ADDON_META:
+        return qtr("Art and meta fetchers");
     case ADDON_EXTENSION:
         return qtr("Extensions");
     default:
diff --git a/modules/gui/qt4/util/qvlcframe.hpp b/modules/gui/qt4/util/qvlcframe.hpp
index 1613566..032987f 100644
--- a/modules/gui/qt4/util/qvlcframe.hpp
+++ b/modules/gui/qt4/util/qvlcframe.hpp
@@ -2,7 +2,7 @@
  * qvlcframe.hpp : A few helpers
  *****************************************************************************
  * Copyright (C) 2006-2007 the VideoLAN team
- * $Id: 2747a4a332b6d98ccdc9721cdfd5c7ae8ab27ecc $
+ * $Id: eff2154899e031f4835d3ca6cdcc30b90e8f8740 $
  *
  * Authors: Clément Stenac <zorglub@videolan.org>
  *
@@ -152,7 +152,10 @@ class QVLCDialog : public QDialog
 public:
     QVLCDialog( QWidget* parent, intf_thread_t *_p_intf ) :
                                     QDialog( parent ), p_intf( _p_intf )
-    {}
+    {
+        setWindowFlags( Qt::Dialog|Qt::WindowMinMaxButtonsHint|
+                        Qt::WindowSystemMenuHint|Qt::WindowCloseButtonHint );
+    }
     virtual ~QVLCDialog() {};
     void toggleVisible()
     {
diff --git a/modules/gui/qt4/util/timetooltip.cpp b/modules/gui/qt4/util/timetooltip.cpp
index bb4d40f..26c2179 100644
--- a/modules/gui/qt4/util/timetooltip.cpp
+++ b/modules/gui/qt4/util/timetooltip.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
  * Copyright © 2011-2012 VideoLAN
- * $Id: bb472d7111e33c13d4e03dd4954767f03e69e98e $
+ * $Id: 574eca9d259c5c69645ff4cba5936df36ea66460 $
  *
  * Authors: Ludovic Fauvet <etix@l0cal.com>
  *
@@ -33,12 +33,14 @@
 TimeTooltip::TimeTooltip( QWidget *parent ) :
     QWidget( parent )
 {
-    setWindowFlags( Qt::Window                  |
+    setWindowFlags(
+#if defined( Q_OS_WIN )
+                    Qt::ToolTip
+#else
+                    Qt::Window                  |
                     Qt::WindowStaysOnTopHint    |
                     Qt::FramelessWindowHint     |
                     Qt::X11BypassWindowManagerHint
-#if HAS_QT5
-                    | Qt::WindowDoesNotAcceptFocus
 #endif
                     );
 
diff --git a/modules/lua/demux.c b/modules/lua/demux.c
index f5a760a..b732eeb 100644
--- a/modules/lua/demux.c
+++ b/modules/lua/demux.c
@@ -2,7 +2,7 @@
  * demux.c :  Lua playlist demux module
  *****************************************************************************
  * Copyright (C) 2007-2008 the VideoLAN team
- * $Id: eac4f249edce222cf5aa51a9b438b2d3373671cb $
+ * $Id: 13ccf61673429aca2499ec610b4af30117fab495 $
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
  *
@@ -163,7 +163,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename,
     }
 
     /* Load and run the script(s) */
-    if( luaL_dofile( L, psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_demux), L, psz_filename ) )
     {
         msg_Warn( p_demux, "Error loading script %s: %s", psz_filename,
                   lua_tostring( L, lua_gettop( L ) ) );
diff --git a/modules/lua/intf.c b/modules/lua/intf.c
index f74e8af..9eb51b0 100644
--- a/modules/lua/intf.c
+++ b/modules/lua/intf.c
@@ -2,7 +2,7 @@
  * intf.c: Generic lua interface functions
  *****************************************************************************
  * Copyright (C) 2007-2008 the VideoLAN team
- * $Id: 61943549abcaf4278f8e9a151e688e9a976e4646 $
+ * $Id: 841587f2222471414b1069473205c51443a2397e $
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
  *
@@ -402,7 +402,7 @@ static void *Run( void *data )
     intf_sys_t *p_sys = p_intf->p_sys;
     lua_State *L = p_sys->L;
 
-    if( luaL_dofile( L, p_sys->psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_intf), L, p_sys->psz_filename ) )
     {
         msg_Err( p_intf, "Error loading script %s: %s", p_sys->psz_filename,
                  lua_tostring( L, lua_gettop( L ) ) );
diff --git a/modules/lua/libs/input.c b/modules/lua/libs/input.c
index 5050541..d0f61e6 100644
--- a/modules/lua/libs/input.c
+++ b/modules/lua/libs/input.c
@@ -2,7 +2,7 @@
  * input.c
  *****************************************************************************
  * Copyright (C) 2007-2008 the VideoLAN team
- * $Id: 5b800802ac53d8941e38c5952bbbc139fe7af143 $
+ * $Id: 2d6d835eea60aeca31b36f7c2118ef06b0a8fafb $
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
  *
@@ -349,6 +349,7 @@ static int vlclua_input_item_set_meta( lua_State *L )
         META_TYPE( URL, "url" )
         META_TYPE( Language, "language" )
         META_TYPE( NowPlaying, "now_playing" )
+        META_TYPE( ESNowPlaying, "now_playing" )
         META_TYPE( Publisher, "publisher" )
         META_TYPE( EncodedBy, "encoded_by" )
         META_TYPE( ArtworkURL, "artwork_url" )
diff --git a/modules/lua/meta.c b/modules/lua/meta.c
index 4fc586a..c4bf03a 100644
--- a/modules/lua/meta.c
+++ b/modules/lua/meta.c
@@ -2,7 +2,7 @@
  * meta.c: Get meta/artwork using lua scripts
  *****************************************************************************
  * Copyright (C) 2007-2008 the VideoLAN team
- * $Id: 34c5d87bce95c8c567d0fa04f0173761760062f9 $
+ * $Id: b78fa935a7aa03ce0adfbe1c3900ae4736847e8a $
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
  *          Pierre d'Herbemont <pdherbemont # videolan.org>
@@ -89,7 +89,7 @@ static int run( vlc_object_t *p_this, const char * psz_filename,
     lua_setglobal( L, luafunction );
 
     /* Load and run the script(s) */
-    if( luaL_dofile( L, psz_filename ) )
+    if( vlclua_dofile( p_this, L, psz_filename ) )
     {
         msg_Warn( p_this, "Error loading script %s: %s", psz_filename,
                  lua_tostring( L, lua_gettop( L ) ) );
diff --git a/modules/lua/services_discovery.c b/modules/lua/services_discovery.c
index 74c8c6c..62ea9ec 100644
--- a/modules/lua/services_discovery.c
+++ b/modules/lua/services_discovery.c
@@ -124,7 +124,7 @@ int Open_LuaSD( vlc_object_t *p_this )
                   p_sys->psz_filename );
         goto error;
     }
-    if( luaL_dofile( L, p_sys->psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_sd), L, p_sys->psz_filename ) )
     {
         msg_Err( p_sd, "Error loading script %s: %s", p_sys->psz_filename,
                   lua_tostring( L, lua_gettop( L ) ) );
@@ -317,7 +317,7 @@ static int FillDescriptor( services_discovery_t *p_sd,
     /* Create a new lua thread */
     lua_State *L = luaL_newstate();
 
-    if( luaL_dofile( L, p_sys->psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_sd), L, p_sys->psz_filename ) )
     {
         msg_Err( p_sd, "Error loading script %s: %s", p_sys->psz_filename,
                  lua_tostring( L, -1 ) );
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index f08f1a9..737bdbd 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -2,7 +2,7 @@
  * vlc.c: Generic lua interface functions
  *****************************************************************************
  * Copyright (C) 2007-2008 the VideoLAN team
- * $Id: df235d06c7ff09c1477d963560a655551d0ca993 $
+ * $Id: dd8987bcfe0c78963dd14f0ffc88a9715b58f93e $
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
  *          Pierre d'Herbemont <pdherbemont # videolan.org>
@@ -669,7 +669,7 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
                 free( psz_filename );
                 goto error;
             }
-            if( luaL_dofile( L, psz_filename ) )
+            if( vlclua_dofile( VLC_OBJECT(probe), L, psz_filename ) )
             {
 
                 msg_Err( probe, "Error loading script %s: %s", psz_filename,
@@ -835,15 +835,23 @@ int vlclua_add_modules_path( lua_State *L, const char *psz_filename )
 }
 
 /** Replacement for luaL_dofile, using VLC's input capabilities */
-int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *uri )
+int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *curi )
 {
-    if( !strstr( uri, "://" ) )
-        return luaL_dofile( L, uri );
-    if( !strncasecmp( uri, "file://", 7 ) )
-        return luaL_dofile( L, uri + 7 );
+    char *uri = ToLocaleDup( curi );
+    if( !strstr( uri, "://" ) ) {
+        int ret = luaL_dofile( L, uri );
+        free( uri );
+        return ret;
+    }
+    if( !strncasecmp( uri, "file://", 7 ) ) {
+        int ret = luaL_dofile( L, uri + 7 );
+        free( uri );
+        return ret;
+    }
     stream_t *s = stream_UrlNew( p_this, uri );
     if( !s )
     {
+        free( uri );
         return 1;
     }
     int64_t i_size = stream_Size( s );
@@ -852,6 +860,7 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *uri )
     {
         // FIXME: read the whole stream until we reach the end (if no size)
         stream_Delete( s );
+        free( uri );
         return 1;
     }
     int64_t i_read = stream_Read( s, p_buffer, (int) i_size );
@@ -862,5 +871,6 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *uri )
         i_ret = lua_pcall( L, 0, LUA_MULTRET, 0 );
     stream_Delete( s );
     free( p_buffer );
+    free( uri );
     return i_ret;
 }
diff --git a/modules/mux/dummy.c b/modules/mux/dummy.c
index 488e75b..16546fa 100644
--- a/modules/mux/dummy.c
+++ b/modules/mux/dummy.c
@@ -2,7 +2,7 @@
  * dummy.c: dummy muxer module for vlc
  *****************************************************************************
  * Copyright (C) 2001, 2002 VLC authors and VideoLAN
- * $Id: 64ad84a757643c7d1653a76856cc1d6cfcff76e5 $
+ * $Id: 1f896c24f60dbb9b1bcd7cfe4c5b21e7c05ee7a3 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -158,6 +158,8 @@ static int Mux( sout_mux_t *p_mux )
             memcpy( p_data->p_buffer, p_mux->pp_inputs[i]->p_fmt->p_extra,
                     p_mux->pp_inputs[i]->p_fmt->i_extra );
 
+            p_data->i_flags |= BLOCK_FLAG_HEADER;
+
             msg_Dbg( p_mux, "writing header data" );
             sout_AccessOutWrite( p_mux->p_access, p_data );
         }
diff --git a/modules/packetizer/Modules.am b/modules/packetizer/Modules.am
index 15b1190..de6ea1d 100644
--- a/modules/packetizer/Modules.am
+++ b/modules/packetizer/Modules.am
@@ -9,6 +9,14 @@ SOURCES_packetizer_dirac = dirac.c
 SOURCES_packetizer_flac = flac.c
 SOURCES_packetizer_hevc = hevc.c
 
+libpacketizer_avparser_plugin_la_SOURCES = avparser.c avparser.h \
+                              ../codec/avcodec/avcommon.h \
+                              ../codec/avcodec/avcodec.h \
+                              ../codec/avcodec/fourcc.c
+
+libpacketizer_avparser_plugin_la_CFLAGS = $(AVCODEC_CFLAGS) $(AVUTIL_CFLAGS) $(AM_CFLAGS)
+libpacketizer_avparser_plugin_la_LIBADD = $(AVCODEC_LIBS) $(AVUTIL_LIBS) $(LIBM)
+
 noinst_HEADERS = packetizer_helper.h
 
 packetizer_LTLIBRARIES += \
@@ -25,3 +33,8 @@ packetizer_LTLIBRARIES += \
 if ENABLE_SOUT
 packetizer_LTLIBRARIES += libpacketizer_copy_plugin.la
 endif
+if HAVE_AVCODEC
+if !MERGE_FFMPEG
+packetizer_LTLIBRARIES += libpacketizer_avparser_plugin.la
+endif
+endif
diff --git a/modules/packetizer/avparser.c b/modules/packetizer/avparser.c
new file mode 100644
index 0000000..452c583
--- /dev/null
+++ b/modules/packetizer/avparser.c
@@ -0,0 +1,198 @@
+/*****************************************************************************
+ * avparser.c
+ *****************************************************************************
+ * Copyright (C) 2015 VLC authors and VideoLAN
+ * $Id: c5d2891f6a0ecdbb2d433225c04cccf1a6b49c3d $
+ *
+ * Authors: Denis Charmet <typx@videolan.org>
+ *
+ * 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
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_codec.h>
+#include <vlc_block.h>
+
+#include "../codec/avcodec/avcodec.h"
+#include "../codec/avcodec/avcommon.h"
+
+#include "avparser.h"
+
+#if !LIBAVCODEC_VERSION_CHECK( 55, 52, 0, 63, 100 )
+#include <libavutil/mem.h>
+static inline void avcodec_free_context( AVCodecContext **ctx )
+{
+    if( !*ctx )
+        return;
+
+    av_free( (*ctx)->extradata );
+    av_free( *ctx );
+    *ctx = NULL;
+}
+#endif
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+#ifndef MERGE_FFMPEG
+vlc_module_begin ()
+    AVPARSER_MODULE
+vlc_module_end ()
+#endif
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+struct decoder_sys_t
+{
+    AVCodecParserContext * p_parser_ctx;
+    AVCodecContext * p_codec_ctx;
+    int i_offset;
+};
+
+static block_t * Packetize( decoder_t *, block_t ** );
+
+/*****************************************************************************
+ * OpenPacketizer: probe the packetizer and return score
+ *****************************************************************************
+ * Tries to launch a decoder and return score so that the interface is able
+ * to choose.
+ *****************************************************************************/
+int OpenPacketizer( vlc_object_t *p_this )
+{
+    decoder_t     *p_dec = (decoder_t*)p_this;
+    decoder_sys_t *p_sys;
+
+    /* Restrict to VP9 for now */
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_VP9 )
+        return VLC_EGENERIC;
+
+    unsigned i_avcodec_id;
+
+    if( !GetFfmpegCodec( p_dec->fmt_in.i_codec, NULL, &i_avcodec_id, NULL ) )
+        return VLC_EGENERIC;
+
+    /* init avcodec */
+    vlc_init_avcodec(p_this);
+
+    /* It is less likely to have a parser than a codec, start by that */
+    AVCodecParserContext * p_ctx = av_parser_init( i_avcodec_id );
+    if( !p_ctx )
+        return VLC_EGENERIC;
+
+    AVCodec * p_codec = avcodec_find_decoder( i_avcodec_id );
+    if( unlikely( !p_codec ) )
+    {
+        av_parser_close( p_ctx );
+        return VLC_EGENERIC;
+    }
+
+    AVCodecContext * p_codec_ctx = avcodec_alloc_context3( p_codec );
+    if( unlikely( !p_codec_ctx ) )
+    {
+        av_parser_close( p_ctx );
+        return VLC_ENOMEM;
+    }
+
+    p_dec->p_sys = p_sys = malloc( sizeof(*p_sys) );
+
+    if( unlikely( !p_sys ) )
+    {
+        avcodec_free_context( &p_codec_ctx );
+        av_parser_close( p_ctx );
+        return VLC_ENOMEM;
+    }
+    p_dec->pf_packetize = Packetize;
+    p_sys->p_parser_ctx = p_ctx;
+    p_sys->p_codec_ctx = p_codec_ctx;
+    p_sys->i_offset = 0;
+    es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
+
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * ClosePacketizer:
+ *****************************************************************************/
+void ClosePacketizer( vlc_object_t *p_this )
+{
+    decoder_t     *p_dec = (decoder_t*)p_this;
+    avcodec_free_context( &p_dec->p_sys->p_codec_ctx );
+    av_parser_close( p_dec->p_sys->p_parser_ctx );
+    es_format_Clean( &p_dec->fmt_out );
+    free( p_dec->p_sys );
+}
+
+/*****************************************************************************
+ * Packetize: packetize a frame
+ *****************************************************************************/
+static block_t *Packetize ( decoder_t *p_dec, block_t **pp_block )
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+
+    if( pp_block == NULL || *pp_block == NULL )
+        return NULL;
+    if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
+    {
+        block_Release( *pp_block );
+        return NULL;
+    }
+
+    block_t * p_block = *pp_block;
+
+    uint8_t * p_indata = p_block->p_buffer + p_sys->i_offset;
+    int i_inlen = p_block->i_buffer -  p_sys->i_offset;
+    uint8_t * p_outdata;
+    int i_outlen;
+
+    if( p_sys->i_offset == i_inlen )
+        goto out;
+
+    p_sys->i_offset += av_parser_parse2( p_sys->p_parser_ctx, p_sys->p_codec_ctx,
+                                         &p_outdata, &i_outlen, p_indata, i_inlen,
+                                         p_block->i_pts, p_block->i_dts, -1);
+
+    if( unlikely( i_outlen <= 0 || !p_outdata ) )
+        goto out;
+
+    block_t * p_ret = block_Alloc( i_outlen );
+
+    if( unlikely ( !p_ret ) )
+        goto out;
+
+    memcpy( p_ret->p_buffer, p_outdata, i_outlen );
+    p_ret->i_pts = p_block->i_pts;
+    p_ret->i_dts = p_block->i_dts;
+
+    p_block->i_pts = p_block->i_dts = VLC_TS_INVALID;
+
+    return p_ret;
+
+out:
+    p_sys->i_offset = 0;
+    block_Release( *pp_block );
+    *pp_block = NULL;
+    return NULL;
+}
+
diff --git a/modules/packetizer/avparser.h b/modules/packetizer/avparser.h
new file mode 100644
index 0000000..71cd588
--- /dev/null
+++ b/modules/packetizer/avparser.h
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * avparser.h
+ *****************************************************************************
+ * Copyright (C) 2015 VLC authors and VideoLAN
+ * $Id: a782e829e352b9a15c27babdf07418b104eb4cc4 $
+ *
+ * Authors: Denis Charmet <typx@videolan.org>
+ *
+ * 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
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_codec.h>
+#include <vlc_block.h>
+
+#include "../codec/avcodec/avcodec.h"
+#include "../codec/avcodec/avcommon.h"
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+int  OpenPacketizer ( vlc_object_t * );
+void ClosePacketizer( vlc_object_t * );
+
+#define AVPARSER_MODULE \
+    set_category( CAT_SOUT )                            \
+    set_subcategory( SUBCAT_SOUT_PACKETIZER )           \
+    set_description( N_("avparser packetizer") )        \
+    set_capability( "packetizer", 20 )                   \
+    set_callbacks( OpenPacketizer, ClosePacketizer )
diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 973d07d..3b38d46 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -2,7 +2,7 @@
  * httplive.c: HTTP Live Streaming stream filter
  *****************************************************************************
  * Copyright (C) 2010-2012 M2X BV
- * $Id: d66ee28dc2231a3a53a243409f3f0381040ff1e0 $
+ * $Id: 72abf15e6548a3191a57b00a823a8971137391b6 $
  *
  * Author: Jean-Paul Saman <jpsaman _AT_ videolan _DOT_ org>
  *
@@ -1381,10 +1381,7 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
     {
         segment_t *p = segment_GetSegment(hls_new, n);
         if (p == NULL)
-        {
-            vlc_mutex_unlock(&hls_old->lock);
-            return VLC_EGENERIC;
-        }
+            continue;
 
         segment_t *segment = segment_Find(hls_old, p->sequence);
         if (segment)
@@ -1426,8 +1423,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
                 }
                 free(segment->psz_key_path);
                 segment->psz_key_path = p->psz_key_path ? strdup(p->psz_key_path) : NULL;
-                segment_Free(p);
             }
+            segment_Free(p);
             vlc_mutex_unlock(&segment->lock);
         }
         else
@@ -1436,7 +1433,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
             segment_t *l = segment_GetSegment(hls_old, last);
             if (l == NULL) {
                 vlc_mutex_unlock(&hls_old->lock);
-                return VLC_EGENERIC;
+                segment_Free(p);
+                continue;
             }
 
             if ((l->sequence + 1) != p->sequence)
@@ -1459,8 +1457,9 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
     hls_old->duration = (hls_new->duration == -1) ? hls_old->duration : hls_new->duration;
     hls_old->b_cache = hls_new->b_cache;
     vlc_mutex_unlock(&hls_old->lock);
-    return VLC_SUCCESS;
 
+    vlc_array_clear(hls_new->segments);
+    return VLC_SUCCESS;
 }
 
 static int hls_ReloadPlaylist(stream_t *s)
@@ -1508,10 +1507,12 @@ static int hls_ReloadPlaylist(stream_t *s)
 
             // New segment available -  signal download thread
             stream_appended = true;
+            continue;
         }
         else if (hls_UpdatePlaylist(s, hls_new, hls_old, &stream_appended) != VLC_SUCCESS)
             msg_Warn(s, "failed updating HLS stream (id=%d, bandwidth=%"PRIu64")",
                      hls_new->id, hls_new->bandwidth);
+        hls_Free(hls_new);
     }
     vlc_array_destroy(hls_streams);
 
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 4031d18..bfdabb9 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -1265,14 +1265,13 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
 static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
                  block_t *p_buffer )
 {
-    block_t *p_next;
-
     assert( p_stream->p_sys->p_mux == NULL );
     (void)p_stream;
 
     while( p_buffer != NULL )
     {
-        p_next = p_buffer->p_next;
+        block_t *p_next = p_buffer->p_next;
+        p_buffer->p_next = NULL;
 
         /* Send a Vorbis/Theora Packed Configuration packet (RFC 5215 §3.1)
          * as the first packet of the stream */
@@ -1288,7 +1287,6 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
         if( id->rtp_fmt.pf_packetize( id, p_buffer ) )
             break;
 
-        block_Release( p_buffer );
         p_buffer = p_next;
     }
     return VLC_SUCCESS;
diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c
index 8b9da4e..49fc011 100644
--- a/modules/stream_out/rtpfmt.c
+++ b/modules/stream_out/rtpfmt.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2003-2004 VLC authors and VideoLAN
  * Copyright © 2007 Rémi Denis-Courmont
- * $Id: baee82aa50ff50eb0702436aae52e1951e5d786b $
+ * $Id: 75b4143762b16657ba0a378d5081c9d1dad39160 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -557,7 +557,11 @@ int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
     char *end = strchr(start, ';');
     assert(end != NULL);
     size_t len = end - start;
-    char b64[len + 1];
+
+    char *b64 = malloc(len + 1);
+    if(!b64)
+        return VLC_EGENERIC;
+
     memcpy(b64, start, len);
     b64[len] = '\0';
 
@@ -567,6 +571,7 @@ int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
     int i_data;
 
     i_data = vlc_b64_decode_binary(&p_orig, b64);
+    free(b64);
     if (i_data <= 9)
     {
         free(p_orig);
@@ -676,6 +681,7 @@ static int rtp_packetize_xiph( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -711,6 +717,7 @@ static int rtp_packetize_mpa( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -810,6 +817,7 @@ static int rtp_packetize_mpv( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -846,6 +854,7 @@ static int rtp_packetize_ac3( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -878,6 +887,7 @@ static int rtp_packetize_split( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -911,6 +921,7 @@ static int rtp_packetize_swab( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -964,6 +975,7 @@ static int rtp_packetize_mp4a_latm( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1003,6 +1015,7 @@ static int rtp_packetize_mp4a( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1025,10 +1038,12 @@ static int rtp_packetize_h263( sout_stream_id_sys_t *id, block_t *in )
 
     if( i_data < 2 )
     {
+        block_Release(in);
         return VLC_EGENERIC;
     }
     if( p_data[0] || p_data[1] )
     {
+        block_Release(in);
         return VLC_EGENERIC;
     }
     /* remove 2 leading 0 bytes */
@@ -1065,6 +1080,7 @@ static int rtp_packetize_h263( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1177,6 +1193,8 @@ static int rtp_packetize_h264( sout_stream_id_sys_t *id, block_t *in )
         i_buffer -= i_skip;
         p_buffer += i_skip;
     }
+
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1215,6 +1233,7 @@ static int rtp_packetize_amr( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1237,15 +1256,20 @@ static int rtp_packetize_t140( sout_stream_id_sys_t *id, block_t *in )
             while( ( p_data[i_payload] & 0xC0 ) == 0x80 )
             {
                 if( i_payload == 0 )
+                 {
+                    block_Release(in);
                     return VLC_SUCCESS; /* fishy input! */
-
+                }
                 i_payload--;
             }
         }
 
         block_t *out = block_Alloc( 12 + i_payload );
         if( out == NULL )
+        {
+            block_Release(in);
             return VLC_SUCCESS;
+        }
 
         rtp_packetize_common( id, out, 0, in->i_pts + i_packet );
         memcpy( out->p_buffer + 12, p_data, i_payload );
@@ -1260,6 +1284,7 @@ static int rtp_packetize_t140( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1273,7 +1298,10 @@ static int rtp_packetize_spx( sout_stream_id_sys_t *id, block_t *in )
     block_t *p_out;
 
     if ( in->i_buffer > rtp_mtu (id) )
+    {
+        block_Release(in);
         return VLC_SUCCESS;
+    }
 
     /*
       RFC for Speex in RTP says that each packet must end on an octet 
@@ -1332,6 +1360,7 @@ static int rtp_packetize_spx( sout_stream_id_sys_t *id, block_t *in )
     p_out->i_buffer = 12 + i_payload_size;
     p_out->i_dts = in->i_dts;
     p_out->i_length = in->i_length;
+    block_Release(in);
 
     /* Queue the buffer for actual transmission. */
     rtp_packetize_send( id, p_out );
@@ -1367,6 +1396,8 @@ static int rtp_packetize_g726( sout_stream_id_sys_t *id, block_t *in, int i_pad
         p_data += i_payload;
         i_data -= i_payload;
     }
+
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1402,14 +1433,20 @@ static int rtp_packetize_vp8( sout_stream_id_sys_t *id, block_t *in )
     int     i_data  = in->i_buffer;
 
     if ( i_max <= 0 )
+    {
+        block_Release(in);
         return VLC_EGENERIC;
+    }
 
     for( int i = 0; i < i_count; i++ )
     {
         int i_payload = __MIN( i_max, i_data );
         block_t *out = block_Alloc( RTP_VP8_PAYLOAD_START + i_payload );
         if ( out == NULL )
+        {
+            block_Release(in);
             return VLC_ENOMEM;
+        }
 
         /* VP8 payload header */
         /* All frames are marked as reference ones */
@@ -1433,6 +1470,7 @@ static int rtp_packetize_vp8( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1458,7 +1496,7 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
 
     // Skip SOI
     if (GetWBE(p_data) != 0xffd8)
-        return VLC_EGENERIC;
+        goto error;
     p_data += 2;
     i_data -= 2;
 
@@ -1470,17 +1508,14 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
         int section_size = GetWBE(section);
         uint8_t *section_body = p_data + 4;
         if (section + section_size > bufend)
-            return VLC_EGENERIC;
+            goto error;
 
         assert((marker & 0xff00) == 0xff00);
         switch (marker)
         {
             case 0xffdb /*DQT*/:
                 if (section_body[0])
-                {
-                    // Only 8-bit precision is supported
-                    return VLC_EGENERIC;
-                }
+                    goto error; // Only 8-bit precision is supported
 
                 /* a quantization table is 64 bytes long */
                 nb_qtables = section_size / 65;
@@ -1493,7 +1528,7 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
                 if (width > 2040 || height > 2040)
                 {
                     // larger than limit supported by RFC 2435
-                    return VLC_EGENERIC;
+                    goto error;
                 }
                 // Round up by 8, divide by 8
                 w = ((width+7)&~7) >> 3;
@@ -1507,7 +1542,7 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
 
                 // Only 3 components are supported by RFC 2435
                 if (section_body[5] != 3) // Number of components
-                    return VLC_EGENERIC;
+                    goto error;
                 for (int j = 0; j < 3; j++)
                 {
                     if (section_body[6 + j * 3] == 1 /* Y */)
@@ -1517,7 +1552,7 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
                     else if (section_body[6 + j * 3 + 1] != 0x11)
                     {
                         // Sampling factor is unsupported by RFC 2435
-                        return VLC_EGENERIC;
+                        goto error;
                     }
                 }
                 break;
@@ -1536,9 +1571,9 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
         i_data -= 2 + section_size;
     }
     if (!header_finished)
-        return VLC_EGENERIC;
+        goto error;
     if (!w || !h)
-        return VLC_EGENERIC;
+        goto error;
 
     switch (y_sampling_factor)
     {
@@ -1549,8 +1584,7 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
             type = 0;
             break;
         default:
-            // Sampling format unsupported by RFC 2435
-            return VLC_EGENERIC;
+            goto error; // Sampling format unsupported by RFC 2435
     }
 
     if (dri_found)
@@ -1564,11 +1598,14 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
 
         int i_payload = __MIN( i_data, (int)(rtp_mtu (id) - hdr_size) );
         if ( i_payload <= 0 )
-            return VLC_EGENERIC;
+            goto error;
 
         block_t *out = block_Alloc( 12 + hdr_size + i_payload );
         if( out == NULL )
+        {
+            block_Release( in );
             return VLC_ENOMEM;
+        }
 
         uint8_t *p = out->p_buffer + 12;
         /* set main header */
@@ -1620,5 +1657,9 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
         off    += i_payload;
     }
 
+    block_Release(in);
     return VLC_SUCCESS;
+error:
+    block_Release(in);
+    return VLC_EGENERIC;
 }
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index 71ed216..f9cd40d 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -2,7 +2,7 @@
  * transcode.c: transcoding stream output module
  *****************************************************************************
  * Copyright (C) 2003-2009 VLC authors and VideoLAN
- * $Id: e925e80e3fa0e0bf0dc2104caacdf38696411f33 $
+ * $Id: 4bd72c28c92bef94845dbb3b401d1fb0fd1e5d3d $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -341,7 +341,7 @@ static int Open( vlc_object_t *p_this )
 
     p_sys->f_scale = var_GetFloat( p_stream, SOUT_CFG_PREFIX "scale" );
 
-    p_sys->b_master_sync = var_InheritURational( p_stream, &p_sys->fps_num, &p_sys->fps_den, SOUT_CFG_PREFIX "fps" );
+    p_sys->b_master_sync = var_InheritURational( p_stream, &p_sys->fps_num, &p_sys->fps_den, SOUT_CFG_PREFIX "fps" ) == VLC_SUCCESS;
 
     p_sys->i_width = var_GetInteger( p_stream, SOUT_CFG_PREFIX "width" );
 
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index ee05384..345c19a 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -2,7 +2,7 @@
  * video.c: transcoding stream output module (video)
  *****************************************************************************
  * Copyright (C) 2003-2009 VLC authors and VideoLAN
- * $Id: 60b66bbbac14620fc0da0fefdd344cd61ffd83c2 $
+ * $Id: 8e3ce670337339b533c11856bb00f5c00b41b6f4 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -914,6 +914,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
                          p_pic->date, id->i_input_frame_interval, date_Get(&id->next_output_pts) );
 #endif
                 picture_Release( p_pic );
+                date_Increment( &id->next_input_pts, id->p_decoder->fmt_out.video.i_frame_rate_base );
                 continue;
             }
 #if 0
diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index b47d30a..e81e32c 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -2,7 +2,7 @@
  * freetype.c : Put text on the video, using freetype2
  *****************************************************************************
  * Copyright (C) 2002 - 2012 VLC authors and VideoLAN
- * $Id: f7fcd80f34338d9c1dbc569f997904ed4a8d0f30 $
+ * $Id: b9da7bf28c044be7ce38bf87a525615e3b9317c7 $
  *
  * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -1360,6 +1360,12 @@ static int ProcessLines( filter_t *p_filter,
                 uni_char_t character = psz_text[i_index];
                 int i_glyph_index = FT_Get_Char_Index( p_current_face, character );
 
+                /* If the missing glyph is U+FEFF (ZERO WIDTH NO-BREAK SPACE) */
+                /* we can safely ignore it. Otherwise extra squares show up   */
+                /* in Arabic text.                                            */
+                if( i_glyph_index == 0 && character == 0xFEFF )
+                    goto next;
+
                 /* Get kerning vector */
                 FT_Vector kerning = { .x = 0, .y = 0 };
                 if( FT_HAS_KERNING( p_current_face ) && i_glyph_last != 0 && i_glyph_index != 0 )
diff --git a/modules/video_chroma/i420_yuy2.c b/modules/video_chroma/i420_yuy2.c
index 7dbf690..d0d1b0c 100644
--- a/modules/video_chroma/i420_yuy2.c
+++ b/modules/video_chroma/i420_yuy2.c
@@ -2,7 +2,7 @@
  * i420_yuy2.c : YUV to YUV conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VLC authors and VideoLAN
- * $Id: 5457f9572590d442088f498caf3f5fcd15798a25 $
+ * $Id: cd99dd652042b2fbea13a06af7153fad3d1a5f32 $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Damien Fouilleul <damien@videolan.org>
@@ -134,7 +134,7 @@ static int Activate( vlc_object_t *p_this )
 
     switch( p_filter->fmt_in.video.i_chroma )
     {
-        case VLC_CODEC_YV12:
+//        case VLC_CODEC_YV12: FIXME invert U and V in the filters :)
         case VLC_CODEC_I420:
             switch( p_filter->fmt_out.video.i_chroma )
             {
diff --git a/modules/video_chroma/swscale.c b/modules/video_chroma/swscale.c
index f1a8c7e..3bcdcfe 100644
--- a/modules/video_chroma/swscale.c
+++ b/modules/video_chroma/swscale.c
@@ -2,7 +2,7 @@
  * swscale.c: scaling and chroma conversion using libswscale
  *****************************************************************************
  * Copyright (C) 1999-2008 VLC authors and VideoLAN
- * $Id: 1f3236239998b64fb9001b15e684607071cbaa9b $
+ * $Id: f7f80826f1dc09dafb109ad2cb55b7ab5d5b9fd4 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -91,6 +91,8 @@ struct filter_sys_t
 
     video_format_t fmt_in;
     video_format_t fmt_out;
+    const vlc_chroma_description_t *desc_in;
+    const vlc_chroma_description_t *desc_out;
 
     struct SwsContext *ctx;
     struct SwsContext *ctxA;
@@ -340,8 +342,6 @@ static int GetParameters( ScalerConfiguration *p_cfg,
         p_cfg->b_has_a = b_has_ai && b_has_ao;
         p_cfg->b_add_a = (!b_has_ai) && b_has_ao;
         p_cfg->b_copy = i_fmti == i_fmto &&
-                        p_fmti->i_width == p_fmto->i_width &&
-                        p_fmti->i_height == p_fmto->i_height &&
                         p_fmti->i_visible_width == p_fmto->i_visible_width &&
                         p_fmti->i_visible_height == p_fmto->i_visible_height;
         p_cfg->b_swap_uvi = b_swap_uvi;
@@ -389,40 +389,26 @@ static int Init( filter_t *p_filter )
         return VLC_EGENERIC;
     }
 
-    unsigned iwidth = (p_fmti->i_visible_width * p_fmto->i_width)
-                      / p_fmto->i_visible_width;
-    unsigned iheight = (p_fmti->i_visible_height * p_fmto->i_height)
-                       / p_fmto->i_visible_height;
-    unsigned owidth = (p_fmto->i_visible_width * p_fmti->i_width)
-                      / p_fmti->i_visible_width;
-    unsigned oheight = (p_fmto->i_visible_height * p_fmti->i_height)
-                       / p_fmti->i_visible_height;
-
-    if( owidth > p_fmto->i_width )
-        owidth = p_fmto->i_width;
-    else
-        iwidth = p_fmti->i_width;
-    if( oheight > p_fmto->i_height )
-        oheight = p_fmto->i_height;
-    else
-        iheight = p_fmti->i_height;
+    p_sys->desc_in = vlc_fourcc_GetChromaDescription( p_fmti->i_chroma );
+    p_sys->desc_out = vlc_fourcc_GetChromaDescription( p_fmto->i_chroma );
+    if( p_sys->desc_in == NULL || p_sys->desc_out == NULL )
+        return VLC_EGENERIC;
 
     /* swscale does not like too small width */
     p_sys->i_extend_factor = 1;
-    while( __MIN( p_fmti->i_width, p_fmto->i_width ) * p_sys->i_extend_factor < MINIMUM_WIDTH)
+    while( __MIN( p_fmti->i_visible_width, p_fmto->i_visible_width ) * p_sys->i_extend_factor < MINIMUM_WIDTH)
         p_sys->i_extend_factor++;
 
-    iwidth *= p_sys->i_extend_factor;
-    owidth *= p_sys->i_extend_factor;
-
+    const unsigned i_fmti_visible_width = p_fmti->i_visible_width * p_sys->i_extend_factor;
+    const unsigned i_fmto_visible_width = p_fmto->i_visible_width * p_sys->i_extend_factor;
     for( int n = 0; n < (cfg.b_has_a ? 2 : 1); n++ )
     {
         const int i_fmti = n == 0 ? cfg.i_fmti : PIX_FMT_GRAY8;
         const int i_fmto = n == 0 ? cfg.i_fmto : PIX_FMT_GRAY8;
         struct SwsContext *ctx;
 
-        ctx = sws_getContext( iwidth, iheight, i_fmti,
-                              owidth, oheight, i_fmto,
+        ctx = sws_getContext( i_fmti_visible_width, p_fmti->i_visible_height, i_fmti,
+                              i_fmto_visible_width, p_fmto->i_visible_height, i_fmto,
                               cfg.i_sws_flags | p_sys->i_cpu_mask,
                               p_sys->p_src_filter, p_sys->p_dst_filter, 0 );
         if( n == 0 )
@@ -432,13 +418,13 @@ static int Init( filter_t *p_filter )
     }
     if( p_sys->ctxA )
     {
-        p_sys->p_src_a = picture_New( VLC_CODEC_GREY, iwidth, iheight, 0, 1 );
-        p_sys->p_dst_a = picture_New( VLC_CODEC_GREY, owidth, oheight, 0, 1 );
+        p_sys->p_src_a = picture_New( VLC_CODEC_GREY, i_fmti_visible_width, p_fmti->i_visible_height, 0, 1 );
+        p_sys->p_dst_a = picture_New( VLC_CODEC_GREY, i_fmto_visible_width, p_fmto->i_visible_height, 0, 1 );
     }
     if( p_sys->i_extend_factor != 1 )
     {
-        p_sys->p_src_e = picture_New( p_fmti->i_chroma, iwidth, iheight, 0, 1 );
-        p_sys->p_dst_e = picture_New( p_fmto->i_chroma, owidth, oheight, 0, 1 );
+        p_sys->p_src_e = picture_New( p_fmti->i_chroma, i_fmti_visible_width, p_fmti->i_visible_height, 0, 1 );
+        p_sys->p_dst_e = picture_New( p_fmto->i_chroma, i_fmto_visible_width, p_fmto->i_visible_height, 0, 1 );
 
         if( p_sys->p_src_e )
             memset( p_sys->p_src_e->p[0].p_pixels, 0, p_sys->p_src_e->p[0].i_pitch * p_sys->p_src_e->p[0].i_lines );
@@ -520,22 +506,35 @@ static void Clean( filter_t *p_filter )
 }
 
 static void GetPixels( uint8_t *pp_pixel[4], int pi_pitch[4],
-                       const picture_t *p_picture,
-                       int i_plane_start, int i_plane_count,
+                       const vlc_chroma_description_t *desc,
+                       const video_format_t *fmt,
+                       const picture_t *p_picture, unsigned planes,
                        bool b_swap_uv )
 {
-    assert( !b_swap_uv || i_plane_count >= 3 );
-    int n;
-    for( n = 0; n < __MIN(i_plane_count, p_picture->i_planes-i_plane_start ); n++ )
+    unsigned i = 0;
+
+    if( planes > (unsigned)p_picture->i_planes )
+        planes = p_picture->i_planes;
+    assert( !b_swap_uv || planes >= 3 );
+
+    for( ; i < planes; i++ )
     {
-        const int nd = ( b_swap_uv && n >= 1 && n <= 2 ) ? (3 - n) : n;
-        pp_pixel[nd] = p_picture->p[i_plane_start+n].p_pixels;
-        pi_pitch[nd] = p_picture->p[i_plane_start+n].i_pitch;
+        const plane_t *p = p_picture->p + i;
+        if( b_swap_uv && (i == 1 || i== 2) )
+            p = p_picture->p + 3 - i;
+
+        pp_pixel[i] = p->p_pixels
+            + (((fmt->i_x_offset * desc->p[i].w.num) / desc->p[i].w.den)
+                * p->i_pixel_pitch)
+            + (((fmt->i_y_offset * desc->p[i].h.num) / desc->p[i].h.den)
+                * p->i_pitch);
+        pi_pitch[i] = p->i_pitch;
     }
-    for( ; n < 4; n++ )
+
+    for( ; i < 4; i++ )
     {
-        pp_pixel[n] = NULL;
-        pi_pitch[n] = 0;
+        pp_pixel[i] = NULL;
+        pi_pitch[i] = 0;
     }
 }
 
@@ -592,16 +591,18 @@ static void SwapUV( picture_t *p_dst, const picture_t *p_src )
 
     picture_CopyPixels( p_dst, &tmp );
 }
+
 static void Convert( filter_t *p_filter, struct SwsContext *ctx,
                      picture_t *p_dst, picture_t *p_src, int i_height, int i_plane_start, int i_plane_count,
                      bool b_swap_uvi, bool b_swap_uvo )
 {
+    filter_sys_t *p_sys = p_filter->p_sys;
     uint8_t palette[AVPALETTE_SIZE];
-
     uint8_t *src[4]; int src_stride[4];
     uint8_t *dst[4]; int dst_stride[4];
 
-    GetPixels( src, src_stride, p_src, i_plane_start, i_plane_count, b_swap_uvi );
+    GetPixels( src, src_stride, p_sys->desc_in, &p_filter->fmt_in.video,
+               p_src, i_plane_count, b_swap_uvi );
     if( p_filter->fmt_in.video.i_chroma == VLC_CODEC_RGBP )
     {
         memset( palette, 0, sizeof(palette) );
@@ -612,7 +613,8 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
         src_stride[1] = 4;
     }
 
-    GetPixels( dst, dst_stride, p_dst, i_plane_start, i_plane_count, b_swap_uvo );
+    GetPixels( dst, dst_stride, p_sys->desc_out, &p_filter->fmt_out.video,
+               p_dst, i_plane_count, b_swap_uvo );
 
 #if LIBSWSCALE_VERSION_INT  >= ((0<<16)+(5<<8)+0)
     sws_scale( ctx, src, src_stride, 0, i_height,
@@ -666,24 +668,23 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     else if( p_sys->b_copy )
         SwapUV( p_dst, p_src );
     else
-        Convert( p_filter, p_sys->ctx, p_dst, p_src, p_fmti->i_height, 0, 3,
+        Convert( p_filter, p_sys->ctx, p_dst, p_src, p_fmti->i_visible_height, 0, 3,
                  p_sys->b_swap_uvi, p_sys->b_swap_uvo );
     if( p_sys->ctxA )
     {
         /* We extract the A plane to rescale it, and then we reinject it. */
         if( p_fmti->i_chroma == VLC_CODEC_RGBA || p_fmti->i_chroma == VLC_CODEC_BGRA )
-            ExtractA( p_sys->p_src_a, p_src, p_fmti->i_width * p_sys->i_extend_factor, p_fmti->i_height, OFFSET_A );
+            ExtractA( p_sys->p_src_a, p_src, p_fmti->i_visible_width * p_sys->i_extend_factor, p_fmti->i_visible_height, OFFSET_A );
         else if( p_fmti->i_chroma == VLC_CODEC_ARGB )
-            ExtractA( p_sys->p_src_a, p_src, p_fmti->i_width * p_sys->i_extend_factor, p_fmti->i_height, 0 );
+            ExtractA( p_sys->p_src_a, p_src, p_fmti->i_visible_width * p_sys->i_extend_factor, p_fmti->i_visible_height, 0 );
         else
             plane_CopyPixels( p_sys->p_src_a->p, p_src->p+A_PLANE );
 
-        Convert( p_filter, p_sys->ctxA, p_sys->p_dst_a, p_sys->p_src_a,
-                 p_fmti->i_height, 0, 1, false, false );
+        Convert( p_filter, p_sys->ctxA, p_sys->p_dst_a, p_sys->p_src_a, p_fmti->i_visible_height, 0, 1, false, false );
         if( p_fmto->i_chroma == VLC_CODEC_RGBA || p_fmto->i_chroma == VLC_CODEC_BGRA )
-            InjectA( p_dst, p_sys->p_dst_a, p_fmto->i_width * p_sys->i_extend_factor, p_fmto->i_height, OFFSET_A );
+            InjectA( p_dst, p_sys->p_dst_a, p_fmto->i_visible_width * p_sys->i_extend_factor, p_fmto->i_visible_height, OFFSET_A );
         else if( p_fmto->i_chroma == VLC_CODEC_ARGB )
-            InjectA( p_dst, p_sys->p_dst_a, p_fmto->i_width * p_sys->i_extend_factor, p_fmto->i_height, 0 );
+            InjectA( p_dst, p_sys->p_dst_a, p_fmto->i_visible_width * p_sys->i_extend_factor, p_fmto->i_visible_height, 0 );
         else
             plane_CopyPixels( p_dst->p+A_PLANE, p_sys->p_dst_a->p );
     }
diff --git a/modules/video_filter/puzzle.c b/modules/video_filter/puzzle.c
index 4c89507..1a4a4c1 100644
--- a/modules/video_filter/puzzle.c
+++ b/modules/video_filter/puzzle.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2005-2009 VLC authors and VideoLAN
  * Copyright (C) 2013      Vianney Boyer
- * $Id: 2fe5e0c8afe025f38acda864c16782276c83b7e5 $
+ * $Id: 6c6433bbeea541dfe0b7e4292a96195491acd78e $
  *
  * Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
  *          Vianney Boyer <vlcvboyer -at- gmail -dot- com>
@@ -289,9 +289,12 @@ picture_t *Filter( filter_t *p_filter, picture_t *p_pic_in ) {
     /* assert no mismatch between sizes */
     if (    p_sys->s_current_param.i_pict_width  != p_sys->s_current_param.i_desk_width
          || p_sys->s_current_param.i_pict_height != p_sys->s_current_param.i_desk_height
-         || p_sys->s_current_param.i_pict_width  != (int) p_fmt_in->i_width
-         || p_sys->s_current_param.i_pict_height != (int) p_fmt_in->i_height )
+         || p_sys->s_current_param.i_pict_width  != (int) p_fmt_in->i_visible_width
+         || p_sys->s_current_param.i_pict_height != (int) p_fmt_in->i_visible_height ) {
+        picture_Release(p_pic_in);
+        picture_Release(p_pic_out);
         return NULL;
+    }
 
     vlc_mutex_lock( &p_sys->lock );
 
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index 32f207b..e60baf6 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -314,38 +314,20 @@ FindFormat (vlc_object_t *obj, xcb_connection_t *conn, video_format_t *fmt,
         if (!BetterFormat (chroma, chromav, &rank))
             continue;
 
-        /* VLC pads scanline to 16 pixels internally */
-        unsigned width = (fmt->i_width + 31) & ~31;
-        unsigned height = (fmt->i_height + 15) & ~15;
         xcb_xv_query_image_attributes_reply_t *i;
         i = xcb_xv_query_image_attributes_reply (conn,
             xcb_xv_query_image_attributes (conn, a->base_id, f->id,
-                                           width, height), NULL);
+                                           fmt->i_visible_width,
+                                           fmt->i_visible_height), NULL);
         if (i == NULL)
             continue;
 
-        if (i->width != width || i->height != height)
-        {
-            msg_Warn (obj, "incompatible size %ux%u -> %"PRIu32"x%"PRIu32,
-                      fmt->i_width, fmt->i_height,
-                      i->width, i->height);
-            var_Create (obj->p_libvlc, "xvideo-res-error", VLC_VAR_BOOL);
-            if (!var_GetBool (obj->p_libvlc, "xvideo-res-error"))
-            {
-                dialog_FatalWait (obj, _("Video acceleration not available"),
-                    _("The XVideo rendering acceleration driver does not "
-                      "support the required resolution of %ux%u pixels but "
-                      "%"PRIu32"x%"PRIu32" pixels instead.\n"
-                      "Acceleration will thus be disabled. Performance may "
-                      "be degraded severely if the resolution is large."),
-                                  width, height, i->width, i->height);
-                var_SetBool (obj->p_libvlc, "xvideo-res-error", true);
-            }
-            free (i);
-            continue;
-        }
-
         fmt->i_chroma = chroma;
+        fmt->i_x_offset = 0;
+        fmt->i_y_offset = 0;
+        fmt->i_width = i->width;
+        fmt->i_height = i->height;
+
         if (f->type == XCB_XV_IMAGE_FORMAT_INFO_TYPE_RGB)
         {
             fmt->i_rmask = f->red_mask;
diff --git a/share/lua/extensions/VLSub.lua b/share/lua/extensions/VLSub.lua
index 1820efd..62de54a 100644
--- a/share/lua/extensions/VLSub.lua
+++ b/share/lua/extensions/VLSub.lua
@@ -1668,7 +1668,7 @@ function download_subtitles()
   local item = openSub.itemStore[index]
   
   if openSub.option.downloadBehaviour == 'manual' 
-  or not subfileName then
+  or not openSub.file.hasInput then
     local link = "<span style='color:#181'>"
     link = link.."<b>"..lang["mess_dowload_link"]..":</b>"
     link = link.."</span> &nbsp;"
@@ -1681,7 +1681,7 @@ function download_subtitles()
   end
   
   local message = ""
-  local subfileName = openSub.file.name
+  local subfileName = openSub.file.name or ""
   
   if openSub.option.langExt then
     subfileName = subfileName.."."..item.SubLanguageID
diff --git a/share/lua/http/css/main.css b/share/lua/http/css/main.css
index 1f459c4..aebe6ce 100644
--- a/share/lua/http/css/main.css
+++ b/share/lua/http/css/main.css
@@ -107,6 +107,7 @@ body{
 }
 
 .buttonszone_active {
+	margin-top: 0px;
 	width: 120px;
 	margin-left:-122px;
 	font-size:10px;
diff --git a/share/lua/playlist/koreus.lua b/share/lua/playlist/koreus.lua
index 4bbbbd6..2385bdf 100644
--- a/share/lua/playlist/koreus.lua
+++ b/share/lua/playlist/koreus.lua
@@ -22,7 +22,7 @@ function probe()
     if vlc.access ~= "http" and vlc.access ~= "https" then
         return false
     end
-	koreus_site = string.match( vlc.path, "koreus" )
+    koreus_site = string.match( vlc.path, "koreus" )
     if not koreus_site then
         return false
     end
@@ -31,58 +31,69 @@ end
 
 -- Parse function.
 function parse()
-	while true do
-		line = vlc.readline()
-		if not line then break end
-		if string.match( line, "<meta name=\"title\"" ) then
-			_,_,name = string.find( line, "content=\"(.-)\"" )
-			name = vlc.strings.resolve_xml_special_chars( name )
-		end
-		if string.match( line, "<meta name=\"description\"" ) then
-			_,_,description = string.find( line, "content=\"(.-)\"" )
+    while true do
+        line = vlc.readline()
+        if not line then break end
+        if string.match( line, "<meta name=\"title\"" ) then
+            _,_,name = string.find( line, "content=\"(.-)\"" )
+            name = vlc.strings.resolve_xml_special_chars( name )
+        end
+
+        if string.match( line, "<meta property=\"og:description\"" ) then
+            _,_,description = string.find( line, "content=\"(.-)\"" )
             if (description ~= nil) then
                 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=\"image_src\"" ) then
-			_,_,arturl = string.find( line, "href=\"(.-)\"" )
-		end
+        end
+        if string.match( line, "<span id=\"spoil\" style=\"display:none\">" ) then
+            _,_,desc_spoil = string.find( line, "<span id=\"spoil\" style=\"display:none\">(.-)</span>" )
+            desc_spoil = vlc.strings.resolve_xml_special_chars( desc_spoil )
+            description = description .. "\n\r" .. desc_spoil
+        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=\"image_src\"" ) then
+            _,_,arturl = string.find( line, "href=\"(.-)\"" )
+        end
 
-		vid_url = string.match( line, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.mp4)' )
-		if vid_url then
-			path_url = vid_url
-		end
+        vid_url = string.match( line, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.mp4)' )
+        if vid_url then
+            path_url = vid_url
+        end
 
         vid_url_hd = string.match( line, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%-hd%.mp4)' )
-		if vid_url_hd then
-			path_url_hd = vid_url_hd
-		end
+        if vid_url_hd then
+            path_url_hd = vid_url_hd
+        end
 
-		vid_url_webm = string.match( line, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.webm)' )
-		if vid_url_webm then
-			path_url_webm = vid_url_webm
-		end
+        vid_url_webm = string.match( line, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.webm)' )
+        if vid_url_webm then
+            path_url_webm = vid_url_webm
+        end
 
-		vid_url_flv = string.match( line, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.flv)' )
-		if vid_ulr_flv then
-			path_url_flv = vid_url_flv
-		end
+        vid_url_flv = string.match( line, '(http://embed%.koreus%.com/%d+/%d+/[%w-]*%.flv)' )
+        if vid_ulr_flv then
+            path_url_flv = vid_url_flv
+        end
 
-	end
+    end
 
-	if path_url_hd then
-		return { { path = path_url_hd; name = name; description = description; artist = artist; arturl = arturl } }
-	elseif path_url then
-		return { { path = path_url; name = name; description = description; artist = artist; arturl = arturl } }
-	elseif path_url_webm then
-		return { { path = path_url_webm; name = name; description = description; artist = artist; arturl = arturl } }
-	elseif path_url_flv then
-		return { { path = path_url_flv; name = name; description = description; artist = artist; arturl = arturl } }
-	else
-		return {}
-	end
+    if path_url_hd then
+        if vlc.access == 'https' then path_url_hd = path_url_hd:gsub('http','https') end
+        return { { path = path_url_hd; name = name; description = description; artist = artist; arturl = arturl } }
+    elseif path_url then
+        if vlc.access == 'https' then path_url = path_url:gsub('http','https') end
+        return { { path = path_url; name = name; description = description; artist = artist; arturl = arturl } }
+    elseif path_url_webm then
+        if vlc.access == 'https' then path_url_webm = path_url_webm:gsub('http','https') end
+        return { { path = path_url_webm; name = name; description = description; artist = artist; arturl = arturl } }
+    elseif path_url_flv then
+        if vlc.access == 'https' then path_url_flv = path_url_flv:gsub('http','https') end
+        return { { path = path_url_flv; name = name; description = description; artist = artist; arturl = arturl } }
+    else
+        return {}
+    end
 end
diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 11e5cac..ada99ac 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -88,10 +88,8 @@ function js_descramble( sig, js_url )
         -- Buffer lines for later, so we don't have to make a second
         -- HTTP request later
         table.insert( lines, line )
-        -- c&&(b.signature=ij(c));
-        -- descrambler = string.match( line, "%.signature=(.-)%(" )
-        -- descrambler = string.match( line, "%.sig%|%|(.-)%(" )
-        descrambler = string.match( line, "%.sig||([a-zA-Z0-9]+)%(" )
+        -- c&&a.set("signature",br(c));
+        descrambler = string.match( line, "%.set%(\"signature\",(.-)%(" )
     end
 
     -- Fetch the code of the descrambler function. The function is
@@ -258,21 +256,21 @@ function parse()
             -- "SWF_ARGS", "swfArgs", "PLAYER_CONFIG", "playerConfig" ...
             if string.match( line, "ytplayer%.config" ) then
 
-                local js_url = string.match( line, "\"js\": \"(.-)\"" )
+                local js_url = string.match( line, "\"js\": *\"(.-)\"" )
                 if js_url then
                     js_url = string.gsub( js_url, "\\/", "/" )
                     js_url = string.gsub( js_url, "^//", vlc.access.."://" )
                 end
 
                 if not fmt then
-                    fmt_list = string.match( line, "\"fmt_list\": \"(.-)\"" )
+                    fmt_list = string.match( line, "\"fmt_list\": *\"(.-)\"" )
                     if fmt_list then
                         fmt_list = string.gsub( fmt_list, "\\/", "/" )
                         fmt = get_fmt( fmt_list )
                     end
                 end
 
-                url_map = string.match( line, "\"url_encoded_fmt_stream_map\": \"(.-)\"" )
+                url_map = string.match( line, "\"url_encoded_fmt_stream_map\": *\"(.-)\"" )
                 if url_map then
                     -- FIXME: do this properly
                     url_map = string.gsub( url_map, "\\u0026", "&" )
@@ -282,7 +280,7 @@ function parse()
                 if not path then
                     -- If this is a live stream, the URL map will be empty
                     -- and we get the URL from this field instead 
-                    local hlsvp = string.match( line, "\"hlsvp\": \"(.-)\"" )
+                    local hlsvp = string.match( line, "\"hlsvp\": *\"(.-)\"" )
                     if hlsvp then
                         hlsvp = string.gsub( hlsvp, "\\/", "/" )
                         path = hlsvp
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 2aaa5d3..585d5b2 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -247,6 +247,7 @@ audio_output_t *aout_New (vlc_object_t *parent)
         text.psz_string = (char *)"Goom";
         var_Change (aout, "visual", VLC_VAR_ADDCHOICE, &val, &text);
     }
+#ifndef _WIN32
     /* Look for libprojectM plugin */
     if (module_exists ("projectm"))
     {
@@ -268,6 +269,7 @@ audio_output_t *aout_New (vlc_object_t *parent)
         text.psz_string = (char*)"3D spectrum";
         var_Change (aout, "visual", VLC_VAR_ADDCHOICE, &val, &text);
     }
+#endif
     str = var_GetNonEmptyString (aout, "effect-list");
     if (str != NULL)
     {
diff --git a/src/input/control.c b/src/input/control.c
index 8cecb14..74a1f10 100644
--- a/src/input/control.c
+++ b/src/input/control.c
@@ -2,7 +2,7 @@
  * control.c
  *****************************************************************************
  * Copyright (C) 1999-2004 VLC authors and VideoLAN
- * $Id: 8a03b1c2422c56bb58029347d25246a224816963 $
+ * $Id: 2e4633ff689f575e6ef90e7e29274f79b1e4a6a4 $
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *
@@ -535,7 +535,7 @@ static void UpdateBookmarksOption( input_thread_t *p_input )
     {
         strcpy( psz_value, "bookmarks=" );
 
-        char *psz_next = psz_value + strlen( "bookmarks" );
+        char *psz_next = psz_value + strlen( "bookmarks=" );
 
         for( int i = 0; i < p_input->p->i_bookmark && psz_value != NULL; i++ )
         {
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 94cbb52..41524ff 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -2,7 +2,7 @@
  * es_out.c: Es Out handler for input.
  *****************************************************************************
  * Copyright (C) 2003-2004 VLC authors and VideoLAN
- * $Id: ab092544bc072268470a8bddfffbe0908ead2cfe $
+ * $Id: ddf01e13c185e74020afd1c4bc929c977cb90f04 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
@@ -1014,7 +1014,7 @@ static void EsOutProgramSelect( es_out_t *out, es_out_pgrm_t *p_pgrm )
     }
 
     /* Update now playing */
-    input_item_SetNowPlaying( p_input->p->p_item, p_pgrm->psz_now_playing );
+    input_item_SetESNowPlaying( p_input->p->p_item, p_pgrm->psz_now_playing );
     input_item_SetPublisher( p_input->p->p_item, p_pgrm->psz_publisher );
 
     input_SendEventMeta( p_input );
@@ -1157,6 +1157,7 @@ static void EsOutProgramMeta( es_out_t *out, int i_group, const vlc_meta_t *p_me
     /* Check against empty meta data (empty for what we handle) */
     if( !vlc_meta_Get( p_meta, vlc_meta_Title) &&
         !vlc_meta_Get( p_meta, vlc_meta_NowPlaying) &&
+        !vlc_meta_Get( p_meta, vlc_meta_ESNowPlaying) &&
         !vlc_meta_Get( p_meta, vlc_meta_Publisher) &&
         vlc_meta_GetExtraCount( p_meta ) <= 0 )
     {
@@ -1295,20 +1296,20 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg
 
     if( p_pgrm == p_sys->p_pgrm )
     {
-        input_item_SetNowPlaying( p_input->p->p_item, p_pgrm->psz_now_playing );
+        input_item_SetESNowPlaying( p_input->p->p_item, p_pgrm->psz_now_playing );
         input_SendEventMeta( p_input );
     }
 
     if( p_pgrm->psz_now_playing )
     {
         input_Control( p_input, INPUT_ADD_INFO, psz_cat,
-            vlc_meta_TypeToLocalizedString(vlc_meta_NowPlaying), "%s",
+            vlc_meta_TypeToLocalizedString(vlc_meta_ESNowPlaying), "%s",
             p_pgrm->psz_now_playing );
     }
     else
     {
         input_Control( p_input, INPUT_DEL_INFO, psz_cat,
-            vlc_meta_TypeToLocalizedString(vlc_meta_NowPlaying) );
+            vlc_meta_TypeToLocalizedString(vlc_meta_ESNowPlaying) );
     }
 
     free( psz_cat );
diff --git a/src/input/input.c b/src/input/input.c
index 49b3618..482eb21 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2,7 +2,7 @@
  * input.c: input thread
  *****************************************************************************
  * Copyright (C) 1998-2007 VLC authors and VideoLAN
- * $Id: 41c1a997881a8b77f492244676b68c65b118c45c $
+ * $Id: 05e4ff36eb72d929889aed480c5c9ee20d7e2316 $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -449,6 +449,7 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
 
     /* Remove 'Now playing' info as it is probably outdated */
     input_item_SetNowPlaying( p_item, NULL );
+    input_item_SetESNowPlaying( p_item, NULL );
     input_SendEventMeta( p_input );
 
     /* */
diff --git a/src/input/meta.c b/src/input/meta.c
index 04fa83f..a280377 100644
--- a/src/input/meta.c
+++ b/src/input/meta.c
@@ -2,7 +2,7 @@
  * meta.c : Metadata handling
  *****************************************************************************
  * Copyright (C) 1998-2004 VLC authors and VideoLAN
- * $Id: 892b4af3089b2027041159d23570810a9032ed9c $
+ * $Id: 2fb14d81921ae84945325fecd5c28cfa1220c43a $
  *
  * Authors: Antoine Cellerier <dionoea@videolan.org>
  *          Clément Stenac <zorglub@videolan.org
@@ -65,6 +65,7 @@ const char * vlc_meta_TypeToLocalizedString( vlc_meta_type_t meta_type )
         [vlc_meta_URL]         = N_("URL"),
         [vlc_meta_Language]    = N_("Language"),
         [vlc_meta_NowPlaying]  = N_("Now Playing"),
+        [vlc_meta_ESNowPlaying]= N_("Now Playing"),
         [vlc_meta_Publisher]   = N_("Publisher"),
         [vlc_meta_EncodedBy]   = N_("Encoded by"),
         [vlc_meta_ArtworkURL]  = N_("Artwork URL"),
diff --git a/src/input/resource.c b/src/input/resource.c
index eeef9f8..f6f8e2f 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -2,7 +2,7 @@
  * resource.c
  *****************************************************************************
  * Copyright (C) 2008 Laurent Aimar
- * $Id: 779c921a2c69a87cfee59de2071dcd49c4dba96e $
+ * $Id: 34402885ec500db3ed22f7c8e431d96ed30d1cca $
  *
  * Authors: Laurent Aimar < fenrir _AT_ videolan _DOT_ org >
  *
@@ -158,7 +158,7 @@ static void DisplayVoutTitle( input_resource_t *p_resource,
 
     input_item_t *p_item = input_GetItem( p_resource->p_input );
 
-    char *psz_nowplaying = input_item_GetNowPlaying( p_item );
+    char *psz_nowplaying = input_item_GetNowPlayingFb( p_item );
     if( psz_nowplaying && *psz_nowplaying )
     {
         vout_DisplayTitle( p_vout, psz_nowplaying );
diff --git a/src/input/stream.c b/src/input/stream.c
index da299d8..72ff8ca 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -2,7 +2,7 @@
  * stream.c
  *****************************************************************************
  * Copyright (C) 1999-2004 VLC authors and VideoLAN
- * $Id: 18e77e221dd45a1d4bebd506fec1dd5c90e5eed5 $
+ * $Id: 4cceaac01b72d528516924a7e5342f09909bb692 $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -1083,15 +1083,15 @@ static int AStreamPeekStream( stream_t *s, const uint8_t **pp_peek, unsigned int
             /* Be sure we will read something */
             p_sys->stream.i_used += tk->i_start + p_sys->stream.i_offset + i_read - tk->i_end;
         }
-        if( AStreamRefillStream( s ) ) break;
-    }
-
-    if( tk->i_end < tk->i_start + p_sys->stream.i_offset + i_read )
-    {
-        i_read = tk->i_end - tk->i_start - p_sys->stream.i_offset;
+        if( AStreamRefillStream( s ) )
+        {
+            if( tk->i_end < tk->i_start + p_sys->stream.i_offset )
+                return 0; /* EOF */
+            i_read = tk->i_end - tk->i_start - p_sys->stream.i_offset;
+            break;
+        }
     }
 
-
     /* Now, direct pointer or a copy ? */
     i_off = (tk->i_start + p_sys->stream.i_offset) % STREAM_CACHE_TRACK_SIZE;
     if( i_off + i_read <= STREAM_CACHE_TRACK_SIZE )
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 3981f60..2f26060 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -2,7 +2,7 @@
  * libvlc-module.c: Options for the core (libvlc itself) module
  *****************************************************************************
  * Copyright (C) 1998-2009 VLC authors and VideoLAN
- * $Id: f0ee030c9045243d775c1673da4988e0cf4e8c79 $
+ * $Id: f8adbf3c0f6a1fff3d304e031c7b981bb6b41482 $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -1873,7 +1873,6 @@ vlc_module_begin ()
 
     set_subcategory( SUBCAT_INPUT_DEMUX )
     add_module( "demux", "demux", "any", DEMUX_TEXT, DEMUX_LONGTEXT, true )
-    set_subcategory( SUBCAT_INPUT_VCODEC )
     set_subcategory( SUBCAT_INPUT_ACODEC )
     set_subcategory( SUBCAT_INPUT_SCODEC )
     add_obsolete_bool( "prefer-system-codecs" )
@@ -2075,7 +2074,7 @@ vlc_module_begin ()
     add_bool( "interact", true, INTERACTION_TEXT,
               INTERACTION_LONGTEXT, false )
 
-    add_bool ( "stats", false, STATS_TEXT, STATS_LONGTEXT, true )
+    add_bool ( "stats", true, STATS_TEXT, STATS_LONGTEXT, true )
 
     set_subcategory( SUBCAT_INTERFACE_MAIN )
     add_module_cat( "intf", SUBCAT_INTERFACE_MAIN, NULL, INTF_TEXT,
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 8694c6e..d76ae11 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -274,6 +274,7 @@ static const staticentry_t p_list_video[] = {
         A("H265"),
         A("x265"),
         A("hev1"),
+        A("HM10"),
 
     /* h264 */
     B(VLC_CODEC_H264, "H264 - MPEG-4 AVC (part 10)"),
diff --git a/src/misc/update.c b/src/misc/update.c
index 28d70f0..0222e61 100644
--- a/src/misc/update.c
+++ b/src/misc/update.c
@@ -2,7 +2,7 @@
  * update.c: VLC update checking and downloading
  *****************************************************************************
  * Copyright © 2005-2008 VLC authors and VideoLAN
- * $Id: b00eb27bbf79dc78e922472aa6812e329659c9d7 $
+ * $Id: e1257b7d8230e215886e00fa4c462ffead12fa45 $
  *
  * Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
  *          Rémi Duraffort <ivoire at via.ecp.fr>
@@ -193,6 +193,13 @@ static bool GetUpdateFile( update_t *p_update )
     }
 
     const int64_t i_read = stream_Size( p_stream );
+
+    if( i_read < 0 || i_read >= UINT16_MAX)
+    {
+        msg_Err(p_update->p_libvlc, "Status file too large");
+        goto error;
+    }
+
     psz_update_data = malloc( i_read + 1 ); /* terminating '\0' */
     if( !psz_update_data )
         goto error;
diff --git a/src/revision.c b/src/revision.c
index b4bae43..3e9dc4f 100644
--- a/src/revision.c
+++ b/src/revision.c
@@ -1 +1 @@
-const char psz_vlc_changeset[] = "2.2.0-rc1-118-g22fda39";
+const char psz_vlc_changeset[] = "2.2.1-0-ga425c42";
diff --git a/src/text/strings.c b/src/text/strings.c
index acd5805..c43ff8a 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  * Copyright (C) 2006 VLC authors and VideoLAN
  * Copyright (C) 2008-2009 Rémi Denis-Courmont
- * $Id: d7212ea3a3b21fea7a79b1a0785ace643eabc7e9 $
+ * $Id: d864211921b6e562350109cd3c727ebc5c9d564b $
  *
  * Authors: Antoine Cellerier <dionoea at videolan dot org>
  *          Daniel Stranger <vlc at schmaller dot de>
@@ -534,6 +534,8 @@ char *str_format_meta(input_thread_t *input, const char *s)
     size_t len;
 #ifdef HAVE_OPEN_MEMSTREAM
     FILE *stream = open_memstream(&str, &len);
+#elif defined( _WIN32 )
+    FILE *stream = vlc_win32_tmpfile();
 #else
     FILE *stream = tmpfile();
 #endif
@@ -603,7 +605,16 @@ char *str_format_meta(input_thread_t *input, const char *s)
                 write_meta(stream, item, vlc_meta_TrackNumber);
                 break;
             case 'p':
-                write_meta(stream, item, vlc_meta_NowPlaying);
+                if (item == NULL)
+                    break;
+                {
+                    char *value = input_item_GetNowPlayingFb(item);
+                    if (value == NULL)
+                        break;
+
+                    fputs(value, stream);
+                    free(value);
+                }
                 break;
             case 'r':
                 write_meta(stream, item, vlc_meta_Rating);
@@ -761,18 +772,28 @@ char *str_format_meta(input_thread_t *input, const char *s)
                 fputc('\n', stream);
                 break;
             case 'Z':
-                if (write_meta(stream, item, vlc_meta_NowPlaying) == EOF)
+                if (item == NULL)
+                    break;
                 {
-                    char *title = input_item_GetTitleFbName(item);
+                    char *value = input_item_GetNowPlayingFb(item);
+                    if (value != NULL)
+                    {
+                        fputs(value, stream);
+                        free(value);
+                    }
+                    else
+                    {
+                        char *title = input_item_GetTitleFbName(item);
 
-                    if (write_meta(stream, item, vlc_meta_Artist) >= 0
-                     && title != NULL)
-                        fputs(" - ", stream);
+                        if (write_meta(stream, item, vlc_meta_Artist) >= 0
+                            && title != NULL)
+                            fputs(" - ", stream);
 
-                    if (title != NULL)
-                    {
-                        fputs(title, stream);
-                        free(title);
+                        if (title != NULL)
+                        {
+                            fputs(title, stream);
+                            free(title);
+                        }
                     }
                 }
                 break;
@@ -797,6 +818,8 @@ char *str_format_meta(input_thread_t *input, const char *s)
         fread(str, len, 1, stream);
         str[len] = '\0';
     }
+    else
+        str = NULL;
     fclose(stream);
     return str;
 #endif
diff --git a/src/text/url.c b/src/text/url.c
index cd7e488..5ba11da 100644
--- a/src/text/url.c
+++ b/src/text/url.c
@@ -433,7 +433,7 @@ void vlc_UrlParse (vlc_url_t *restrict url, const char *str, unsigned char opt)
     {
         *next = '\0'; /* temporary nul, reset to slash later */
         url->psz_path = next;
-        if (opt && (next = strchr (next, opt)) != NULL)
+        if (opt && (next = strchr (next + 1, opt)) != NULL)
         {
             *(next++) = '\0';
             url->psz_option = next;
diff --git a/src/video_output/snapshot.c b/src/video_output/snapshot.c
index 134586e..c6bad79 100644
--- a/src/video_output/snapshot.c
+++ b/src/video_output/snapshot.c
@@ -2,7 +2,7 @@
  * snapshot.c : vout internal snapshot
  *****************************************************************************
  * Copyright (C) 2009 Laurent Aimar
- * $Id: c8096ef60930bbf20670c68bf19b77be9e936c9c $
+ * $Id: 7b89803740174cb81ad09718d4a7f997d37a6f18 $
  *
  * Authors: Gildas Bazin <gbazin _AT_ videolan _DOT_ org>
  *          Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
@@ -190,9 +190,9 @@ int vout_snapshot_SaveImage(char **name, int *sequential,
                          &curtime) == 0)
                 strcpy(buffer, "error");
 
-            if (asprintf(&filename, "%s" DIR_SEP "%s%s%03lu.%s",
-                         cfg->path, prefix, buffer, tv.tv_usec / 1000,
-                         cfg->format) < 0)
+            if (asprintf(&filename, "%s" DIR_SEP "%s%s%03u.%s",
+                         cfg->path, prefix, buffer,
+                         (unsigned)tv.tv_usec / 1000, cfg->format) < 0)
                 filename = NULL;
         }
         free(prefix);
diff --git a/src/video_output/video_epg.c b/src/video_output/video_epg.c
index 471d52c..a0b5c6f 100644
--- a/src/video_output/video_epg.c
+++ b/src/video_output/video_epg.c
@@ -263,7 +263,7 @@ static void OSDEpgDestroy(subpicture_t *subpic)
  */
 int vout_OSDEpg(vout_thread_t *vout, input_item_t *input)
 {
-    char *now_playing = input_item_GetNowPlaying(input);
+    char *now_playing = input_item_GetNowPlayingFb(input);
     vlc_epg_t *epg = NULL;
 
     vlc_mutex_lock(&input->lock);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 5131382..e6aafd3 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -6,7 +6,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000-2007 VLC authors and VideoLAN
- * $Id: 1b01ee08d8579469179f491da817821c46d48374 $
+ * $Id: bc1fd6c5f849cbdbb0207f2d3c14758b56b11d6c $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Gildas Bazin <gbazin@videolan.org>
@@ -1264,7 +1264,14 @@ static void ThreadStep(vout_thread_t *vout, mtime_t *duration)
 
 static void ThreadChangeFullscreen(vout_thread_t *vout, bool fullscreen)
 {
-    vout_SetDisplayFullscreen(vout->p->display.vd, fullscreen);
+    vout_window_t *window = vout->p->window.object;
+
+    if (window != NULL)
+        vout_window_SetFullScreen(window, fullscreen);
+    else
+    if (vout->p->display.vd != NULL)
+        vout_display_SendEvent(vout->p->display.vd,
+                               VOUT_DISPLAY_EVENT_FULLSCREEN, fullscreen);
 }
 
 static void ThreadChangeWindowState(vout_thread_t *vout, unsigned state)

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Version: 8.3

Hi,

The updates referred to in these bugs were included in today's 8.3
Jessie point release.

Regards,

Adam

--- End Message ---

Reply to: