On Fri, Sep 22, 2017 at 12:36:40AM +0900, Takayuki 'January June' Suwa wrote: > --- > doc/protocols.texi | 6 ++++++ > libavformat/async.c | 7 ++++++- > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/doc/protocols.texi b/doc/protocols.texi > index a7968ff56e3..f321664d7bf 100644 > --- a/doc/protocols.texi > +++ b/doc/protocols.texi > @@ -57,6 +57,12 @@ Asynchronous data filling wrapper for input stream. > > Fill data in a background thread, to decouple I/O operation from demux > thread. > > +The accepted options are: > +@table @option > +@item asyncbufsize > +Set asynchronous data buffer size, in bytes. Default value is 8 MiB. > +@end table > + > @example > async:@var{URL} > async:http://host/resource > diff --git a/libavformat/async.c b/libavformat/async.c > index 54dbd2312a2..f8ac12c7aa0 100644 > --- a/libavformat/async.c > +++ b/libavformat/async.c > @@ -78,6 +78,8 @@ typedef struct Context { > > int abort_request; > AVIOInterruptCB interrupt_callback; > + > + int asyncbufsize; > } Context; > > static int ring_init(RingBuffer *ring, unsigned int capacity, int > read_back_capacity) > @@ -242,10 +244,12 @@ static int async_open(URLContext *h, const char *arg, > int flags, AVDictionary ** > Context *c = h->priv_data; > int ret; > AVIOInterruptCB interrupt_callback = {.callback = > async_check_interrupt, .opaque = h}; > + int capacity; > > av_strstart(arg, "async:", &arg); > > - ret = ring_init(&c->ring, BUFFER_CAPACITY, READ_BACK_CAPACITY); > + capacity = FFMAX(4096, c->asyncbufsize / 2); > + ret = ring_init(&c->ring, capacity, capacity);
READ_BACK_CAPACITY is unused after this patch [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel