On Wed, Dec 02, 2015 at 04:59:15PM +0100, Nicolas George wrote: [...] > > + av_fifo_generic_peek_at(mq->fifo, mq->tmp_msg, off, > > mq->elsize, NULL); > > + mq->free_func(mq->tmp_msg); > > Could this use av_fifo_generic_peek() to avoid the ugly extra allocation? >
What would be the difference? both av_fifo_generic_peek and av_fifo_generic_peek_at require a copy of the element in a destination buffer, unless I'm missing something. > > + } > > + } > > + av_fifo_drain(mq->fifo, used); > > + pthread_cond_broadcast(&mq->cond); > > + pthread_mutex_unlock(&mq->lock); > > +#endif /* HAVE_THREADS */ > > +} > > diff --git a/libavutil/threadmessage.h b/libavutil/threadmessage.h > > index a8481d8..c59cb06 100644 > > --- a/libavutil/threadmessage.h > > +++ b/libavutil/threadmessage.h > > @@ -88,4 +88,16 @@ void > > av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq, > > void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq, > > int err); > > > > +/** > > + * Set the optional free message callback function which will be called if > > an > > + * operation is removing messages from the queue. > > + */ > > +int av_thread_message_queue_set_free_func(AVThreadMessageQueue *mq, > > + void (*free_func)(void *msg)); > > + > > +/** > > > + * Flush the message queue > > I will not block for that, but I am still not satisfied with the > explanations, and therefore I find this documentation insufficient. Maybe > wait for other advice? > Sure, no problem. -- Clément B.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel