Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(917)

Unified Diff: patches/to_upstream/17_mpegthread.patch

Issue 4533003: patched ffmpeg nov 2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: patches/to_upstream/17_mpegthread.patch
===================================================================
--- patches/to_upstream/17_mpegthread.patch (revision 0)
+++ patches/to_upstream/17_mpegthread.patch (revision 0)
@@ -0,0 +1,25 @@
+diff -wurp -N orig/libavcodec/mpegvideo.c ffmpeg-mt/libavcodec/mpegvideo.c
+--- orig/libavcodec/mpegvideo.c 2010-11-04 08:11:14 -0700
++++ ffmpeg-mt/libavcodec/mpegvideo.c 2010-11-04 08:11:24 -0700
+@@ -584,8 +584,7 @@ av_cold int MPV_common_init(MpegEncConte
+ return -1;
+ }
+
+- if(s->avctx->active_thread_type&FF_THREAD_SLICE &&
+- (s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height))){
++ if(s->avctx->thread_count > MAX_THREADS){
+ av_log(s->avctx, AV_LOG_ERROR, "too many threads\n");
+ return -1;
+ }
+@@ -745,6 +744,11 @@ av_cold int MPV_common_init(MpegEncConte
+ if (HAVE_THREADS && s->avctx->active_thread_type&FF_THREAD_SLICE) {
+ threads = s->avctx->thread_count;
+
++ if (s->avctx->thread_count > s->mb_height && s->mb_height) {
++ av_log(s->avctx, AV_LOG_WARNING, "Reducing from %d to %d threads due to height of %d pixels.\n", s->avctx->thread_count, s->mb_height, s->height);
++ threads = s->mb_height;
++ }
++
+ for(i=1; i<threads; i++){
+ s->thread_context[i]= av_malloc(sizeof(MpegEncContext));
+ memcpy(s->thread_context[i], s, sizeof(MpegEncContext));

Powered by Google App Engine
This is Rietveld 408576698