diff --git a/Changelog b/Changelog
index 7dd82efabfb109881aee2a992725727b022a29ca..0b2d13bc7661f8395b262053ba1b042d45df6072 100644
--- a/Changelog
+++ b/Changelog
@@ -120,6 +120,7 @@ easier to use. The changes are:
 - Encrypted OMA files support
 - Discworld II BMV decoding support
 - VBLE Decoder
+- OS X Video Decoder Acceleration (VDA) support
 
 
 version 0.8:
diff --git a/configure b/configure
index 891fd5564d407d181a65b32d215e67705afcd312..8ff3f7f4e56a2d2fc44e7c1db978999f5f574eb4 100755
--- a/configure
+++ b/configure
@@ -110,6 +110,7 @@ Configuration options:
   --disable-mdct           disable MDCT code
   --disable-rdft           disable RDFT code
   --enable-vaapi           enable VAAPI code [autodetect]
+  --enable-vda             enable VDA code [autodetect]
   --enable-vdpau           enable VDPAU code [autodetect]
   --disable-dxva2          disable DXVA2 code
   --disable-vda            disable VDA code
@@ -1496,6 +1497,7 @@ zmbv_encoder_select="zlib"
 
 crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
 vaapi_deps="va_va_h"
+vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
 vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
 
 # parsers
diff --git a/doc/t2h.init b/doc/t2h.init
index 015712f699e3228ac894fb6bb291de2b09dbca43..ee87ac2230aa6ccfd1cec508509b00f981e9d48f 100644
--- a/doc/t2h.init
+++ b/doc/t2h.init
@@ -9,9 +9,13 @@ $EXTRA_HEAD =
 <link rel="stylesheet" type="text/css" href="default.css" />
 ';
 
+
+my $FFMPEG_NAVBAR = $ENV{"FFMPEG_NAVBAR"} || '';
+
 $AFTER_BODY_OPEN =
