diff options
author | Anssi Hannula <anssi@xbmc.org> | 2012-03-07 15:45:35 +0200 |
---|---|---|
committer | Anssi Hannula <anssi@xbmc.org> | 2012-03-07 15:50:33 +0200 |
commit | f7af84ff0fd6670ac80580884f1329e513849f16 (patch) | |
tree | adee4a0108732bfcddebc38e5b9044568845458b /lib/ffmpeg/patches | |
parent | ba30d1a61ba465a672644a6d3dedf29c3cd5414e (diff) |
added: missing patch files for 15 commits to internal ffmpeg
Several commits have been made to the internal ffmpeg in the past year
without adding the corresponding .patch file to lib/ffmpeg/patches.
Add the missing ones:
Joakim Plate <elupus@xbmc.org> 2011-03-07 23:56:48
fixed: playing mpegts over rtsp caused ffmpeg to read uninitialized
stack values
8ec66e240fe0a9f672d7ff1932022f22f8332ffb
Lars Op den Kamp <lars@opdenkamp.eu> 2011-03-13 04:23:42
ffmpeg: add missing check for NULL pointer
54fd0c0596e8bd47adb9ac325ddb93d99647fe83
elupus <elupus@xbmc.org> 2011-06-24 02:29:31
changed: allow yadif deinterlacer to enable and disable based on input
interlaced flag
c174f74181bcfa169aa8284f9524cd9db0f4cdda
elupus <elupus@xbmc.org> 2011-07-03 18:08:54
changed: updated yadif patch to same as will be applied upstream
91efb0af6f80d82b104a810a1ccdc0ae6702d022
elupus <elupus@xbmc.org> 2011-07-05 01:17:40
changed: updated dxva zigzag workaround for ATI based on comments on
xbmc.org and ffmpeg.org
321c5e668f2c213a33cef6c7c9fe11ee2850665f
elupus <elupus@xbmc.org> 2011-07-14 23:29:37
fixed: yadif should copy frame properties of second frame as well
793f3e0bfcaadaccd0b5db2a37a60da42a6b207e
davilla <davilla@4pi.com> 2011-09-07 07:17:52
[ffmpeg] silence compiler warnings
5542a0c7e68d123b86f168ace00f7320b294fc39
CrystalP <CrystalP@xbmc.org> 2011-10-16 10:16:49
matroskadec: use correct compression parameters for current track
CodecPrivate
8efe4d01dcd2f89ad012b8f1dd71192e09fa3e82
arnova <nospam@void.org> 2011-11-08 09:36:40
fixed: Typo
dc0509f7a6341a72ca4399fee37e30c91fddc222
elupus <elupus@xbmc.org> 2011-11-13 02:55:51
h264: Use mismatching frame numbers in fields to synchronize the
first/second field state independant of them being reference or not.
Fixes Ticket354
2ac62404c2f833d5aa64947819538ac354966ef0
elupus <elupus@xbmc.org> 2011-11-19 13:39:26
Don't fill in frame gaps with copied refs after flush
46d99a89aa16db1981441bf7103a30e7d28e5e26
elupus <elupus@xbmc.org> 2011-12-09 23:11:23
vaapi: do not assert on value read from input bitstream
425b9a373384813d2fe513d42b1d585ecbea6ca5
spiff <spiff@xbmc.org> 2012-01-17 23:50:13
fixed: playback from mmst:// urls would halt after some time.
919a875b4bc4ea2a8ddc0aab98ea74c6475f9525
elupus <elupus@xbmc.org> 2012-02-11 16:19:51
Fix dvb subtitle decoding when display segment is missing.
6373f33e5b12eb06e37d670c9bba4e7041cded79
elupus <elupus@xbmc.org> 2012-02-19 18:03:35
Change yadif to not use out of picture lines. Fixes issue2272.
42bedafe92b2921ec63024a825d4297ba39888e9
Diffstat (limited to 'lib/ffmpeg/patches')
15 files changed, 786 insertions, 0 deletions
diff --git a/lib/ffmpeg/patches/0063-fixed-playing-mpegts-over-rtsp-caused-ffmpeg-to-read.patch b/lib/ffmpeg/patches/0063-fixed-playing-mpegts-over-rtsp-caused-ffmpeg-to-read.patch new file mode 100644 index 0000000000..4b50b5e094 --- /dev/null +++ b/lib/ffmpeg/patches/0063-fixed-playing-mpegts-over-rtsp-caused-ffmpeg-to-read.patch @@ -0,0 +1,29 @@ +From 8ec66e240fe0a9f672d7ff1932022f22f8332ffb Mon Sep 17 00:00:00 2001 +From: Joakim Plate <elupus@xbmc.org> +Date: Mon, 7 Mar 2011 22:53:30 +0100 +Subject: [PATCH] fixed: playing mpegts over rtsp caused ffmpeg to read + uninitialized stack values + +This is an amendment to cdfab91b9c4b7ed2560071f5630567db174d6084 the memleak +fix for mpegts. It's questionable if that change is needed. Since +the main issue it was for has been fixed correctly. However it +doesn't hurt to avoid potential memleaks this way. +--- + lib/ffmpeg/libavformat/mpegts.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/mpegts.c b/lib/ffmpeg/libavformat/mpegts.c +index 9c25e37..2dbd07e 100644 +--- a/lib/ffmpeg/libavformat/mpegts.c ++++ b/lib/ffmpeg/libavformat/mpegts.c +@@ -1879,6 +1879,7 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, + + len1 = len; + ts->pkt = pkt; ++ ts->pkt->data = NULL; + ts->stop_parse = 0; + for(;;) { + if (ts->stop_parse>0) +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0064-ffmpeg-add-missing-check-for-NULL-pointer.patch b/lib/ffmpeg/patches/0064-ffmpeg-add-missing-check-for-NULL-pointer.patch new file mode 100644 index 0000000000..a1ff8e2882 --- /dev/null +++ b/lib/ffmpeg/patches/0064-ffmpeg-add-missing-check-for-NULL-pointer.patch @@ -0,0 +1,28 @@ +From 54fd0c0596e8bd47adb9ac325ddb93d99647fe83 Mon Sep 17 00:00:00 2001 +From: Marcel Groothuis <margro.xbmc@gmail.com> +Date: Sat, 12 Mar 2011 23:02:06 +0100 +Subject: [PATCH] ffmpeg: add missing check for NULL pointer Extends commit + 8ec66e240fe0a9f672d7ff1932022f22f8332ffb (fixed: playing + mpegts over rtsp caused ffmpeg to read uninitialized stack + values) + +--- + lib/ffmpeg/libavformat/utils.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/utils.c b/lib/ffmpeg/libavformat/utils.c +index bee0475..d3c11e2 100644 +--- a/lib/ffmpeg/libavformat/utils.c ++++ b/lib/ffmpeg/libavformat/utils.c +@@ -1092,7 +1092,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) + av_add_index_entry(st, pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME); + } + break; +- } else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) { ++ } else if (st->cur_len > 0 && st->cur_ptr && st->discard < AVDISCARD_ALL) { + len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, + st->cur_ptr, st->cur_len, + st->cur_pkt.pts, st->cur_pkt.dts, +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0065-changed-allow-yadif-deinterlacer-to-enable-and-disab.patch b/lib/ffmpeg/patches/0065-changed-allow-yadif-deinterlacer-to-enable-and-disab.patch new file mode 100644 index 0000000000..30b27f4e84 --- /dev/null +++ b/lib/ffmpeg/patches/0065-changed-allow-yadif-deinterlacer-to-enable-and-disab.patch @@ -0,0 +1,106 @@ +From c174f74181bcfa169aa8284f9524cd9db0f4cdda Mon Sep 17 00:00:00 2001 +From: elupus <elupus@xbmc.org> +Date: Fri, 24 Jun 2011 01:23:48 +0200 +Subject: [PATCH] changed: allow yadif deinterlacer to enable and disable + based on input interlaced flag + +--- + lib/ffmpeg/libavfilter/vf_yadif.c | 34 ++++++++++++++++++-- + .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 4 ++ + 2 files changed, 35 insertions(+), 3 deletions(-) + +diff --git a/lib/ffmpeg/libavfilter/vf_yadif.c b/lib/ffmpeg/libavfilter/vf_yadif.c +index bd0a9de..28b1d3e 100644 +--- a/lib/ffmpeg/libavfilter/vf_yadif.c ++++ b/lib/ffmpeg/libavfilter/vf_yadif.c +@@ -43,6 +43,13 @@ typedef struct { + int parity; + + int frame_pending; ++ int skip; ++ ++ /** ++ * 0: deinterlace all frames ++ * 1: only deinterlace frames marked as interlaced ++ */ ++ int auto_enable; + + AVFilterBufferRef *cur; + AVFilterBufferRef *next; +@@ -212,10 +219,21 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) + yadif->prev = yadif->cur; + yadif->cur = yadif->next; + yadif->next = picref; ++ yadif->skip = 0; + + if (!yadif->cur) + return; + ++ if (yadif->auto_enable && !yadif->cur->video->interlaced) { ++ yadif->out = yadif->cur; ++ avfilter_unref_buffer(yadif->prev); ++ yadif->cur = NULL; ++ yadif->prev = NULL; ++ yadif->skip = 1; ++ avfilter_start_frame(ctx->outputs[0], yadif->out); ++ return; ++ } ++ + if (!yadif->prev) + yadif->prev = avfilter_ref_buffer(yadif->cur, AV_PERM_READ); + +@@ -232,6 +250,12 @@ static void end_frame(AVFilterLink *link) + AVFilterContext *ctx = link->dst; + YADIFContext *yadif = ctx->priv; + ++ if (yadif->skip) { ++ avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1); ++ avfilter_end_frame(ctx->outputs[0]); ++ return; ++ } ++ + if (!yadif->out) + return; + +@@ -253,7 +277,7 @@ static int request_frame(AVFilterLink *link) + + if ((ret = avfilter_request_frame(link->src->inputs[0]))) + return ret; +- } while (!yadif->cur); ++ } while (!yadif->out); + + return 0; + } +@@ -275,6 +299,9 @@ static int poll_frame(AVFilterLink *link) + } + assert(yadif->next); + ++ if (yadif->skip) ++ return val; ++ + return val * ((yadif->mode&1)+1); + } + +@@ -307,8 +334,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) + + yadif->mode = 0; + yadif->parity = -1; ++ yadif->auto_enable = 0; + +- if (args) sscanf(args, "%d:%d", &yadif->mode, &yadif->parity); ++ if (args) sscanf(args, "%d:%d:%d", &yadif->mode, &yadif->parity, &yadif->auto_enable); + + yadif->filter_line = filter_line_c; + if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3) +@@ -318,7 +346,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) + else if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) + yadif->filter_line = ff_yadif_filter_line_mmx; + +- av_log(ctx, AV_LOG_INFO, "mode:%d parity:%d\n", yadif->mode, yadif->parity); ++ av_log(ctx, AV_LOG_INFO, "mode:%d parity:%d auto_enable:%d\n", yadif->mode, yadif->parity, yadif->auto_enable); + + return 0; + } +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0066-changed-updated-yadif-patch-to-same-as-will-be-appli.patch b/lib/ffmpeg/patches/0066-changed-updated-yadif-patch-to-same-as-will-be-appli.patch new file mode 100644 index 0000000000..e5c3113ed6 --- /dev/null +++ b/lib/ffmpeg/patches/0066-changed-updated-yadif-patch-to-same-as-will-be-appli.patch @@ -0,0 +1,82 @@ +From 91efb0af6f80d82b104a810a1ccdc0ae6702d022 Mon Sep 17 00:00:00 2001 +From: elupus <elupus@xbmc.org> +Date: Sun, 3 Jul 2011 17:06:42 +0200 +Subject: [PATCH] changed: updated yadif patch to same as will be applied + upstream + +--- + lib/ffmpeg/libavfilter/vf_yadif.c | 18 +++++++----------- + 1 files changed, 7 insertions(+), 11 deletions(-) + +diff --git a/lib/ffmpeg/libavfilter/vf_yadif.c b/lib/ffmpeg/libavfilter/vf_yadif.c +index 28b1d3e..d7bed90 100644 +--- a/lib/ffmpeg/libavfilter/vf_yadif.c ++++ b/lib/ffmpeg/libavfilter/vf_yadif.c +@@ -43,7 +43,6 @@ typedef struct { + int parity; + + int frame_pending; +- int skip; + + /** + * 0: deinterlace all frames +@@ -219,17 +218,14 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) + yadif->prev = yadif->cur; + yadif->cur = yadif->next; + yadif->next = picref; +- yadif->skip = 0; + + if (!yadif->cur) + return; + + if (yadif->auto_enable && !yadif->cur->video->interlaced) { +- yadif->out = yadif->cur; ++ yadif->out = avfilter_ref_buffer(yadif->cur, AV_PERM_READ); + avfilter_unref_buffer(yadif->prev); +- yadif->cur = NULL; + yadif->prev = NULL; +- yadif->skip = 1; + avfilter_start_frame(ctx->outputs[0], yadif->out); + return; + } +@@ -250,15 +246,15 @@ static void end_frame(AVFilterLink *link) + AVFilterContext *ctx = link->dst; + YADIFContext *yadif = ctx->priv; + +- if (yadif->skip) { ++ if (!yadif->out) ++ return; ++ ++ if (yadif->auto_enable && !yadif->cur->video->interlaced) { + avfilter_draw_slice(ctx->outputs[0], 0, link->h, 1); + avfilter_end_frame(ctx->outputs[0]); + return; + } + +- if (!yadif->out) +- return; +- + return_frame(ctx, 0); + } + +@@ -277,7 +273,7 @@ static int request_frame(AVFilterLink *link) + + if ((ret = avfilter_request_frame(link->src->inputs[0]))) + return ret; +- } while (!yadif->out); ++ } while (!yadif->cur); + + return 0; + } +@@ -299,7 +295,7 @@ static int poll_frame(AVFilterLink *link) + } + assert(yadif->next); + +- if (yadif->skip) ++ if (yadif->auto_enable && yadif->next && !yadif->next->video->interlaced) + return val; + + return val * ((yadif->mode&1)+1); +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0067-changed-updated-dxva-zigzag-workaround-for-ATI-based.patch b/lib/ffmpeg/patches/0067-changed-updated-dxva-zigzag-workaround-for-ATI-based.patch new file mode 100644 index 0000000000..8854f7a887 --- /dev/null +++ b/lib/ffmpeg/patches/0067-changed-updated-dxva-zigzag-workaround-for-ATI-based.patch @@ -0,0 +1,92 @@ +From 321c5e668f2c213a33cef6c7c9fe11ee2850665f Mon Sep 17 00:00:00 2001 +From: elupus <elupus@xbmc.org> +Date: Tue, 5 Jul 2011 00:14:52 +0200 +Subject: [PATCH] changed: updated dxva zigzag workaround for ATI based on + comments on xbmc.org and ffmpeg.org + +--- + lib/ffmpeg/libavcodec/avcodec.h | 1 - + lib/ffmpeg/libavcodec/dxva2.h | 2 ++ + lib/ffmpeg/libavcodec/dxva2_h264.c | 23 +++++++++++++---------- + xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp | 14 +++----------- + 4 files changed, 18 insertions(+), 22 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/avcodec.h b/lib/ffmpeg/libavcodec/avcodec.h +index cb96c6f..4745980 100644 +--- a/lib/ffmpeg/libavcodec/avcodec.h ++++ b/lib/ffmpeg/libavcodec/avcodec.h +@@ -1429,7 +1429,6 @@ typedef struct AVCodecContext { + #define FF_BUG_DC_CLIP 4096 + #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. + #define FF_BUG_TRUNCATED 16384 +-#define FF_BUG_DXVA2_SCALING_LIST_ZIGZAG 32768 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards + //#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%. + + /** +diff --git a/lib/ffmpeg/libavcodec/dxva2.h b/lib/ffmpeg/libavcodec/dxva2.h +index 5c5fe21..6eb494b 100644 +--- a/lib/ffmpeg/libavcodec/dxva2.h ++++ b/lib/ffmpeg/libavcodec/dxva2.h +@@ -27,6 +27,8 @@ + + #include <dxva2api.h> + ++#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards ++ + /** + * This structure is used to provides the necessary configurations and data + * to the DXVA2 FFmpeg HWAccel implementation. +diff --git a/lib/ffmpeg/libavcodec/dxva2_h264.c b/lib/ffmpeg/libavcodec/dxva2_h264.c +index 7b81c8e..4e3370c 100644 +--- a/lib/ffmpeg/libavcodec/dxva2_h264.c ++++ b/lib/ffmpeg/libavcodec/dxva2_h264.c +@@ -113,6 +113,9 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context + + pp->bit_depth_luma_minus8 = h->sps.bit_depth_luma - 8; + pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8; ++ if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) ++ pp->Reserved16Bits = 0; ++ else + pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */ + pp->StatusReportFeedbackNumber = 1 + ctx->report_id++; + pp->CurrFieldOrderCnt[0] = 0; +@@ -150,18 +153,18 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context + //pp->SliceGroupMap[810]; /* XXX not implemented by FFmpeg */ + } + +-static void fill_scaling_lists(AVCodecContext *avctx, const H264Context *h, DXVA_Qmatrix_H264 *qm) ++static void fill_scaling_lists(struct dxva_context *ctx, const H264Context *h, DXVA_Qmatrix_H264 *qm) + { + unsigned i, j; + memset(qm, 0, sizeof(*qm)); +- if (avctx->workaround_bugs & FF_BUG_DXVA2_SCALING_LIST_ZIGZAG) { // For old UVD/UVD+ ATI cards +- for (i = 0; i < 6; i++) +- for (j = 0; j < 16; j++) +- qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][j]; +- +- for (i = 0; i < 2; i++) +- for (j = 0; j < 64; j++) +- qm->bScalingLists8x8[i][j] = h->pps.scaling_matrix8[i][j]; ++ if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG) { ++ for (i = 0; i < 6; i++) ++ for (j = 0; j < 16; j++) ++ qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][j]; ++ ++ for (i = 0; i < 2; i++) ++ for (j = 0; j < 64; j++) ++ qm->bScalingLists8x8[i][j] = h->pps.scaling_matrix8[i][j]; + } else { + for (i = 0; i < 6; i++) + for (j = 0; j < 16; j++) +@@ -380,7 +383,7 @@ static int start_frame(AVCodecContext *avctx, + fill_picture_parameters(ctx, h, &ctx_pic->pp); + + /* Fill up DXVA_Qmatrix_H264 */ +- fill_scaling_lists(avctx, h, &ctx_pic->qm); ++ fill_scaling_lists(ctx, h, &ctx_pic->qm); + + ctx_pic->slice_count = 0; + ctx_pic->bitstream_size = 0; +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0068-fixed-yadif-should-copy-frame-properties-of-second-f.patch b/lib/ffmpeg/patches/0068-fixed-yadif-should-copy-frame-properties-of-second-f.patch new file mode 100644 index 0000000000..a5b3a7c6e0 --- /dev/null +++ b/lib/ffmpeg/patches/0068-fixed-yadif-should-copy-frame-properties-of-second-f.patch @@ -0,0 +1,31 @@ +From 793f3e0bfcaadaccd0b5db2a37a60da42a6b207e Mon Sep 17 00:00:00 2001 +From: elupus <elupus@xbmc.org> +Date: Thu, 14 Jul 2011 22:07:22 +0200 +Subject: [PATCH] fixed: yadif should copy frame properties of second frame as + well + +--- + lib/ffmpeg/libavfilter/vf_yadif.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/lib/ffmpeg/libavfilter/vf_yadif.c b/lib/ffmpeg/libavfilter/vf_yadif.c +index d7bed90..da91600 100644 +--- a/lib/ffmpeg/libavfilter/vf_yadif.c ++++ b/lib/ffmpeg/libavfilter/vf_yadif.c +@@ -182,9 +182,12 @@ static void return_frame(AVFilterContext *ctx, int is_second) + tff = yadif->parity^1; + } + +- if (is_second) ++ if (is_second) { + yadif->out = avfilter_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE | + AV_PERM_REUSE, link->w, link->h); ++ avfilter_copy_buffer_ref_props(yadif->out, yadif->cur); ++ yadif->out->video->interlaced = 0; ++ } + + filter(ctx, yadif->out, tff ^ !is_second, tff); + +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0069-ffmpeg-silence-compiler-warnings.patch b/lib/ffmpeg/patches/0069-ffmpeg-silence-compiler-warnings.patch new file mode 100644 index 0000000000..1ee77d7c3c --- /dev/null +++ b/lib/ffmpeg/patches/0069-ffmpeg-silence-compiler-warnings.patch @@ -0,0 +1,24 @@ +From 5542a0c7e68d123b86f168ace00f7320b294fc39 Mon Sep 17 00:00:00 2001 +From: davilla <davilla@4pi.com> +Date: Wed, 7 Sep 2011 00:14:34 -0400 +Subject: [PATCH] [ffmpeg] silence compiler warnings + +--- + lib/ffmpeg/libavfilter/avfilter.h | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/lib/ffmpeg/libavfilter/avfilter.h b/lib/ffmpeg/libavfilter/avfilter.h +index ad8b1e5..daf43dc 100644 +--- a/lib/ffmpeg/libavfilter/avfilter.h ++++ b/lib/ffmpeg/libavfilter/avfilter.h +@@ -159,6 +159,7 @@ static inline void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilt + switch (src->type) { + case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break; + case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break; ++ default: break; + } + } + +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0070-matroskadec-use-correct-compression-parameters-for-c.patch b/lib/ffmpeg/patches/0070-matroskadec-use-correct-compression-parameters-for-c.patch new file mode 100644 index 0000000000..6042ffa747 --- /dev/null +++ b/lib/ffmpeg/patches/0070-matroskadec-use-correct-compression-parameters-for-c.patch @@ -0,0 +1,33 @@ +From 8efe4d01dcd2f89ad012b8f1dd71192e09fa3e82 Mon Sep 17 00:00:00 2001 +From: CrystalP <CrystalP@xbmc.org> +Date: Sun, 16 Oct 2011 03:16:26 -0400 +Subject: [PATCH] matroskadec: use correct compression parameters for current + track CodecPrivate + +backport of ffmpeg dc6c36ce46d4c4d7cb63503afc2ee44f00bf3725 on 2011-08-17 + +fixes a bitmap sub color problem exposed by mkclean --optimize foo.mkv. +The compressed private data could not be extracted, resulting in a bad color +palette and wrong colors on screen. + +problem described in forum thread http://forum.xbmc.org/showthread.php?t=108942 +--- + lib/ffmpeg/libavformat/matroskadec.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/matroskadec.c b/lib/ffmpeg/libavformat/matroskadec.c +index 1a87f4a..14b96d4 100644 +--- a/lib/ffmpeg/libavformat/matroskadec.c ++++ b/lib/ffmpeg/libavformat/matroskadec.c +@@ -1220,7 +1220,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) + for (i=0; i < matroska->tracks.nb_elem; i++) { + MatroskaTrack *track = &tracks[i]; + enum CodecID codec_id = CODEC_ID_NONE; +- EbmlList *encodings_list = &tracks->encodings; ++ EbmlList *encodings_list = &track->encodings; + MatroskaTrackEncoding *encodings = encodings_list->elem; + uint8_t *extradata = NULL; + int extradata_size = 0; +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0071-fixed-Typo.patch b/lib/ffmpeg/patches/0071-fixed-Typo.patch new file mode 100644 index 0000000000..dcb5eda006 --- /dev/null +++ b/lib/ffmpeg/patches/0071-fixed-Typo.patch @@ -0,0 +1,25 @@ +From dc0509f7a6341a72ca4399fee37e30c91fddc222 Mon Sep 17 00:00:00 2001 +From: arnova <nospam@void.org> +Date: Tue, 8 Nov 2011 08:35:59 +0100 +Subject: [PATCH] fixed: Typo + +--- + lib/ffmpeg/libavformat/mmsh.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/mmsh.c b/lib/ffmpeg/libavformat/mmsh.c +index 3ae886f..cc6efa3 100644 +--- a/lib/ffmpeg/libavformat/mmsh.c ++++ b/lib/ffmpeg/libavformat/mmsh.c +@@ -284,7 +284,7 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim + CLIENTGUID + "Pragma: stream-switch-count=%d\r\n" + "Pragma: stream-switch-entry=%s\r\n" +- "Pragma: no-cache,rate)1.000000,stream-time=%u" ++ "Pragma: no-cache,rate=1.000000,stream-time=%u" + "Connection: Close\r\n\r\n", + host, port, mmsh->request_seq++, mms->stream_num, stream_selection, timestamp); + av_freep(&stream_selection); +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0072-h264-Use-mismatching-frame-numbers-in-fields-to-sync.patch b/lib/ffmpeg/patches/0072-h264-Use-mismatching-frame-numbers-in-fields-to-sync.patch new file mode 100644 index 0000000000..a05dfff960 --- /dev/null +++ b/lib/ffmpeg/patches/0072-h264-Use-mismatching-frame-numbers-in-fields-to-sync.patch @@ -0,0 +1,33 @@ +From 2ac62404c2f833d5aa64947819538ac354966ef0 Mon Sep 17 00:00:00 2001 +From: Michael Niedermayer <michaelni@gmx.at> +Date: Sat, 12 Nov 2011 21:10:15 +0100 +Subject: [PATCH] h264: Use mismatching frame numbers in fields to synchronize + the first/second field state independant of them being + reference or not. Fixes Ticket354 + +Signed-off-by: Michael Niedermayer <michaelni@gmx.at> +--- + lib/ffmpeg/libavcodec/h264.c | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c +index 47b0073..87ec292 100644 +--- a/lib/ffmpeg/libavcodec/h264.c ++++ b/lib/ffmpeg/libavcodec/h264.c +@@ -1936,11 +1936,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ + s0->first_field = FIELD_PICTURE; + + } else { +- if (h->nal_ref_idc && +- s0->current_picture_ptr->reference && +- s0->current_picture_ptr->frame_num != h->frame_num) { ++ if (s0->current_picture_ptr->frame_num != h->frame_num) { + /* +- * This and previous field were reference, but had ++ * This and previous field had + * different frame_nums. Consider this field first in + * pair. Throw away previous field except for reference + * purposes. +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0073-Don-t-fill-in-frame-gaps-with-copied-refs-after-flus.patch b/lib/ffmpeg/patches/0073-Don-t-fill-in-frame-gaps-with-copied-refs-after-flus.patch new file mode 100644 index 0000000000..d919336d67 --- /dev/null +++ b/lib/ffmpeg/patches/0073-Don-t-fill-in-frame-gaps-with-copied-refs-after-flus.patch @@ -0,0 +1,36 @@ +From 46d99a89aa16db1981441bf7103a30e7d28e5e26 Mon Sep 17 00:00:00 2001 +From: Joakim Plate <elupus@ecce.se> +Date: Fri, 18 Nov 2011 20:36:13 +0100 +Subject: [PATCH] Don't fill in frame gaps with copied refs after flush + +The filled in refs cause corruptions in the video frame +for a long time after it should have recovered. +--- + lib/ffmpeg/libavcodec/h264.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c +index 87ec292..0e002ce 100644 +--- a/lib/ffmpeg/libavcodec/h264.c ++++ b/lib/ffmpeg/libavcodec/h264.c +@@ -1464,7 +1464,7 @@ static void implicit_weight_table(H264Context *h, int field){ + */ + static void idr(H264Context *h){ + ff_h264_remove_all_refs(h); +- h->prev_frame_num= 0; ++ h->prev_frame_num= -1; + h->prev_frame_num_offset= 0; + h->prev_poc_msb= + h->prev_poc_lsb= 0; +@@ -1892,7 +1892,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ + h->mb_field_decoding_flag= s->picture_structure != PICT_FRAME; + + if(h0->current_slice == 0){ +- while(h->frame_num != h->prev_frame_num && ++ while(h->frame_num != h->prev_frame_num && h->prev_frame_num >= 0 && + h->frame_num != (h->prev_frame_num+1)%(1<<h->sps.log2_max_frame_num)){ + Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL; + av_log(h->s.avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num); +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0074-vaapi-do-not-assert-on-value-read-from-input-bitstre.patch b/lib/ffmpeg/patches/0074-vaapi-do-not-assert-on-value-read-from-input-bitstre.patch new file mode 100644 index 0000000000..d7b2285a24 --- /dev/null +++ b/lib/ffmpeg/patches/0074-vaapi-do-not-assert-on-value-read-from-input-bitstre.patch @@ -0,0 +1,41 @@ +From 425b9a373384813d2fe513d42b1d585ecbea6ca5 Mon Sep 17 00:00:00 2001 +From: Diego Biurrun <diego@biurrun.de> +Date: Fri, 15 Jul 2011 01:06:16 +0200 +Subject: [PATCH] vaapi: do not assert on value read from input bitstream + +User-provided data should never trigger an assert; return error instead. +Also fix an instance of get_bits where get_bits_long should have been used. + +This eliminates the following warning: +libavcodec/vaapi_mpeg2.c:112:14: warning: variable 'start_code' set but not used + +Signed-off-by: elupus <elupus@xbmc.org> +--- + lib/ffmpeg/libavcodec/vaapi_mpeg2.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/vaapi_mpeg2.c b/lib/ffmpeg/libavcodec/vaapi_mpeg2.c +index 17d82b7..8d456ba 100644 +--- a/lib/ffmpeg/libavcodec/vaapi_mpeg2.c ++++ b/lib/ffmpeg/libavcodec/vaapi_mpeg2.c +@@ -109,14 +109,14 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer + MpegEncContext * const s = avctx->priv_data; + VASliceParameterBufferMPEG2 *slice_param; + GetBitContext gb; +- uint32_t start_code, quantiser_scale_code, intra_slice_flag, macroblock_offset; ++ uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset; + + av_dlog(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size); + + /* Determine macroblock_offset */ + init_get_bits(&gb, buffer, 8 * size); +- start_code = get_bits(&gb, 32); +- assert((start_code & 0xffffff00) == 0x00000100); ++ if (get_bits_long(&gb, 32) >> 8 != 1) /* start code */ ++ return AVERROR_INVALIDDATA; + quantiser_scale_code = get_bits(&gb, 5); + intra_slice_flag = get_bits1(&gb); + if (intra_slice_flag) { +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0075-fixed-playback-from-mmst-urls-would-halt-after-some-.patch b/lib/ffmpeg/patches/0075-fixed-playback-from-mmst-urls-would-halt-after-some-.patch new file mode 100644 index 0000000000..cd5412bbd2 --- /dev/null +++ b/lib/ffmpeg/patches/0075-fixed-playback-from-mmst-urls-would-halt-after-some-.patch @@ -0,0 +1,30 @@ +From 919a875b4bc4ea2a8ddc0aab98ea74c6475f9525 Mon Sep 17 00:00:00 2001 +From: spiff <spiff@xbmc.org> +Date: Tue, 17 Jan 2012 22:47:36 +0100 +Subject: [PATCH] fixed: playback from mmst:// urls would halt after some + time. + +this backports upstream 275189a2bd71cf49d66374c44d3de2262d323460 + +thanks to johoja for doing the ground work +--- + lib/ffmpeg/libavformat/mmst.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/lib/ffmpeg/libavformat/mmst.c b/lib/ffmpeg/libavformat/mmst.c +index 8464d3b..385f017 100644 +--- a/lib/ffmpeg/libavformat/mmst.c ++++ b/lib/ffmpeg/libavformat/mmst.c +@@ -290,8 +290,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst) + return read_result < 0 ? read_result : AVERROR_IO; + } + packet_type= AV_RL16(mms->in_buffer+36); +- hr = AV_RL32(mms->in_buffer + 40); +- if (hr) { ++ if (read_result >= 44 && (hr = AV_RL32(mms->in_buffer + 40))) { + av_log(NULL, AV_LOG_ERROR, + "Server sent an error status code: 0x%08x\n", hr); + return AVERROR_UNKNOWN; +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0076-Fix-dvb-subtitle-decoding-when-display-segment-is-mi.patch b/lib/ffmpeg/patches/0076-Fix-dvb-subtitle-decoding-when-display-segment-is-mi.patch new file mode 100644 index 0000000000..dbeca1af85 --- /dev/null +++ b/lib/ffmpeg/patches/0076-Fix-dvb-subtitle-decoding-when-display-segment-is-mi.patch @@ -0,0 +1,63 @@ +From 6373f33e5b12eb06e37d670c9bba4e7041cded79 Mon Sep 17 00:00:00 2001 +From: Paul Kendall <paul@kcbbs.gen.nz> +Date: Sun, 29 Jan 2012 14:50:19 +0100 +Subject: [PATCH] Fix dvb subtitle decoding when display segment is missing. + +closes ticket #8504 +--- + lib/ffmpeg/libavcodec/dvbsubdec.c | 10 ++++++++++ + 1 files changed, 10 insertions(+), 0 deletions(-) + +diff --git a/lib/ffmpeg/libavcodec/dvbsubdec.c b/lib/ffmpeg/libavcodec/dvbsubdec.c +index 7c37915..e8ef8ce 100644 +--- a/lib/ffmpeg/libavcodec/dvbsubdec.c ++++ b/lib/ffmpeg/libavcodec/dvbsubdec.c +@@ -1409,6 +1409,7 @@ static int dvbsub_decode(AVCodecContext *avctx, + int segment_type; + int page_id; + int segment_length; ++ int got_segment = 0; + + #ifdef DEBUG_PACKET_CONTENTS + int i; +@@ -1445,21 +1446,26 @@ static int dvbsub_decode(AVCodecContext *avctx, + switch (segment_type) { + case DVBSUB_PAGE_SEGMENT: + dvbsub_parse_page_segment(avctx, p, segment_length); ++ got_segment |= 1; + break; + case DVBSUB_REGION_SEGMENT: + dvbsub_parse_region_segment(avctx, p, segment_length); ++ got_segment |= 2; + break; + case DVBSUB_CLUT_SEGMENT: + dvbsub_parse_clut_segment(avctx, p, segment_length); ++ got_segment |= 4; + break; + case DVBSUB_OBJECT_SEGMENT: + dvbsub_parse_object_segment(avctx, p, segment_length); ++ got_segment |= 8; + break; + case DVBSUB_DISPLAYDEFINITION_SEGMENT: + dvbsub_parse_display_definition_segment(avctx, p, segment_length); + break; + case DVBSUB_DISPLAY_SEGMENT: + *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub); ++ got_segment |= 16; + break; + default: + av_dlog(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n", +@@ -1470,6 +1476,10 @@ static int dvbsub_decode(AVCodecContext *avctx, + + p += segment_length; + } ++ // Some streams do not send a display segment but if we have all the other ++ // segments then we need no further data. ++ if (got_segment == 15 && sub) ++ *data_size = dvbsub_display_end_segment(avctx, p, 0, sub); + + if (p != p_end) { + av_dlog(avctx, "Junk at end of packet\n"); +-- +1.7.7.2 + diff --git a/lib/ffmpeg/patches/0077-Change-yadif-to-not-use-out-of-picture-lines.-Fixes-.patch b/lib/ffmpeg/patches/0077-Change-yadif-to-not-use-out-of-picture-lines.-Fixes-.patch new file mode 100644 index 0000000000..d7d4ec9f8c --- /dev/null +++ b/lib/ffmpeg/patches/0077-Change-yadif-to-not-use-out-of-picture-lines.-Fixes-.patch @@ -0,0 +1,133 @@ +From 42bedafe92b2921ec63024a825d4297ba39888e9 Mon Sep 17 00:00:00 2001 +From: Michael Niedermayer <michaelni@gmx.at> +Date: Fri, 18 Feb 2011 19:10:33 +0100 +Subject: [PATCH] Change yadif to not use out of picture lines. Fixes + issue2272. + +Signed-off-by: Michael Niedermayer <michaelni@gmx.at> +--- + lib/ffmpeg/libavfilter/vf_yadif.c | 31 ++++++++++++++------------- + lib/ffmpeg/libavfilter/x86/yadif_template.c | 6 ++-- + lib/ffmpeg/libavfilter/yadif.h | 6 ++-- + 3 files changed, 22 insertions(+), 21 deletions(-) + +diff --git a/lib/ffmpeg/libavfilter/vf_yadif.c b/lib/ffmpeg/libavfilter/vf_yadif.c +index da91600..1ed8807 100644 +--- a/lib/ffmpeg/libavfilter/vf_yadif.c ++++ b/lib/ffmpeg/libavfilter/vf_yadif.c +@@ -56,42 +56,42 @@ typedef struct { + AVFilterBufferRef *out; + void (*filter_line)(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, +- int w, int refs, int parity, int mode); ++ int w, int prefs, int mrefs, int parity, int mode); + } YADIFContext; + + static void filter_line_c(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, +- int w, int refs, int parity, int mode) ++ int w, int prefs, int mrefs, int parity, int mode) + { + int x; + uint8_t *prev2 = parity ? prev : cur ; + uint8_t *next2 = parity ? cur : next; + for (x = 0; x < w; x++) { +- int c = cur[-refs]; ++ int c = cur[mrefs]; + int d = (prev2[0] + next2[0])>>1; +- int e = cur[+refs]; ++ int e = cur[prefs]; + int temporal_diff0 = FFABS(prev2[0] - next2[0]); +- int temporal_diff1 =(FFABS(prev[-refs] - c) + FFABS(prev[+refs] - e) )>>1; +- int temporal_diff2 =(FFABS(next[-refs] - c) + FFABS(next[+refs] - e) )>>1; ++ int temporal_diff1 =(FFABS(prev[mrefs] - c) + FFABS(prev[prefs] - e) )>>1; ++ int temporal_diff2 =(FFABS(next[mrefs] - c) + FFABS(next[prefs] - e) )>>1; + int diff = FFMAX3(temporal_diff0>>1, temporal_diff1, temporal_diff2); + int spatial_pred = (c+e)>>1; +- int spatial_score = FFABS(cur[-refs-1] - cur[+refs-1]) + FFABS(c-e) +- + FFABS(cur[-refs+1] - cur[+refs+1]) - 1; ++ int spatial_score = FFABS(cur[mrefs-1] - cur[prefs-1]) + FFABS(c-e) ++ + FFABS(cur[mrefs+1] - cur[prefs+1]) - 1; + + #define CHECK(j)\ +- { int score = FFABS(cur[-refs-1+j] - cur[+refs-1-j])\ +- + FFABS(cur[-refs +j] - cur[+refs -j])\ +- + FFABS(cur[-refs+1+j] - cur[+refs+1-j]);\ ++ { int score = FFABS(cur[mrefs-1+j] - cur[prefs-1-j])\ ++ + FFABS(cur[mrefs +j] - cur[prefs -j])\ ++ + FFABS(cur[mrefs+1+j] - cur[prefs+1-j]);\ + if (score < spatial_score) {\ + spatial_score= score;\ +- spatial_pred= (cur[-refs +j] + cur[+refs -j])>>1;\ ++ spatial_pred= (cur[mrefs +j] + cur[prefs -j])>>1;\ + + CHECK(-1) CHECK(-2) }} }} + CHECK( 1) CHECK( 2) }} }} + + if (mode < 2) { +- int b = (prev2[-2*refs] + next2[-2*refs])>>1; +- int f = (prev2[+2*refs] + next2[+2*refs])>>1; ++ int b = (prev2[2*mrefs] + next2[2*mrefs])>>1; ++ int f = (prev2[2*prefs] + next2[2*prefs])>>1; + #if 0 + int a = cur[-3*refs]; + int g = cur[+3*refs]; +@@ -139,7 +139,8 @@ static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic, + uint8_t *cur = &yadif->cur ->data[i][y*refs]; + uint8_t *next = &yadif->next->data[i][y*refs]; + uint8_t *dst = &dstpic->data[i][y*dstpic->linesize[i]]; +- yadif->filter_line(dst, prev, cur, next, w, refs, parity ^ tff, yadif->mode); ++ int mode = y==1 || y+2==h ? 2 : yadif->mode; ++ yadif->filter_line(dst, prev, cur, next, w, y+1<h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode); + } else { + memcpy(&dstpic->data[i][y*dstpic->linesize[i]], + &yadif->cur->data[i][y*refs], w); +diff --git a/lib/ffmpeg/libavfilter/x86/yadif_template.c b/lib/ffmpeg/libavfilter/x86/yadif_template.c +index 3e520cb..50ea843 100644 +--- a/lib/ffmpeg/libavfilter/x86/yadif_template.c ++++ b/lib/ffmpeg/libavfilter/x86/yadif_template.c +@@ -105,7 +105,7 @@ + + void RENAME(ff_yadif_filter_line)(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, +- int w, int refs, int parity, int mode) ++ int w, int prefs, int mrefs, int parity, int mode) + { + DECLARE_ALIGNED(16, uint8_t, tmp0[16]); + DECLARE_ALIGNED(16, uint8_t, tmp1[16]); +@@ -226,8 +226,8 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, + :[prev] "r"(prev),\ + [cur] "r"(cur),\ + [next] "r"(next),\ +- [prefs]"r"((x86_reg)refs),\ +- [mrefs]"r"((x86_reg)-refs),\ ++ [prefs]"r"((x86_reg)prefs),\ ++ [mrefs]"r"((x86_reg)mrefs),\ + [mode] "g"(mode)\ + );\ + __asm__ volatile(MOV" "MM"1, %0" :"=m"(*dst));\ +diff --git a/lib/ffmpeg/libavfilter/yadif.h b/lib/ffmpeg/libavfilter/yadif.h +index 072812c..ff574da 100644 +--- a/lib/ffmpeg/libavfilter/yadif.h ++++ b/lib/ffmpeg/libavfilter/yadif.h +@@ -23,14 +23,14 @@ + + void ff_yadif_filter_line_mmx(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, +- int w, int refs, int parity, int mode); ++ int w, int prefs, int mrefs, int parity, int mode); + + void ff_yadif_filter_line_sse2(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, +- int w, int refs, int parity, int mode); ++ int w, int prefs, int mrefs, int parity, int mode); + + void ff_yadif_filter_line_ssse3(uint8_t *dst, + uint8_t *prev, uint8_t *cur, uint8_t *next, +- int w, int refs, int parity, int mode); ++ int w, int prefs, int mrefs, int parity, int mode); + + #endif /* AVFILTER_YADIF_H */ +-- +1.7.7.2 + |