The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ffmpeg / 0015-hevc-avoid-unnecessary-calls.patch
1 From ef86b05da8ad38c9c83e6f075536635647e6b799 Mon Sep 17 00:00:00 2001
2 From: Rainer Hochecker <fernetmenta@online.de>
3 Date: Thu, 12 Mar 2015 12:49:48 +0100
4 Subject: [PATCH] hevc: avoid unnecessary calls to get_format
5
6 Patch part of the XBMC patch set for ffmpeg, downloaded from
7 https://github.com/xbmc/FFmpeg/.
8
9 Upstream status: committed to master
10 http://git.videolan.org/?p=ffmpeg.git;a=commit;h=786032cad8ecabe577d9cff0356da6e9e9488a2d
11
12 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
13 ---
14  libavcodec/hevc.c | 23 ++++++++++++++---------
15  1 file changed, 14 insertions(+), 9 deletions(-)
16
17 diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
18 index b7ad29a..77b0c0c 100644
19 --- a/libavcodec/hevc.c
20 +++ b/libavcodec/hevc.c
21 @@ -280,7 +280,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
22      return 0;
23  }
24  
25 -static int set_sps(HEVCContext *s, const HEVCSPS *sps)
26 +static int set_sps(HEVCContext *s, const HEVCSPS *sps, enum AVPixelFormat pix_fmt)
27  {
28      #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL)
29      enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
30 @@ -304,13 +304,18 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
31  #endif
32      }
33  
34 -    *fmt++ = sps->pix_fmt;
35 -    *fmt = AV_PIX_FMT_NONE;
36 +    if (pix_fmt == AV_PIX_FMT_NONE) {
37 +        *fmt++ = sps->pix_fmt;
38 +        *fmt = AV_PIX_FMT_NONE;
39  
40 -    ret = ff_thread_get_format(s->avctx, pix_fmts);
41 -    if (ret < 0)
42 -        goto fail;
43 -    s->avctx->pix_fmt = ret;
44 +        ret = ff_thread_get_format(s->avctx, pix_fmts);
45 +        if (ret < 0)
46 +            goto fail;
47 +        s->avctx->pix_fmt = ret;
48 +    }
49 +    else {
50 +        s->avctx->pix_fmt = pix_fmt;
51 +    }
52  
53      ff_set_sar(s->avctx, sps->vui.sar);
54  
55 @@ -420,7 +425,7 @@ static int hls_slice_header(HEVCContext *s)
56                  sh->no_output_of_prior_pics_flag = 0;
57          }
58          ff_hevc_clear_refs(s);
59 -        ret = set_sps(s, s->sps);
60 +        ret = set_sps(s, s->sps, AV_PIX_FMT_NONE);
61          if (ret < 0)
62              return ret;
63  
64 @@ -3335,7 +3340,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
65      }
66  
67      if (s->sps != s0->sps)
68 -        if ((ret = set_sps(s, s0->sps)) < 0)
69 +        if ((ret = set_sps(s, s0->sps, src->pix_fmt)) < 0)
70              return ret;
71  
72      s->seq_decode = s0->seq_decode;