---
libavcodec/pthread.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index f142796..25f308b 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -70,8 +70,8 @@ typedef struct PerThreadContext {
enum {
STATE_INPUT_READY, ///< Set when the thread is sleeping.
- STATE_PREDECODING, ///< Set before the codec has called ff_report_frame_setup_done().
- STATE_DECODING /**<
+ STATE_SETTING_UP, ///< Set before the codec has called ff_report_frame_setup_done().
+ STATE_SETUP_FINISHED /**<
* Set after the codec has called ff_report_frame_setup_done().
* At this point it is safe to start the next thread.
*/
@@ -234,7 +234,7 @@ static int thread_init(AVCodecContext *avctx, int thread_count)
* doesn't define update_context(). To simplify codecs and avoid deadlock
* bugs, progress is set to INT_MAX on all returned frames.
*/
-static attribute_align_arg void *decode_frame_thread(void *arg)
+static attribute_align_arg void *frame_worker_thread(void *arg)
{
PerThreadContext * volatile p = arg;
AVCodecContext *avctx = p->avctx;
@@ -254,7 +254,7 @@ static attribute_align_arg void *decode_frame_thread(void *arg)
pthread_mutex_lock(&p->mutex);
p->result = codec->decode(avctx, &p->picture, &p->got_picture, p->buf, p->buf_size);
- if (p->state == STATE_PREDECODING) ff_report_frame_setup_done(avctx);
+ if (p->state == STATE_SETTING_UP) ff_report_frame_setup_done(avctx);
if (p->got_picture) {
ff_report_field_progress(&p->picture, INT_MAX, 0);
ff_report_field_progress(&p->picture, INT_MAX, 1);
@@ -317,7 +317,7 @@ static int frame_thread_init(AVCodecContext *avctx)
if (err) goto error;
- pthread_create(&p->thread, NULL, decode_frame_thread, p);
+ pthread_create(&p->thread, NULL, frame_worker_thread, p);
}
return 0;
@@ -411,7 +411,7 @@ static int submit_frame(PerThreadContext * volatile p, const uint8_t *buf, int b
pthread_mutex_lock(&p->mutex);
if (prev_thread) {
pthread_mutex_lock(&prev_thread->progress_mutex);
- while (prev_thread->state == STATE_PREDECODING)
+ while (prev_thread->state == STATE_SETTING_UP)
pthread_cond_wait(&prev_thread->progress_cond, &prev_thread->progress_mutex);
pthread_mutex_unlock(&prev_thread->progress_mutex);
@@ -427,7 +427,7 @@ static int submit_frame(PerThreadContext * volatile p, const uint8_t *buf, int b
handle_delayed_releases(p);
- p->state = STATE_PREDECODING;
+ p->state = STATE_SETTING_UP;
pthread_cond_signal(&p->input_cond);
pthread_mutex_unlock(&p->mutex);
@@ -532,13 +532,13 @@ void ff_report_frame_setup_done(AVCodecContext *avctx) {
if (!USE_FRAME_THREADING(avctx)) return;
pthread_mutex_lock(&p->progress_mutex);
- p->state = STATE_DECODING;
+ p->state = STATE_SETUP_FINISHED;
pthread_cond_broadcast(&p->progress_cond);
pthread_mutex_unlock(&p->progress_mutex);
}
/// Wait for all threads to finish decoding
-static void park_frame_decode_threads(FrameThreadContext *fctx, int thread_count)
+static void park_frame_worker_threads(FrameThreadContext *fctx, int thread_count)
{
int i;
@@ -558,7 +558,7 @@ static void frame_thread_free(AVCodecContext *avctx)
AVCodec *codec = avctx->codec;
int i;
- park_frame_decode_threads(fctx, avctx->thread_count);
+ park_frame_worker_threads(fctx, avctx->thread_count);
if (fctx->prev_thread != fctx->threads)
update_context_from_copy(fctx->threads->avctx, fctx->prev_thread->avctx, 0);
@@ -608,7 +608,7 @@ void ff_frame_thread_flush(AVCodecContext *avctx)
{
FrameThreadContext *fctx = avctx->thread_opaque;
- park_frame_decode_threads(fctx, avctx->thread_count);
+ park_frame_worker_threads(fctx, avctx->thread_count);
if (fctx->prev_thread != fctx->threads)
update_context_from_copy(fctx->threads->avctx, fctx->prev_thread->avctx, 0);
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc