summaryrefslogtreecommitdiff
path: root/src/dxr3/dxr3_mpeg_encoders.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dxr3/dxr3_mpeg_encoders.c')
-rw-r--r--src/dxr3/dxr3_mpeg_encoders.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c
index 0c59b0b93..97971ebbc 100644
--- a/src/dxr3/dxr3_mpeg_encoders.c
+++ b/src/dxr3/dxr3_mpeg_encoders.c
@@ -44,6 +44,9 @@
#include <math.h>
#include <unistd.h>
+/* libavutil from FFmpeg */
+#include <mem.h>
+
#define LOG_MODULE "dxr3_mpeg_encoder"
/* #define LOG_VERBOSE */
/* #define LOG */
@@ -99,7 +102,7 @@ typedef struct {
char *buffer; /* temporary buffer for mpeg data */
/* temporary buffer for YUY2->YV12 conversion */
uint8_t *out[3]; /* aligned buffer for YV12 data */
- uint8_t *buf; /* unaligned YV12 buffer */
+ uint8_t *buf; /* base address of YV12 buffer */
} fame_data_t;
/* helper function */
@@ -337,8 +340,7 @@ static int fame_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame)
fame_parameters_t init_fp = FAME_PARAMETERS_INITIALIZER;
double fps;
- if (this->buf) free(this->buf);
- this->buf = 0;
+ av_freep(&this->buf);
this->out[0] = this->out[1] = this->out[2] = 0;
/* if YUY2 and dimensions changed, we need to re-allocate the
@@ -346,8 +348,7 @@ static int fame_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame)
if (frame->vo_frame.format == XINE_IMGFMT_YUY2) {
int image_size = frame->vo_frame.width * frame->oheight;
- this->out[0] = xine_xmalloc_aligned(16, image_size * 3/2,
- (void *)&this->buf);
+ this->out[0] = this->buf = av_mallocz(image_size * 3/2);
this->out[1] = this->out[0] + image_size;
this->out[2] = this->out[1] + image_size/4;