Browse Source

avio: Add a function for signalling end of reading/writing

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n0.11
Samuel Pitoiset Martin Storsjö 13 years ago
parent
commit
32d545e0a4
2 changed files with 20 additions and 0 deletions
  1. +7
    -0
      libavformat/avio.c
  2. +13
    -0
      libavformat/url.h

+ 7
- 0
libavformat/avio.c View File

@@ -345,6 +345,13 @@ int ffurl_get_file_handle(URLContext *h)
return h->prot->url_get_file_handle(h);
}

int ffurl_shutdown(URLContext *h, int flags)
{
if (!h->prot->url_shutdown)
return AVERROR(EINVAL);
return h->prot->url_shutdown(h, flags);
}

int ff_check_interrupt(AVIOInterruptCB *cb)
{
int ret;


+ 13
- 0
libavformat/url.h View File

@@ -81,6 +81,7 @@ typedef struct URLProtocol {
int64_t (*url_read_seek)(URLContext *h, int stream_index,
int64_t timestamp, int flags);
int (*url_get_file_handle)(URLContext *h);
int (*url_shutdown)(URLContext *h, int flags);
int priv_data_size;
const AVClass *priv_data_class;
int flags;
@@ -200,6 +201,18 @@ int64_t ffurl_size(URLContext *h);
*/
int ffurl_get_file_handle(URLContext *h);

/**
* Signal the URLContext that we are done reading or writing the stream.
*
* @param h pointer to the resource
* @param flags flags which control how the resource indicated by url
* is to be shutdown
*
* @return a negative value if an error condition occurred, 0
* otherwise
*/
int ffurl_shutdown(URLContext *h, int flags);

/**
* Register the URLProtocol protocol.
*


Loading…
Cancel
Save