On Thu, Mar 22, 2012 at 09:56:00AM -0700, Aaron Colwell wrote:
> [...]
Some general comments since this is your first patch submission.
> --- a/libavcodec/pthread.c
> +++ b/libavcodec/pthread.c
> @@ -351,6 +351,19 @@ static int thread_init(AVCodecContext *avctx)
>
> +static void thread_finish_setup_locked(AVCodecContext *avctx) {
{ on the next line for function declarations
> + PerThreadContext *p = avctx->thread_opaque;
> +
> + if (!(avctx->active_thread_type&FF_THREAD_FRAME)) return;
> +
> + if(p->state == STATE_SETUP_FINISHED){
> + av_log(avctx, AV_LOG_WARNING, "Multiple ff_thread_finish_setup()
> calls\n");
> + }
We use K&R style: space after keyword, space between ) and {, move
statements after if to the next line, drop {} for one-line blocks.
> @@ -368,8 +381,13 @@ static attribute_align_arg void
> *frame_worker_thread(void *arg)
> pthread_mutex_lock(&p->mutex);
> while (1) {
> int i;
> - while (p->state == STATE_INPUT_READY && !fctx->die)
> - pthread_cond_wait(&p->input_cond, &p->mutex);
> + pthread_mutex_lock(&p->progress_mutex);
> + while (p->state == STATE_INPUT_READY && !fctx->die) {
> + pthread_mutex_unlock(&p->progress_mutex);
> + pthread_cond_wait(&p->input_cond, &p->mutex);
> + pthread_mutex_lock(&p->progress_mutex);
Indentation is four spaces.
> @@ -575,8 +593,9 @@ static int submit_packet(PerThreadContext *p, AVPacket
> *avpkt)
>
> if (!p->avctx->thread_safe_callbacks &&
> p->avctx->get_buffer != avcodec_default_get_buffer) {
> - while (p->state != STATE_SETUP_FINISHED && p->state !=
> STATE_INPUT_READY) {
> - pthread_mutex_lock(&p->progress_mutex);
> + pthread_mutex_lock(&p->progress_mutex);
> +
> + while (p->state != STATE_SETUP_FINISHED && p->state !=
> STATE_INPUT_READY) {
> while (p->state == STATE_SETTING_UP)
> pthread_cond_wait(&p->progress_cond, &p->progress_mutex);
same
Your mailer mangles linebreaks, get something else or attach patches or,
better yet, use git-send-email.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel