aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCrystalP <CrystalP@xbmc.org>2011-11-06 18:52:32 -0500
committerCrystalP <CrystalP@xbmc.org>2011-11-06 18:55:38 -0500
commit7481bbf657beba464950cce9c28a802a90b956ec (patch)
tree1e072ed4ceaba1a15af9eaec04e704f2e3d39d65 /lib
parentb44b65373bb0bd48833607f39c65c80e6667a11e (diff)
Add patch file for commit 438acad3
Diffstat (limited to 'lib')
-rw-r--r--lib/ffmpeg/patches/0059-fix-h264-decode-size.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/ffmpeg/patches/0059-fix-h264-decode-size.patch b/lib/ffmpeg/patches/0059-fix-h264-decode-size.patch
new file mode 100644
index 0000000000..9328ac6ffb
--- /dev/null
+++ b/lib/ffmpeg/patches/0059-fix-h264-decode-size.patch
@@ -0,0 +1,43 @@
+backport of upstream commits 23acfcd9 and 29a29226
+
+Slightly modified because of differences between upstream code and ours.
+
+---
+
+diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c
+index 31d43df..47b0073 100644
+--- a/lib/ffmpeg/libavcodec/h264.c
++++ b/lib/ffmpeg/libavcodec/h264.c
+@@ -1797,15 +1797,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
+ s->mb_height= h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
+
+ h->b_stride= s->mb_width*4;
+-
+- s->width = 16*s->mb_width - 2*FFMIN(h->sps.crop_right, 7);
+- if(h->sps.frame_mbs_only_flag)
+- s->height= 16*s->mb_height - 2*FFMIN(h->sps.crop_bottom, 7);
+- else
+- s->height= 16*s->mb_height - 4*FFMIN(h->sps.crop_bottom, 7);
++ s->width = 16*s->mb_width;
++ s->height= 16*s->mb_height;
+
+ if (s->context_initialized
+- && ( s->width != s->avctx->width || s->height != s->avctx->height
++ && ( s->width != s->avctx->coded_width || s->height != s->avctx->coded_height
+ || av_cmp_q(h->sps.sar, s->avctx->sample_aspect_ratio))) {
+ if(h != h0)
+ return -1; // width / height changed during parallelized decoding
+@@ -1818,6 +1814,13 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
+ return -1; // we cant (re-)initialize context during parallel decoding
+
+ avcodec_set_dimensions(s->avctx, s->width, s->height);
++
++ s->avctx->width -= 2*FFMIN(h->sps.crop_right, 7);
++ if(h->sps.frame_mbs_only_flag)
++ s->avctx->height-=2*FFMIN(h->sps.crop_bottom, 7);
++ else
++ s->avctx->height-=4*FFMIN(h->sps.crop_bottom, 7);
++
+ s->avctx->sample_aspect_ratio= h->sps.sar;
+ av_assert0(s->avctx->sample_aspect_ratio.den);
+