summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_hwac3.c4
-rw-r--r--libmpcodecs/ad_realaud.c7
-rw-r--r--libmpcodecs/dec_teletext.c3
-rw-r--r--libmpcodecs/dec_video.c4
-rw-r--r--libmpcodecs/vd_ffmpeg.c5
-rw-r--r--libmpcodecs/vd_realvid.c4
-rw-r--r--libmpcodecs/vd_sgi.c3
-rw-r--r--libmpcodecs/vf_filmdint.c2
-rw-r--r--libmpcodecs/vf_pp.c14
-rw-r--r--libmpcodecs/vf_scale.c4
-rw-r--r--libmpcodecs/vf_screenshot.c4
-rw-r--r--libmpcodecs/vf_smartblur.c5
-rw-r--r--libmpcodecs/vf_uspp.c4
13 files changed, 30 insertions, 33 deletions
diff --git a/libmpcodecs/ad_hwac3.c b/libmpcodecs/ad_hwac3.c
index f45fd00a17..f5d6fbc933 100644
--- a/libmpcodecs/ad_hwac3.c
+++ b/libmpcodecs/ad_hwac3.c
@@ -283,9 +283,9 @@ static int dts_decode_header(uint8_t *indata_ptr, int *rate, int *nblks, int *sf
{
int ftype;
int surp;
- int unknown_bit;
+ int unknown_bit av_unused;
int fsize;
- int amode;
+ int amode av_unused;
int word_mode;
int le_mode;
diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c
index 0b7fb219f7..3f221c61ef 100644
--- a/libmpcodecs/ad_realaud.c
+++ b/libmpcodecs/ad_realaud.c
@@ -27,7 +27,7 @@
#include <dlfcn.h>
#endif
#include "path.h"
-
+#include "libavutil/attributes.h"
#include "ad_internal.h"
#include "loader/wine/windef.h"
@@ -41,6 +41,9 @@ static const ad_info_t info = {
LIBAD_EXTERN(realaud)
+void *__builtin_new(unsigned long size);
+void __builtin_delete(void *ize);
+
void *__builtin_new(unsigned long size) {
return malloc(size);
}
@@ -414,7 +417,7 @@ static void uninit(sh_audio_t *sh){
}
static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen){
- int result;
+ int result av_unused;
int len=-1;
if(sh->a_in_buffer_len<=0){
diff --git a/libmpcodecs/dec_teletext.c b/libmpcodecs/dec_teletext.c
index d619ecde80..4ae94ec0d1 100644
--- a/libmpcodecs/dec_teletext.c
+++ b/libmpcodecs/dec_teletext.c
@@ -1638,7 +1638,7 @@ static int teletext_set_format(priv_vbi_t * priv, teletext_format flag)
*/
static void vbi_add_dec(priv_vbi_t * priv, char *dec)
{
- int count, shift;
+ int count;
if (!dec)
return;
if (!priv->on)
@@ -1657,7 +1657,6 @@ static void vbi_add_dec(priv_vbi_t * priv, char *dec)
else
priv->pagenumdec=0;
} else {
- shift = count * 4;
count++;
priv->pagenumdec=
(((priv->pagenumdec)<<4|(*dec-'0'))&0xfff)|(count<<12);
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index 71d6de5216..f49eb79218 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -109,7 +109,7 @@ int set_video_colors(sh_video_t *sh_video, const char *item, int value)
/* try software control */
const struct vd_functions *vd = sh_video->vd_driver;
if (vd &&
- vd->control(sh_video, VDCTRL_SET_EQUALIZER, item, (int *) value)
+ vd->control(sh_video, VDCTRL_SET_EQUALIZER, (void *)item, value)
== CONTROL_OK)
return 1;
mp_tmsg(MSGT_DECVIDEO, MSGL_V, "Video attribute '%s' is not supported by selected vo & vd.\n",
@@ -135,7 +135,7 @@ int get_video_colors(sh_video_t *sh_video, const char *item, int *value)
/* try software control */
const struct vd_functions *vd = sh_video->vd_driver;
if (vd)
- return vd->control(sh_video, VDCTRL_GET_EQUALIZER, item, value);
+ return vd->control(sh_video, VDCTRL_GET_EQUALIZER, (void *)item, value);
return 0;
}
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 598be093c1..a5c21a2e62 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -796,9 +796,10 @@ static struct mp_image *decode(struct sh_video *sh, void *data, int len,
// HACK: make PNGs decode normally instead of as CorePNG delta frames
pkt.flags = AV_PKT_FLAG_KEY;
// The avcodec opaque field stupidly supports only int64_t type
- *(double *)&avctx->reordered_opaque = *reordered_pts;
+ union pts { int64_t i; double d; };
+ avctx->reordered_opaque = (union pts){.d = *reordered_pts}.i;
ret = avcodec_decode_video2(avctx, pic, &got_picture, &pkt);
- *reordered_pts = *(double *)&pic->reordered_opaque;
+ *reordered_pts = (union pts){.i = pic->reordered_opaque}.d;
dr1= ctx->do_dr1;
if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n");
diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c
index 17250fe8ca..8fc843855f 100644
--- a/libmpcodecs/vd_realvid.c
+++ b/libmpcodecs/vd_realvid.c
@@ -84,6 +84,10 @@ static int bufsz = 0;
static int dll_type = 0; /* 0 = unix dlopen, 1 = win32 dll */
#endif
+void *__builtin_vec_new(unsigned long size);
+void __builtin_vec_delete(void *mem);
+void __pure_virtual(void);
+
void *__builtin_vec_new(unsigned long size) {
return malloc(size);
}
diff --git a/libmpcodecs/vd_sgi.c b/libmpcodecs/vd_sgi.c
index fff6d6f60b..e7dd90cecc 100644
--- a/libmpcodecs/vd_sgi.c
+++ b/libmpcodecs/vd_sgi.c
@@ -173,10 +173,9 @@ decode_rle_sgi(SGIInfo *info, unsigned char *data, mp_image_t *mpi)
{
unsigned char *rle_data, *dest_row;
uint32_t *starttab;
- int y, z, xsize, ysize, zsize, chan_offset;
+ int y, z, ysize, zsize, chan_offset;
long start_offset;
- xsize = info->xsize;
ysize = info->ysize;
zsize = info->zsize;
diff --git a/libmpcodecs/vf_filmdint.c b/libmpcodecs/vf_filmdint.c
index b40a66831a..9c34b4aa07 100644
--- a/libmpcodecs/vf_filmdint.c
+++ b/libmpcodecs/vf_filmdint.c
@@ -1139,7 +1139,7 @@ find_breaks(struct vf_priv_s *p, struct frame_stats *s)
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
{
- mp_image_t *dmpi;
+ mp_image_t *dmpi = NULL;
struct vf_priv_s *p = vf->priv;
unsigned char **planes, **old_planes;
struct frame_stats *s = &p->stats[p->inframes & 1];
diff --git a/libmpcodecs/vf_pp.c b/libmpcodecs/vf_pp.c
index 10c4edf707..694fa09bf2 100644
--- a/libmpcodecs/vf_pp.c
+++ b/libmpcodecs/vf_pp.c
@@ -133,7 +133,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
if(vf->priv->pp || !(mpi->flags&MP_IMGFLAG_DIRECT)){
// do the postprocessing! (or copy if no DR)
- pp_postprocess(mpi->planes ,mpi->stride,
+ pp_postprocess((const uint8_t **)mpi->planes, mpi->stride,
vf->dmpi->planes,vf->dmpi->stride,
(mpi->w+7)&(~7),mpi->h,
mpi->qscale, mpi->qstride,
@@ -162,9 +162,7 @@ static const unsigned int fmt_list[]={
};
static int vf_open(vf_instance_t *vf, char *args){
- char *endptr, *name;
int i;
- int hex_mode=0;
vf->query_format=query_format;
vf->control=control;
@@ -180,15 +178,7 @@ static int vf_open(vf_instance_t *vf, char *args){
vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);
if(!vf->priv->outfmt) return 0; // no csp match :(
- if(args){
- hex_mode= strtol(args, &endptr, 0);
- if(*endptr){
- name= args;
- }else
- name= NULL;
- }else{
- name="de";
- }
+ char *name = args ? args : "de";
for(i=0; i<=PP_QUALITY_MAX; i++){
vf->priv->ppMode[i]= pp_get_mode_by_name_and_quality(name, i);
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index 12c51ae685..e8e846c92f 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -377,7 +377,7 @@ static void start_slice(struct vf_instance *vf, mp_image_t *mpi){
static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src[MP_MAX_PLANES], int src_stride[MP_MAX_PLANES],
int y, int h, uint8_t *dst[MP_MAX_PLANES], int dst_stride[MP_MAX_PLANES], int interlaced){
- uint8_t *src2[MP_MAX_PLANES]={src[0], src[1], src[2], src[3]};
+ const uint8_t *src2[MP_MAX_PLANES]={src[0], src[1], src[2], src[3]};
#if HAVE_BIGENDIAN
uint32_t pal2[256];
if (src[1] && !src[2]){
@@ -671,7 +671,7 @@ static const m_option_t vf_opts_fields[] = {
{"param2", ST_OFF(param[1]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL},
// Note that here the 2 field is NULL (ie 0)
// As we want this option to act on the option struct itself
- {"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, &size_preset},
+ {"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, (void *)&size_preset},
{"noup", ST_OFF(noup), CONF_TYPE_INT, M_OPT_RANGE, 0, 2, NULL},
{"arnd", ST_OFF(accurate_rnd), CONF_TYPE_FLAG, 0, 0, 1, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
diff --git a/libmpcodecs/vf_screenshot.c b/libmpcodecs/vf_screenshot.c
index 82b345b446..1b5d575fba 100644
--- a/libmpcodecs/vf_screenshot.c
+++ b/libmpcodecs/vf_screenshot.c
@@ -134,7 +134,7 @@ static void scale_image(struct vf_priv_s* priv, mp_image_t *mpi)
priv->buffer = av_malloc(dst_stride[0]*priv->dh);
dst[0] = priv->buffer;
- sws_scale(priv->ctx, mpi->planes, mpi->stride, 0, priv->dh, dst, dst_stride);
+ sws_scale(priv->ctx, (const uint8_t **)mpi->planes, mpi->stride, 0, priv->dh, dst, dst_stride);
}
static void start_slice(struct vf_instance *vf, mp_image_t *mpi)
@@ -157,7 +157,7 @@ static void draw_slice(struct vf_instance *vf, unsigned char** src,
int dst_stride[MP_MAX_PLANES] = {0};
dst_stride[0] = vf->priv->stride;
dst[0] = vf->priv->buffer;
- sws_scale(vf->priv->ctx, src, stride, y, h, dst, dst_stride);
+ sws_scale(vf->priv->ctx, (const uint8_t **)src, stride, y, h, dst, dst_stride);
}
vf_next_draw_slice(vf,src,stride,w,h,x,y);
}
diff --git a/libmpcodecs/vf_smartblur.c b/libmpcodecs/vf_smartblur.c
index 4083dfbda0..6599c967de 100644
--- a/libmpcodecs/vf_smartblur.c
+++ b/libmpcodecs/vf_smartblur.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <inttypes.h>
#include <assert.h>
+#include <stdbool.h>
#include "mp_msg.h"
#include "libavutil/avutil.h"
@@ -156,11 +157,11 @@ static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride,
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
int cw= mpi->w >> mpi->chroma_x_shift;
int ch= mpi->h >> mpi->chroma_y_shift;
- FilterParam *f= &vf->priv;
+ bool threshold = vf->priv->luma.threshold || vf->priv->chroma.threshold;
mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|
- (f->threshold) ? MP_IMGFLAG_READABLE : 0,
+ (threshold ? MP_IMGFLAG_READABLE : 0),
mpi->w,mpi->h);
assert(mpi->flags&MP_IMGFLAG_PLANAR);
diff --git a/libmpcodecs/vf_uspp.c b/libmpcodecs/vf_uspp.c
index 6feb8eb468..85383716b5 100644
--- a/libmpcodecs/vf_uspp.c
+++ b/libmpcodecs/vf_uspp.c
@@ -175,12 +175,12 @@ static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int ds
for(i=0; i<count; i++){
const int x1= offset[i+count-1][0];
const int y1= offset[i+count-1][1];
- int offset, out_size;
+ int offset;
p->frame->data[0]= p->src[0] + x1 + y1 * p->frame->linesize[0];
p->frame->data[1]= p->src[1] + x1/2 + y1/2 * p->frame->linesize[1];
p->frame->data[2]= p->src[2] + x1/2 + y1/2 * p->frame->linesize[2];
- out_size = avcodec_encode_video(p->avctx_enc[i], p->outbuf, p->outbuf_size, p->frame);
+ avcodec_encode_video(p->avctx_enc[i], p->outbuf, p->outbuf_size, p->frame);
p->frame_dec = p->avctx_enc[i]->coded_frame;
offset= (BLOCK-x1) + (BLOCK-y1)*p->frame_dec->linesize[0];