History

Merge commit 'fd056029f45a9f6d213d9fce8165632042511d4f'

* commit 'fd056029f45a9f6d213d9fce8165632042511d4f': lavc: add avcodec_free_context(). Conflicts: doc/APIchanges libavcodec/version.h

Michael Niedermayer committed 12 years ago

Commit 68c05182 parents ff17d8b fd056024 files · +28 −4Browse files

Unified · Split

4 files
  1. doc/APIchanges +4 −0
  2. libavcodec/avcodec.h +8 −3
  3. libavcodec/options.c +15 −0
  4. libavcodec/version.h +1 −1
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2012-10-22 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182014-04-xx - xxxxxxx - lavc 55.52.0 - avcodec.h
19 Add avcodec_free_context(). From now on it should be used for freeing
20 AVCodecContext.
21
182014-05-xx - xxxxxxx - lavu 52.84.100 - time.h222014-05-xx - xxxxxxx - lavu 52.84.100 - time.h
19 Add av_gettime_relative() av_gettime_relative_is_monotonic()23 Add av_gettime_relative() av_gettime_relative_is_monotonic()
20 24
libavcodec/avcodec.h+8−3
@@ -3455,9 +3455,8 @@ void avcodec_register(AVCodec *codec); · 3454 unmodified lines
3455void avcodec_register_all(void);3455void avcodec_register_all(void);
3456 3456
3457/**3457/**
3458 * Allocate an AVCodecContext and set its fields to default values. The3458 * Allocate an AVCodecContext and set its fields to default values. The
3459 * resulting struct can be deallocated by calling avcodec_close() on it followed3459 * resulting struct should be freed with avcodec_free_context().
3460 * by av_free().
3461 *3460 *
3462 * @param codec if non-NULL, allocate private data and initialize defaults3461 * @param codec if non-NULL, allocate private data and initialize defaults
3463 * for the given codec. It is illegal to then call avcodec_open2()3462 * for the given codec. It is illegal to then call avcodec_open2()
@@ -3471,6 +3470,12 @@ void avcodec_register_all(void); · 7 unmodified lines
3471 */3470 */
3472AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);3471AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
3473 3472
3473/**
3474 * Free the codec context and everything associated with it and write NULL to
3475 * the provided pointer.
3476 */
3477void avcodec_free_context(AVCodecContext **avctx);
3478
3474/**3479/**
3475 * Set the fields of the given AVCodecContext to default values corresponding3480 * Set the fields of the given AVCodecContext to default values corresponding
3476 * to the given codec (defaults may be codec-dependent).3481 * to the given codec (defaults may be codec-dependent).
libavcodec/options.c+15−0
@@ -154,6 +154,21 @@ AVCodecContext *avcodec_alloc_context3(const AVCodec *codec) · 153 unmodified lines
154 return avctx;154 return avctx;
155}155}
156 156
157void avcodec_free_context(AVCodecContext **pavctx)
158{
159 AVCodecContext *avctx = *pavctx;
160
161 if (!avctx)
162 return;
163
164 avcodec_close(avctx);
165
166 av_freep(&avctx->extradata);
167 av_freep(&avctx->subtitle_header);
168
169 av_freep(pavctx);
170}
171
157int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)172int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
158{173{
159 const AVCodec *orig_codec = dest->codec;174 const AVCodec *orig_codec = dest->codec;
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "libavutil/version.h"29#include "libavutil/version.h"
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5531#define LIBAVCODEC_VERSION_MAJOR 55
32#define LIBAVCODEC_VERSION_MINOR 6232#define LIBAVCODEC_VERSION_MINOR 63
33#define LIBAVCODEC_VERSION_MICRO 10033#define LIBAVCODEC_VERSION_MICRO 100
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t