-'<div id="container">
-<div id="body">';
+'<div id="container">' .
+"\n$FFMPEG_NAVBAR\n" .
+'<div id="body">';
 
 $PRE_BODY_CLOSE = '</div></div>';
 
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 253a8749371d4433d1660b0e100a0049b2a48a76..6df7a3237b945bbe7264036d723614676dc180d5 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -595,7 +595,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
 {
     int coef_list[128];
     int mode_list[128];
-    int i, t, mask, bits, ccoef, mode, sign;
+    int i, t, bits, ccoef, mode, sign;
     int list_start = 64, list_end = 64, list_pos;
     int coef_count = 0;
     int coef_idx[64];
@@ -609,8 +609,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
     coef_list[list_end] = 2;  mode_list[list_end++] = 3;
     coef_list[list_end] = 3;  mode_list[list_end++] = 3;
 
-    bits = get_bits(gb, 4) - 1;
-    for (mask = 1 << bits; bits >= 0; mask >>= 1, bits--) {
+    for (bits = get_bits(gb, 4) - 1; bits >= 0; bits--) {
         list_pos = list_start;
         while (list_pos < list_end) {
             if (!(mode_list[list_pos] | coef_list[list_pos]) || !get_bits1(gb)) {
@@ -636,7 +635,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
                         if (!bits) {
                             t = 1 - (get_bits1(gb) << 1);
                         } else {
-                            t = get_bits(gb, bits) | mask;
+                            t = get_bits(gb, bits) | 1 << bits;
                             sign = -get_bits1(gb);
                             t = (t ^ sign) - sign;
                         }
@@ -657,7 +656,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
                 if (!bits) {
                     t = 1 - (get_bits1(gb) << 1);
                 } else {
-                    t = get_bits(gb, bits) | mask;
+                    t = get_bits(gb, bits) | 1 << bits;
                     sign = -get_bits1(gb);
                     t = (t ^ sign) - sign;
                 }
diff --git a/libavcodec/version.h b/libavcodec/version.h
index cd21d9504a45046cd152f6b7a93551eb05d116bb..b7f01e95c64b8bc3f0f021cd2c6c32c8f9be00af 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -21,7 +21,7 @@
 #define AVCODEC_VERSION_H
 
 #define LIBAVCODEC_VERSION_MAJOR 53
-#define LIBAVCODEC_VERSION_MINOR 33
+#define LIBAVCODEC_VERSION_MINOR 34
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavdevice/pulse.c b/libavdevice/pulse.c
index 79da7a6bfb8fbf4d99c7f41f74c7bf281cd09bc9..0b60651d08d3c927f8bf5a618314a6be55514bdb 100644
--- a/libavdevice/pulse.c
+++ b/libavdevice/pulse.c
@@ -46,6 +46,7 @@ typedef struct PulseData {
     int  fragment_size;
     pa_simple *s;
     int64_t pts;
+    int64_t frame_duration;
 } PulseData;
 
 static pa_sample_format_t codec_id_to_pulse_format(int codec_id) {
@@ -110,6 +111,8 @@ static av_cold int pulse_read_header(AVFormatContext *s,
     av_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
 
     pd->pts = AV_NOPTS_VALUE;
+    pd->frame_duration = (pd->frame_size * 1000000LL * 8) /
+        (pd->sample_rate * pd->channels * av_get_bits_per_sample(codec_id));
 
     return 0;
 }
@@ -119,8 +122,6 @@ static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt)
     PulseData *pd  = s->priv_data;
     int res;
     pa_usec_t latency;
-    uint64_t frame_duration =
-        (pd->frame_size*1000000LL) / (pd->sample_rate * pd->channels);
 
     if (av_new_packet(pkt, pd->frame_size) < 0) {
         return AVERROR(ENOMEM);
@@ -145,7 +146,7 @@ static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt)
 
     pkt->pts = pd->pts;
 
-    pd->pts += frame_duration;
+    pd->pts += pd->frame_duration;
 
     return 0;
 }
diff --git a/libavformat/options.c b/libavformat/options.c
index 4afb8b52bc8cdbcdd7c6eba02d62dac99c6d7ba2..3290f92a37b75b9183e65c89b421e68f3eba1e6f 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -53,30 +53,29 @@ static const AVClass *format_child_class_next(const AVClass *prev)
     AVInputFormat  *ifmt = NULL;
     AVOutputFormat *ofmt = NULL;
 
-    while (prev && (ifmt = av_iformat_next(ifmt)))
-        if (ifmt->priv_class == prev){
-            prev = NULL;
-            break;
-        }
     if (!prev)
+#if !FF_API_OLD_AVIO
+        return &ffio_url_class;
+#else
+    prev = (void *)&ifmt; // Dummy pointer;
+#endif
+
+    while ((ifmt = av_iformat_next(ifmt)))
+        if (ifmt->priv_class == prev)
+            break;
+
+    if (!ifmt)
+        while ((ofmt = av_oformat_next(ofmt)))
+            if (ofmt->priv_class == prev)
+                break;
+    if (!ofmt)
         while (ifmt = av_iformat_next(ifmt))
             if (ifmt->priv_class)
                 return ifmt->priv_class;
 
-    while (prev && (ofmt = av_oformat_next(ofmt)))
-        if (ofmt->priv_class == prev){
-            prev = NULL;
-            break;
-        }
-    if (!prev)
-        while (ofmt = av_oformat_next(ofmt))
-            if (ofmt->priv_class)
-                return ofmt->priv_class;
-
-#if !FF_API_OLD_AVIO
-    if (prev != &ffio_url_class)
-        return &ffio_url_class;
-#endif
+    while (ofmt = av_oformat_next(ofmt))
+        if (ofmt->priv_class)
+            return ofmt->priv_class;
 
     return NULL;
 }
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index ac84cccad2b2d4a3a69976ed4844fbdd9168bf2c..72cfb8a3c0913871efcbe08c0bb82882f5fe3438 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -40,8 +40,8 @@
 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
 
 #define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 24
-#define LIBAVUTIL_VERSION_MICRO  1
+#define LIBAVUTIL_VERSION_MINOR 25
+#define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 6648a7e8f5301ae6e78b79c5c42a657e41a96942..958499db9d9095eeab340db09e911fb4b1a8260a 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -790,6 +790,12 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_h = 1,
         .flags = PIX_FMT_HWACCEL,
     },
+    [PIX_FMT_VDA_VLD] = {
+        .name = "vda_vld",
+        .log2_chroma_w = 1,
+        .log2_chroma_h = 1,
+        .flags = PIX_FMT_HWACCEL,
+    },
     [PIX_FMT_YUV420P9LE] = {
         .name = "yuv420p9le",
         .nb_components= 3,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 6719e83489e1689a74de88bd51632afe5b8aeb88..37b694e7bf45d2f503632fd08584b0f734543aa7 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -151,6 +151,7 @@ enum PixelFormat {
     PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
     PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
     PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
 
     PIX_FMT_RGBA64BE,  ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
     PIX_FMT_RGBA64LE,  ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
@@ -158,8 +159,6 @@ enum PixelFormat {
     PIX_FMT_BGRA64LE,  ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
     PIX_FMT_GBR24P,    ///< planar GBR, 24bpp, 8G, 8B, 8R.
 
-    PIX_FMT_VDA_VLD,   ///< HW decoding through VDA.
-
     PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
 };