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

Side by Side Diff: source/patched-ffmpeg-mt/libavcodec/pthread.c

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 Roman Shaposhnik 2 * Copyright (c) 2004 Roman Shaposhnik
3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com) 3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com)
4 * 4 *
5 * Many thanks to Steven M. Schultz for providing clever ideas and 5 * Many thanks to Steven M. Schultz for providing clever ideas and
6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial 6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial
7 * implementation. 7 * implementation.
8 * 8 *
9 * This file is part of FFmpeg. 9 * This file is part of FFmpeg.
10 * 10 *
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 avctx->active_thread_type = FF_THREAD_SLICE; 771 avctx->active_thread_type = FF_THREAD_SLICE;
772 } 772 }
773 773
774 int avcodec_thread_init(AVCodecContext *avctx, int thread_count) 774 int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
775 { 775 {
776 if (avctx->thread_opaque) { 776 if (avctx->thread_opaque) {
777 av_log(avctx, AV_LOG_ERROR, "avcodec_thread_init called after avcodec_op en, this does nothing in ffmpeg-mt\n"); 777 av_log(avctx, AV_LOG_ERROR, "avcodec_thread_init called after avcodec_op en, this does nothing in ffmpeg-mt\n");
778 return -1; 778 return -1;
779 } 779 }
780 780
781 avctx->thread_count = thread_count; 781 avctx->thread_count = FFMAX(1, thread_count);
782 782
783 if (avctx->codec) { 783 if (avctx->codec) {
784 validate_thread_parameters(avctx); 784 validate_thread_parameters(avctx);
785 785
786 if (avctx->active_thread_type&FF_THREAD_SLICE) 786 if (avctx->active_thread_type&FF_THREAD_SLICE)
787 return thread_init(avctx); 787 return thread_init(avctx);
788 else if (avctx->active_thread_type&FF_THREAD_FRAME) 788 else if (avctx->active_thread_type&FF_THREAD_FRAME)
789 return frame_thread_init(avctx); 789 return frame_thread_init(avctx);
790 } 790 }
791 791
792 return 0; 792 return 0;
793 } 793 }
794 794
795 void avcodec_thread_free(AVCodecContext *avctx) 795 void avcodec_thread_free(AVCodecContext *avctx)
796 { 796 {
797 if (avctx->active_thread_type&FF_THREAD_FRAME) 797 if (avctx->active_thread_type&FF_THREAD_FRAME)
798 frame_thread_free(avctx, avctx->thread_count); 798 frame_thread_free(avctx, avctx->thread_count);
799 else 799 else
800 thread_free(avctx); 800 thread_free(avctx);
801 } 801 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698