(ffmpeg_core.c) C89 build fixes

This commit is contained in:
twinaphex 2015-06-29 22:20:21 +02:00
parent 07f20d6ed6
commit f1a1f3531b
1 changed files with 18 additions and 26 deletions

View File

@ -229,12 +229,8 @@ void CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *info)
unsigned height = vctx ? media.height : 240; unsigned height = vctx ? media.height : 240;
float aspect = vctx ? media.aspect : 0.0; float aspect = vctx ? media.aspect : 0.0;
info->timing = (struct retro_system_timing) info->timing.fps = media.interpolate_fps;
{ info->timing.sample_rate = actx[0] ? media.sample_rate : 32000.0;
.fps = media.interpolate_fps,
.sample_rate = actx[0] ? media.sample_rate : 32000.0,
};
#ifdef HAVE_GL_FFT #ifdef HAVE_GL_FFT
if (audio_streams_num > 0 && video_stream < 0) if (audio_streams_num > 0 && video_stream < 0)
@ -245,14 +241,11 @@ void CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *info)
} }
#endif #endif
info->geometry = (struct retro_game_geometry) info->geometry.base_width = width;
{ info->geometry.base_height = height;
.base_width = width, info->geometry.max_width = width;
.base_height = height, info->geometry.max_height = height;
.max_width = width, info->geometry.aspect_ratio = aspect;
.max_height = height,
.aspect_ratio = aspect,
};
} }
void CORE_PREFIX(retro_set_environment)(retro_environment_t cb) void CORE_PREFIX(retro_set_environment)(retro_environment_t cb)
@ -453,7 +446,6 @@ void CORE_PREFIX(retro_run)(void)
CORE_PREFIX(input_poll_cb)(); CORE_PREFIX(input_poll_cb)();
left = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, left = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
RETRO_DEVICE_ID_JOYPAD_LEFT); RETRO_DEVICE_ID_JOYPAD_LEFT);
right = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, right = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0,
@ -508,12 +500,12 @@ void CORE_PREFIX(retro_run)(void)
CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE, &msg_obj); CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE, &msg_obj);
} }
last_left = left; last_left = left;
last_right = right; last_right = right;
last_up = up; last_up = up;
last_down = down; last_down = down;
last_l = l; last_l = l;
last_r = r; last_r = r;
if (reset_triggered) if (reset_triggered)
{ {
@ -704,7 +696,7 @@ void CORE_PREFIX(retro_run)(void)
#ifdef HAVE_GL_FFT #ifdef HAVE_GL_FFT
else if (fft) else if (fft)
{ {
unsigned frames = to_read_frames; unsigned frames = to_read_frames;
const int16_t *buffer = audio_buffer; const int16_t *buffer = audio_buffer;
while (frames) while (frames)
@ -805,10 +797,10 @@ static bool open_codecs(void)
unsigned i; unsigned i;
video_stream = -1; video_stream = -1;
memset(audio_streams, 0, sizeof(audio_streams)); memset(audio_streams, 0, sizeof(audio_streams));
memset(subtitle_streams, 0, sizeof(subtitle_streams)); memset(subtitle_streams, 0, sizeof(subtitle_streams));
audio_streams_num = 0; audio_streams_num = 0;
audio_streams_ptr = 0; audio_streams_ptr = 0;
subtitle_streams_num = 0; subtitle_streams_num = 0;
subtitle_streams_ptr = 0; subtitle_streams_ptr = 0;
@ -957,7 +949,7 @@ static void set_colorspace(struct SwsContext *sws,
static bool decode_video(AVPacket *pkt, AVFrame *frame, AVFrame *conv, struct SwsContext *sws) static bool decode_video(AVPacket *pkt, AVFrame *frame, AVFrame *conv, struct SwsContext *sws)
{ {
int got_ptr = 0; int got_ptr = 0;
int ret = avcodec_decode_video2(vctx, frame, &got_ptr, pkt); int ret = avcodec_decode_video2(vctx, frame, &got_ptr, pkt);
if (ret < 0) if (ret < 0)
return false; return false;
@ -1067,7 +1059,7 @@ static void decode_thread_seek(double time)
static void render_ass_img(AVFrame *conv_frame, ASS_Image *img) static void render_ass_img(AVFrame *conv_frame, ASS_Image *img)
{ {
uint32_t *frame = (uint32_t*)conv_frame->data[0]; uint32_t *frame = (uint32_t*)conv_frame->data[0];
int stride = conv_frame->linesize[0] / sizeof(uint32_t); int stride = conv_frame->linesize[0] / sizeof(uint32_t);
for (; img; img = img->next) for (; img; img = img->next)
{ {