Browse Source

avio: introduce avio_closep

tags/n1.1
Luca Barbato 13 years ago
parent
commit
b522000e9b
4 changed files with 27 additions and 2 deletions
  1. +3
    -0
      doc/APIchanges
  2. +15
    -0
      libavformat/avio.h
  3. +7
    -0
      libavformat/aviobuf.c
  4. +2
    -2
      libavformat/version.h

+ 3
- 0
doc/APIchanges View File

@@ -13,6 +13,9 @@ libavutil: 2011-04-18


API changes, most recent first: API changes, most recent first:


2012-10-xx - xxxxxxx - lavf 54.18.0 - avio.h
Add avio_closep to complement avio_close.

2012-10-xx - xxxxxxx - lavu 51.42.0 - pixfmt.h 2012-10-xx - xxxxxxx - lavu 51.42.0 - pixfmt.h
Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*. Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*.
To provide backwards compatibility, PixelFormat is now #defined as To provide backwards compatibility, PixelFormat is now #defined as


+ 15
- 0
libavformat/avio.h View File

@@ -353,9 +353,24 @@ int avio_open2(AVIOContext **s, const char *url, int flags,
* resource. * resource.
* *
* @return 0 on success, an AVERROR < 0 on error. * @return 0 on success, an AVERROR < 0 on error.
* @see avio_closep
*/ */
int avio_close(AVIOContext *s); int avio_close(AVIOContext *s);


/**
* Close the resource accessed by the AVIOContext *s, free it
* and set the pointer pointing to it to NULL.
* This function can only be used if s was opened by avio_open().
*
* The internal buffer is automatically flushed before closing the
* resource.
*
* @return 0 on success, an AVERROR < 0 on error.
* @see avio_close
*/
int avio_closep(AVIOContext **s);


/** /**
* Open a write only memory stream. * Open a write only memory stream.
* *


+ 7
- 0
libavformat/aviobuf.c View File

@@ -768,6 +768,13 @@ int avio_close(AVIOContext *s)
return ffurl_close(h); return ffurl_close(h);
} }


int avio_closep(AVIOContext **s)
{
int ret = avio_close(*s);
*s = NULL;
return ret;
}

int avio_printf(AVIOContext *s, const char *fmt, ...) int avio_printf(AVIOContext *s, const char *fmt, ...)
{ {
va_list ap; va_list ap;


+ 2
- 2
libavformat/version.h View File

@@ -30,8 +30,8 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"


#define LIBAVFORMAT_VERSION_MAJOR 54 #define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR 17
#define LIBAVFORMAT_VERSION_MICRO 3
#define LIBAVFORMAT_VERSION_MINOR 18
#define LIBAVFORMAT_VERSION_MICRO 0


#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \ LIBAVFORMAT_VERSION_MINOR, \


Loading…
Cancel
Save