Fix some -Wshadow warnings

In general, this warning can hint to actual bugs. We don't enable it
yet, because it would conflict with some unmerged code, and we should
check with clang too (this commit was done by testing with gcc).
This commit is contained in:
wm4 2013-07-23 00:45:23 +02:00
parent 78ebb3c6fa
commit e83cbde1a4
26 changed files with 86 additions and 96 deletions

View File

@ -204,9 +204,9 @@ static struct af_instance *af_create(struct af_stream *s, char *name,
goto error;
if (args && af->control) {
// Single option string for old filters
char *s = (char *)args; // m_config_initialize_obj did this
char *opts = (char *)args; // m_config_initialize_obj did this
assert(!af->priv);
if (af->control(af, AF_CONTROL_COMMAND_LINE, s) <= AF_ERROR)
if (af->control(af, AF_CONTROL_COMMAND_LINE, opts) <= AF_ERROR)
goto error;
}

View File

@ -175,15 +175,15 @@ static void uninit(struct af_instance* af)
}
// Filter data through filter
static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
static struct mp_audio* play(struct af_instance* af, struct mp_audio* audio)
{
af_ac3enc_t *s = af->setup;
struct mp_audio *c = data; // Current working data
struct mp_audio *c = audio; // Current working data
struct mp_audio *l;
int left, outsize = 0;
char *buf, *src;
int max_output_len;
int frame_num = (data->len + s->pending_len) / s->expect_len;
int frame_num = (audio->len + s->pending_len) / s->expect_len;
int samplesize = af_fmt2bits(s->in_sampleformat) / 8;
if (s->add_iec61937_header)

View File

@ -499,8 +499,8 @@ static int mp_property_quvi_format(m_option_t *prop, int action, void *arg,
pos = av_clip(pos, 0, res->num_srcs);
}
}
char *arg = res->srcs[pos]->encid;
return mp_property_quvi_format(prop, M_PROPERTY_SET, &arg, mpctx);
char *fmt = res->srcs[pos]->encid;
return mp_property_quvi_format(prop, M_PROPERTY_SET, &fmt, mpctx);
}
}
return mp_property_generic_option(prop, action, arg, mpctx);
@ -916,7 +916,7 @@ static const char *track_type_name(enum stream_type t)
}
static int property_list_tracks(m_option_t *prop, int action, void *arg,
MPContext *mpctx, enum stream_type type)
MPContext *mpctx)
{
if (action == M_PROPERTY_GET) {
char *res = NULL;

View File

@ -559,7 +559,7 @@ static int print_cmd_list(m_option_t *cfg, char *optname, char *optparam);
#define OPT_BASE_STRUCT struct MPOpts
// Our command line options
static const m_option_t input_conf[] = {
static const m_option_t input_config[] = {
OPT_STRING("conf", input.config_file, CONF_GLOBAL),
OPT_INT("ar-delay", input.ar_delay, CONF_GLOBAL),
OPT_INT("ar-rate", input.ar_rate, CONF_GLOBAL),
@ -573,7 +573,7 @@ static const m_option_t input_conf[] = {
};
static const m_option_t mp_input_opts[] = {
{ "input", (void *)&input_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
{ "input", (void *)&input_config, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
OPT_INTRANGE("doubleclick-time", input.doubleclick_time, 0, 0, 1000),
OPT_FLAG("joystick", input.use_joystick, CONF_GLOBAL),
OPT_FLAG("lirc", input.use_lirc, CONF_GLOBAL),
@ -1260,8 +1260,8 @@ static struct cmd_bind *find_any_bind_for_key(struct input_ctx *ictx,
struct cmd_bind *bind = find_bind_for_key_section(ictx, s->name, n, keys);
if (bind) {
struct cmd_bind_section *bs = bind->owner;
for (int i = 0; i < n; i++) {
if (MP_KEY_DEPENDS_ON_MOUSE_POS(keys[i]) && bs->mouse_area_set &&
for (int x = 0; x < n; x++) {
if (MP_KEY_DEPENDS_ON_MOUSE_POS(keys[x]) && bs->mouse_area_set &&
!test_rect(&bs->mouse_area, ictx->mouse_vo_x, ictx->mouse_vo_y))
goto skip;
}

View File

@ -850,11 +850,11 @@ void mp_write_watch_later_conf(struct MPContext *mpctx)
fprintf(file, "start=%f\n", pos);
for (int i = 0; backup_properties[i]; i++) {
const char *pname = backup_properties[i];
char *tmp = NULL;
int r = mp_property_do(pname, M_PROPERTY_GET_STRING, &tmp, mpctx);
char *val = NULL;
int r = mp_property_do(pname, M_PROPERTY_GET_STRING, &val, mpctx);
if (r == M_PROPERTY_OK)
fprintf(file, "%s=%s\n", pname, tmp);
talloc_free(tmp);
fprintf(file, "%s=%s\n", pname, val);
talloc_free(val);
}
fclose(file);
@ -2135,7 +2135,7 @@ static int audio_start_sync(struct MPContext *mpctx, int playsize)
if (written_pts <= 1 && sh_audio->pts == MP_NOPTS_VALUE) {
if (!did_retry) {
// Try to read more data to see packets that have pts
int res = decode_audio(sh_audio, &ao->buffer, ao->bps);
res = decode_audio(sh_audio, &ao->buffer, ao->bps);
if (res < 0)
return res;
did_retry = true;
@ -2152,7 +2152,7 @@ static int audio_start_sync(struct MPContext *mpctx, int playsize)
mpctx->syncing_audio = false;
int a = FFMIN(-bytes, FFMAX(playsize, 20000));
int res = decode_audio(sh_audio, &ao->buffer, a);
res = decode_audio(sh_audio, &ao->buffer, a);
bytes += ao->buffer.len;
if (bytes >= 0) {
memmove(ao->buffer.start,
@ -2838,8 +2838,8 @@ static bool timeline_set_part(struct MPContext *mpctx, int i, bool force)
// While another timeline was active, the selection of active tracks might
// have been changed - possibly we need to update this source.
for (int n = 0; n < mpctx->num_tracks; n++) {
struct track *track = mpctx->tracks[n];
for (int x = 0; x < mpctx->num_tracks; x++) {
struct track *track = mpctx->tracks[x];
if (track->under_timeline) {
track->demuxer = mpctx->demuxer;
track->stream = demuxer_stream_by_demuxer_id(track->demuxer,
@ -3127,11 +3127,11 @@ double get_current_pos_ratio(struct MPContext *mpctx, bool use_range)
if (len > 0 && !demuxer->ts_resets_possible) {
ans = av_clipf((pos - start) / len, 0, 1);
} else {
int len = (demuxer->movi_end - demuxer->movi_start);
int64_t pos = demuxer->filepos > 0 ?
demuxer->filepos : stream_tell(demuxer->stream);
if (len > 0)
ans = av_clipf((double)(pos - demuxer->movi_start) / len, 0, 1);
int64_t size = (demuxer->movi_end - demuxer->movi_start);
int64_t fpos = demuxer->filepos > 0 ?
demuxer->filepos : stream_tell(demuxer->stream);
if (size > 0)
ans = av_clipf((double)(fpos - demuxer->movi_start) / size, 0, 1);
}
if (use_range) {
if (mpctx->opts.play_frames > 0)
@ -3936,9 +3936,9 @@ static struct track *open_external_file(struct MPContext *mpctx, char *filename,
}
struct track *first = NULL;
for (int n = 0; n < demuxer->num_streams; n++) {
struct sh_stream *stream = demuxer->streams[n];
if (stream->type == filter) {
struct track *t = add_stream_track(mpctx, stream, false);
struct sh_stream *sh = demuxer->streams[n];
if (sh->type == filter) {
struct track *t = add_stream_track(mpctx, sh, false);
t->is_external = true;
t->title = talloc_strdup(t, disp_filename);
t->external_filename = talloc_strdup(t, filename);

View File

@ -187,11 +187,11 @@ static char *create_fname(struct MPContext *mpctx, char *template,
break;
}
case 't': {
char fmt = *template;
if (!fmt)
char tfmt = *template;
if (!tfmt)
goto error_exit;
template++;
char fmtstr[] = {'%', fmt, '\0'};
char fmtstr[] = {'%', tfmt, '\0'};
char buffer[80];
if (strftime(buffer, sizeof(buffer), fmtstr, local_time) == 0)
buffer[0] = '\0';

View File

@ -734,9 +734,9 @@ static int demux_mkv_read_cues(demuxer_t *demuxer)
continue;
}
uint64_t time = cuepoint->cue_time;
for (int i = 0; i < cuepoint->n_cue_track_positions; i++) {
for (int c = 0; c < cuepoint->n_cue_track_positions; c++) {
struct ebml_cue_track_positions *trackpos =
&cuepoint->cue_track_positions[i];
&cuepoint->cue_track_positions[c];
uint64_t pos = mkv_d->segment_start + trackpos->cue_cluster_position;
cue_index_add(demuxer, trackpos->cue_track, pos, time);
mp_msg(MSGT_DEMUX, MSGL_DBG2,
@ -853,9 +853,9 @@ static int demux_mkv_read_chapters(struct demuxer *demuxer)
memcpy(chapter.segment_uid, ca->chapter_segment_uid.start,
len);
mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] Chapter segment uid ");
for (int i = 0; i < len; i++)
for (int n = 0; n < len; n++)
mp_msg(MSGT_DEMUX, MSGL_V, "%02x ",
chapter.segment_uid[i]);
chapter.segment_uid[n]);
mp_msg(MSGT_DEMUX, MSGL_V, "\n");
}
}
@ -1979,16 +1979,15 @@ static void handle_realaudio(demuxer_t *demuxer, mkv_track_t *track,
|| (track->a_formattag == mmioFOURCC('s', 'i', 'p', 'r'))) {
// if(!block_bref)
// spc = track->sub_packet_cnt = 0;
int x;
switch (track->a_formattag) {
case mmioFOURCC('2', '8', '_', '8'):
for (x = 0; x < sph / 2; x++)
for (int x = 0; x < sph / 2; x++)
memcpy(track->audio_buf + x * 2 * w + spc * cfs,
buffer + cfs * x, cfs);
break;
case mmioFOURCC('c', 'o', 'o', 'k'):
case mmioFOURCC('a', 't', 'r', 'c'):
for (x = 0; x < w / sps; x++)
for (int x = 0; x < w / sps; x++)
memcpy(track->audio_buf +
sps * (sph * x + ((sph + 1) / 2) * (spc & 1) +
(spc >> 1)), buffer + sps * x, sps);
@ -2039,7 +2038,7 @@ static void handle_realaudio(demuxer_t *demuxer, mkv_track_t *track,
int apk_usize = track->stream->audio->wf->nBlockAlign;
track->sub_packet_cnt = 0;
// Release all the audio packets
for (x = 0; x < sph * w / apk_usize; x++) {
for (int x = 0; x < sph * w / apk_usize; x++) {
dp = new_demux_packet_from(track->audio_buf + x * apk_usize,
apk_usize);
/* Put timestamp only on packets that correspond to original

View File

@ -459,12 +459,12 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target,
level, " ", type->name);
char *s = target;
int len;
uint8_t *end = data + size;
uint8_t *p = data;
int num_elems[MAX_EBML_SUBELEMENTS] = {};
while (p < end) {
uint8_t *startp = p;
int len;
uint32_t id = ebml_parse_id(p, &len);
if (len > end - p)
goto past_end_error;
@ -523,9 +523,8 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target,
case EBML_TYPE_SUBELEMENTS:
num_elems[i] = FFMIN(num_elems[i],
1000000000 / type->fields[i].desc->size);
int size = num_elems[i] * type->fields[i].desc->size;
*(generic_struct **) ptr = talloc_zero_size(ctx->talloc_ctx,
size);
int sz = num_elems[i] * type->fields[i].desc->size;
*(generic_struct **) ptr = talloc_zero_size(ctx->talloc_ctx, sz);
break;
case EBML_TYPE_UINT:
*(uint64_t **) ptr = talloc_zero_array(ctx->talloc_ctx,

View File

@ -96,20 +96,20 @@ mf_t* open_mf_pattern(char * filename)
{
bstr bfname;
bstr_split_tok(bfilename, ",", &bfname, &bfilename);
char *fname = bstrdup0(NULL, bfname);
char *fname2 = bstrdup0(NULL, bfname);
if ( !mp_path_exists( fname ) )
if ( !mp_path_exists( fname2 ) )
{
mp_msg( MSGT_STREAM,MSGL_V,"[mf] file not found: '%s'\n",fname );
mp_msg( MSGT_STREAM,MSGL_V,"[mf] file not found: '%s'\n",fname2 );
}
else
{
mf->names=realloc( mf->names,( mf->nr_of_files + 1 ) * sizeof( char* ) );
mf->names[mf->nr_of_files] = strdup(fname);
mf->names[mf->nr_of_files] = strdup(fname2);
// mp_msg( MSGT_STREAM,MSGL_V,"[mf] added file %d.: %s\n",mf->nr_of_files,mf->names[mf->nr_of_files] );
mf->nr_of_files++;
}
talloc_free(fname);
talloc_free(fname2);
}
mp_msg( MSGT_STREAM,MSGL_INFO,"[mf] number of files: %d\n",mf->nr_of_files );

View File

@ -410,9 +410,8 @@ static int open_cdda(stream_t *st, int m, void *opts)
offset -= cdda_track_firstsector(cdd, 1);
if (offset) {
int i;
for (i = 0; i < cdd->tracks + 1; i++)
cdd->disc_toc[i].dwStartSector += offset;
for (int n = 0; n < cdd->tracks + 1; n++)
cdd->disc_toc[n].dwStartSector += offset;
}
if (p->speed > 0)

View File

@ -553,7 +553,6 @@ static int open_tv(tvi_handle_t *tvh)
tv_channel_last_real = malloc(5);
if (tv_channel_list) {
int i;
int channel = 0;
if (tvh->tv_param->channel)
{
@ -579,7 +578,7 @@ static int open_tv(tvi_handle_t *tvh)
if ( channel ) {
tv_channel_current = tv_channel_list;
for (i = 1; i < channel; i++)
for (int n = 1; n < channel; n++)
if (tv_channel_current->next)
tv_channel_current = tv_channel_current->next;
}

View File

@ -1103,9 +1103,8 @@ static int uninit(priv_t *priv)
free(priv->video_dev); priv->video_dev = NULL;
if (priv->video_ringbuffer) {
int i;
for (i = 0; i < priv->video_buffer_size_current; i++) {
free(priv->video_ringbuffer[i].data);
for (int n = 0; n < priv->video_buffer_size_current; n++) {
free(priv->video_ringbuffer[n].data);
}
free(priv->video_ringbuffer);
}

View File

@ -242,8 +242,8 @@ bool osd_conv_ass_to_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs)
memset_pic(bmp->bitmap, 0, bmp->w * 4, bmp->h, bmp->stride);
for (int n = 0; n < src.num_parts; n++) {
struct sub_bitmap *s = &src.parts[n];
for (int p = 0; p < src.num_parts; p++) {
struct sub_bitmap *s = &src.parts[p];
// Assume mp_get_sub_bb_list() never splits sub bitmaps
// So we don't clip/adjust the size of the sub bitmap

View File

@ -362,10 +362,10 @@ static void convert_subrip(const char *orig, char *dest, int dest_buffer_size)
for (int i = 0; i < FF_ARRAY_ELEMS(subrip_web_colors); i++) {
char *color = subrip_web_colors[i].s;
if (bstrcasecmp(val, bstr0(color)) == 0) {
uint32_t color = subrip_web_colors[i].v;
tag->color = ((color & 0xff) << 16)
| (color & 0xff00)
| ((color & 0xff0000) >> 16);
uint32_t xcolor = subrip_web_colors[i].v;
tag->color = ((xcolor & 0xff) << 16)
| (xcolor & 0xff00)
| ((xcolor & 0xff0000) >> 16);
found = 1;
}
}

View File

@ -96,7 +96,7 @@ struct hwdec {
const char *codec, *hw_codec;
};
static const struct hwdec hwdec[] = {
static const struct hwdec hwdec_list[] = {
{HWDEC_VDPAU, "h264", "h264_vdpau"},
{HWDEC_VDPAU, "wmv3", "wmv3_vdpau"},
{HWDEC_VDPAU, "vc1", "vc1_vdpau"},
@ -120,9 +120,9 @@ static const struct hwdec hwdec[] = {
static struct hwdec *find_hwcodec(enum hwdec_type api, const char *codec)
{
for (int n = 0; hwdec[n].api; n++) {
if (hwdec[n].api == api && strcmp(hwdec[n].codec, codec) == 0)
return (struct hwdec *)&hwdec[n];
for (int n = 0; hwdec_list[n].api; n++) {
if (hwdec_list[n].api == api && strcmp(hwdec_list[n].codec, codec) == 0)
return (struct hwdec *)&hwdec_list[n];
}
return NULL;
}

View File

@ -37,16 +37,16 @@ struct vf_priv_s {
int scaleh;
};
static void toright(unsigned char *dst[3], unsigned char *src[3],
static void toright(unsigned char *adst[3], unsigned char *asrc[3],
int dststride[3], int srcstride[3],
int w, int h, struct vf_priv_s* p)
{
int k;
for (k = 0; k < 3; k++) {
unsigned char* fromL = src[k];
unsigned char* fromR = src[k];
unsigned char* to = dst[k];
unsigned char* fromL = asrc[k];
unsigned char* fromR = asrc[k];
unsigned char* to = adst[k];
int src = srcstride[k];
int dst = dststride[k];
int ss;

View File

@ -119,7 +119,6 @@ static void deNoiseSpacial(
}
for (Y = 1; Y < H; Y++){
unsigned int PixelAnt;
sLineOffs += sStride, dLineOffs += dStride;
/* First pixel on each line doesn't have previous pixel */
PixelAnt = Frame[sLineOffs]<<16;
@ -127,7 +126,6 @@ static void deNoiseSpacial(
FrameDest[dLineOffs]= ((PixelDst+0x10007FFF)>>16);
for (X = 1; X < W; X++){
unsigned int PixelDst;
/* The rest are normal */
PixelAnt = LowPassMul(PixelAnt, Frame[sLineOffs+X]<<16, Horizontal);
PixelDst = LineAnt[X] = LowPassMul(LineAnt[X], PixelAnt, Vertical);
@ -185,7 +183,6 @@ static void deNoise(unsigned char *Frame, // mpi->planes[x]
}
for (Y = 1; Y < H; Y++){
unsigned int PixelAnt;
unsigned short* LinePrev=&FrameAnt[Y*W];
sLineOffs += sStride, dLineOffs += dStride;
/* First pixel on each line doesn't have previous pixel */
@ -196,7 +193,6 @@ static void deNoise(unsigned char *Frame, // mpi->planes[x]
FrameDest[dLineOffs]= ((PixelDst+0x10007FFF)>>16);
for (X = 1; X < W; X++){
unsigned int PixelDst;
/* The rest are normal */
PixelAnt = LowPassMul(PixelAnt, Frame[sLineOffs+X]<<16, Horizontal);
LineAnt[X] = LowPassMul(LineAnt[X], PixelAnt, Vertical);

View File

@ -282,7 +282,7 @@ static int filter_ext(struct vf_instance *vf, struct mp_image *mpi)
av_frame_free(&frame);
for (;;) {
AVFrame *frame = av_frame_alloc();
frame = av_frame_alloc();
if (av_buffersink_get_frame(p->out, frame) < 0) {
// Not an error situation - no more output buffers in queue.
av_frame_free(&frame);

View File

@ -86,7 +86,7 @@ static void do_plane(unsigned char *to, unsigned char *from,
static enum mode analyze_plane(unsigned char *old, unsigned char *new,
int w, int h, int os, int ns, enum mode mode,
int verbose, int fields)
int unused, int fields)
{
double bdiff, pdiff, tdiff, scale;
int bdif, tdif, pdif;

View File

@ -203,15 +203,15 @@ static unsigned int find_best_out(vf_instance_t *vf, int in_format)
}
if (!best) {
// Try anything else. outfmt_list is just a list of preferred formats.
for (int format = IMGFMT_START; format < IMGFMT_END; format++) {
int ret = check_outfmt(vf, format);
for (int cur = IMGFMT_START; cur < IMGFMT_END; cur++) {
int ret = check_outfmt(vf, cur);
if (ret & VFCAP_CSP_SUPPORTED_BY_HW) {
best = format; // no conversion -> bingo!
best = cur; // no conversion -> bingo!
break;
}
if (ret & VFCAP_CSP_SUPPORTED && !best)
best = format; // best with conversion
best = cur; // best with conversion
}
}
return best;

View File

@ -95,9 +95,9 @@ static int filter(struct vf_instance *vf, struct mp_image *mpi)
vf_add_output_frame(vf, new);
vf->priv->out++;
if (flags & MP_IMGFIELD_REPEAT_FIRST) {
struct mp_image *new = mp_image_new_ref(mpi);
new->pts = vf_softpulldown_adjust_pts(&vf->priv->ptsbuf, mpi->pts, 0, 0, 3);
vf_add_output_frame(vf, new);
struct mp_image *new2 = mp_image_new_ref(mpi);
new2->pts = vf_softpulldown_adjust_pts(&vf->priv->ptsbuf, mpi->pts, 0, 0, 3);
vf_add_output_frame(vf, new2);
vf->priv->out++;
vf->priv->state=0;
} else {

View File

@ -39,9 +39,9 @@
#include <lcms2.h>
static bool parse_3dlut_size(const char *s, int *p1, int *p2, int *p3)
static bool parse_3dlut_size(const char *arg, int *p1, int *p2, int *p3)
{
if (sscanf(s, "%dx%dx%d", p1, p2, p3) != 3)
if (sscanf(arg, "%dx%dx%d", p1, p2, p3) != 3)
return false;
for (int n = 0; n < 3; n++) {
int s = ((int[]) { *p1, *p2, *p3 })[n];

View File

@ -1592,7 +1592,7 @@ static void draw_osd_cb(void *ctx, struct mpgl_osd_part *osd,
for (int n = 0; n < osd->packer->count; n++) {
struct sub_bitmap *b = &imgs->parts[n];
struct pos p = osd->packer->result[n];
struct pos pos = osd->packer->result[n];
// NOTE: the blend color is used with SUBBITMAP_LIBASS only, so it
// doesn't matter that we upload garbage for the other formats
@ -1602,7 +1602,7 @@ static void draw_osd_cb(void *ctx, struct mpgl_osd_part *osd,
write_quad(&va[osd->num_vertices],
b->x, b->y, b->x + b->dw, b->y + b->dh,
p.x, p.y, p.x + b->w, p.y + b->h,
pos.x, pos.y, pos.x + b->w, pos.y + b->h,
osd->w, osd->h, color, false);
osd->num_vertices += VERTICES_PER_QUAD;
}
@ -1657,12 +1657,12 @@ static bool test_fbo(struct gl_video *p, GLenum format)
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo.fbo);
gl->ReadBuffer(GL_COLOR_ATTACHMENT0);
for (int i = 0; i < 4; i++) {
float p = -1;
float pixel = -1;
float val = vals[i];
gl->ClearColor(val, 0.0f, 0.0f, 1.0f);
gl->Clear(GL_COLOR_BUFFER_BIT);
gl->ReadPixels(0, 0, 1, 1, GL_RED, GL_FLOAT, &p);
mp_msg(MSGT_VO, MSGL_V, " %s: %a\n", val_names[i], val - p);
gl->ReadPixels(0, 0, 1, 1, GL_RED, GL_FLOAT, &pixel);
mp_msg(MSGT_VO, MSGL_V, " %s: %a\n", val_names[i], val - pixel);
}
gl->BindFramebuffer(GL_FRAMEBUFFER, 0);
glCheckError(gl, "after FBO read");

View File

@ -1832,8 +1832,8 @@ static bool get_image(struct vo *vo, mp_image_t *mpi, int *th, bool *cplane)
height = p->texture_height;
}
int avgbpp16 = 0;
for (int p = 0; p < 4; p++)
avgbpp16 += (16 * mpi->fmt.bpp[p]) >> mpi->fmt.xs[p] >> mpi->fmt.ys[p];
for (int pl = 0; pl < 4; pl++)
avgbpp16 += (16 * mpi->fmt.bpp[pl]) >> mpi->fmt.xs[pl] >> mpi->fmt.ys[pl];
int avgbpp = avgbpp16 / 16;
mpi->stride[0] = width * avgbpp / 8;
needed_size = mpi->stride[0] * height;

View File

@ -721,11 +721,11 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
{
struct priv *vc = vo->priv;
static const bool formats[SUBBITMAP_COUNT] = {
static const bool osdformats[SUBBITMAP_COUNT] = {
[SUBBITMAP_RGBA] = true,
};
osd_draw(osd, vc->osd_res, osd->vo_pts, 0, formats, draw_osd_cb, vo);
osd_draw(osd, vc->osd_res, osd->vo_pts, 0, osdformats, draw_osd_cb, vo);
}
static int preinit(struct vo *vo)

View File

@ -1390,7 +1390,6 @@ static void destroy_vdpau_objects(struct vo *vo)
struct vdpctx *vc = vo->priv;
struct vdp_functions *vdp = vc->vdp;
int i;
VdpStatus vdp_st;
free_video_specific(vo);
@ -1406,7 +1405,7 @@ static void destroy_vdpau_objects(struct vo *vo)
"vdp_presentation_queue_target_destroy");
}
for (i = 0; i < vc->num_output_surfaces; i++) {
for (int i = 0; i < vc->num_output_surfaces; i++) {
if (vc->output_surfaces[i] == VDP_INVALID_HANDLE)
continue;
vdp_st = vdp->output_surface_destroy(vc->output_surfaces[i]);