Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-14 16:00:53 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2015-10-14 16:00:53 +0300
commit3d93ff289e0421d71cd63e246727d8ace256f27d (patch)
tree550f02bdee0db06ef5231921d9ebe0eb4f387869 /libavcodec/libschroedinger.c
parent9c3f75c29d2938bc3dd77a7733a11059ed2bc488 (diff)
parent6fdd4c678ac1ce0776f9645cd534209e5f1ae1e3 (diff)
Merge commit '6fdd4c678ac1ce0776f9645cd534209e5f1ae1e3'
* commit '6fdd4c678ac1ce0776f9645cd534209e5f1ae1e3': libschroedinger: Properly use AVFrame API Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/libschroedinger.c')
-rw-r--r--libavcodec/libschroedinger.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/libavcodec/libschroedinger.c b/libavcodec/libschroedinger.c
index 9f0b25c02b..0b02b2c240 100644
--- a/libavcodec/libschroedinger.c
+++ b/libavcodec/libschroedinger.c
@@ -26,6 +26,7 @@
#include "libavutil/attributes.h"
#include "libavutil/mem.h"
#include "libschroedinger.h"
+#include "internal.h"
static const SchroVideoFormatInfo ff_schro_video_format_info[] = {
{ 640, 480, 24000, 1001},
@@ -167,19 +168,14 @@ int ff_get_schro_frame_format (SchroChromaFormat schro_pix_fmt,
static void free_schro_frame(SchroFrame *frame, void *priv)
{
- AVPicture *p_pic = priv;
-
- if (!p_pic)
- return;
-
- avpicture_free(p_pic);
- av_freep(&p_pic);
+ AVFrame *p_pic = priv;
+ av_frame_free(&p_pic);
}
SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
SchroFrameFormat schro_frame_fmt)
{
- AVPicture *p_pic;
+ AVFrame *p_pic;
SchroFrame *p_frame;
int y_width, uv_width;
int y_height, uv_height;
@@ -190,9 +186,12 @@ SchroFrame *ff_create_schro_frame(AVCodecContext *avctx,
uv_width = y_width >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));
uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
- p_pic = av_mallocz(sizeof(AVPicture));
- if (!p_pic || avpicture_alloc(p_pic, avctx->pix_fmt, y_width, y_height) < 0) {
- av_free(p_pic);
+ p_pic = av_frame_alloc();
+ if (!p_pic)
+ return NULL;
+
+ if (ff_get_buffer(avctx, p_pic, AV_GET_BUFFER_FLAG_REF) < 0) {
+ av_frame_free(&p_pic);
return NULL;
}