---
libavcodec/framethread.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libavcodec/framethread.c b/libavcodec/framethread.c
index 03a89b2..a4bbad4 100644
--- a/libavcodec/framethread.c
+++ b/libavcodec/framethread.c
@@ -186,6 +186,8 @@ void ff_report_decode_progress(AVFrame *f, int n)
PerThreadContext *p = f->avctx->thread_opaque;
int *progress = f->thread_opaque;
+ if (*progress >= n) return;
+
if (!USE_FRAME_THREADING(f->avctx)) {*progress = n; return;}
pthread_mutex_lock(&p->progress_mutex);
@@ -360,12 +362,14 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *f)
f->avctx = avctx;
f->thread_opaque = progress = av_malloc(sizeof(int));
- *progress = -1;
if (!USE_FRAME_THREADING(avctx)) {
+ *progress = INT_MAX;
return avctx->get_buffer(avctx, f);
}
+ *progress = -1;
+
pthread_mutex_lock(&p->buffer_mutex);
ret = avctx->get_buffer(avctx, f);
pthread_mutex_unlock(&p->buffer_mutex);
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc