(ffmpeg) Style nits
This commit is contained in:
parent
bdbd3098dd
commit
d7ebb49fd0
|
@ -792,8 +792,10 @@ static bool codec_id_is_ass(enum AVCodecID id)
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -802,13 +804,14 @@ static bool open_codecs(void)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
video_stream = -1;
|
video_stream = -1;
|
||||||
memset(audio_streams, 0, sizeof(audio_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;
|
||||||
|
|
||||||
|
memset(audio_streams, 0, sizeof(audio_streams));
|
||||||
|
memset(subtitle_streams, 0, sizeof(subtitle_streams));
|
||||||
|
|
||||||
for (i = 0; i < fctx->nb_streams; i++)
|
for (i = 0; i < fctx->nb_streams; i++)
|
||||||
{
|
{
|
||||||
switch (fctx->streams[i]->codec->codec_type)
|
switch (fctx->streams[i]->codec->codec_type)
|
||||||
|
@ -862,8 +865,8 @@ static bool open_codecs(void)
|
||||||
AVCodecContext *ctx = fctx->streams[i]->codec;
|
AVCodecContext *ctx = fctx->streams[i]->codec;
|
||||||
if (codec_id_is_ttf(ctx->codec_id))
|
if (codec_id_is_ttf(ctx->codec_id))
|
||||||
append_attachment(ctx->extradata, ctx->extradata_size);
|
append_attachment(ctx->extradata, ctx->extradata_size);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -883,7 +886,8 @@ static bool init_media_info(void)
|
||||||
{
|
{
|
||||||
media.width = vctx->width;
|
media.width = vctx->width;
|
||||||
media.height = vctx->height;
|
media.height = vctx->height;
|
||||||
media.aspect = (float)vctx->width * av_q2d(vctx->sample_aspect_ratio) / vctx->height;
|
media.aspect = (float)vctx->width *
|
||||||
|
av_q2d(vctx->sample_aspect_ratio) / vctx->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SSA
|
#ifdef HAVE_SSA
|
||||||
|
@ -895,7 +899,8 @@ static bool init_media_info(void)
|
||||||
ass_set_message_cb(ass, ass_msg_cb, NULL);
|
ass_set_message_cb(ass, ass_msg_cb, NULL);
|
||||||
|
|
||||||
for (i = 0; i < attachments_size; i++)
|
for (i = 0; i < attachments_size; i++)
|
||||||
ass_add_font(ass, (char*)"", (char*)attachments[i].data, attachments[i].size);
|
ass_add_font(ass, (char*)"",
|
||||||
|
(char*)attachments[i].data, attachments[i].size);
|
||||||
|
|
||||||
ass_render = ass_renderer_init(ass);
|
ass_render = ass_renderer_init(ass);
|
||||||
ass_set_frame_size(ass_render, media.width, media.height);
|
ass_set_frame_size(ass_render, media.width, media.height);
|
||||||
|
@ -916,7 +921,8 @@ static bool init_media_info(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_colorspace(struct SwsContext *sws,
|
static void set_colorspace(struct SwsContext *sws,
|
||||||
unsigned width, unsigned height, enum AVColorSpace default_color, int in_range)
|
unsigned width, unsigned height,
|
||||||
|
enum AVColorSpace default_color, int in_range)
|
||||||
{
|
{
|
||||||
const int *coeffs = NULL;
|
const int *coeffs = NULL;
|
||||||
|
|
||||||
|
@ -951,7 +957,8 @@ 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);
|
||||||
|
@ -971,7 +978,8 @@ static bool decode_video(AVPacket *pkt, AVFrame *frame, AVFrame *conv, struct Sw
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt, AVFrame *frame, int16_t *buffer, size_t *buffer_cap,
|
static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt,
|
||||||
|
AVFrame *frame, int16_t *buffer, size_t *buffer_cap,
|
||||||
SwrContext *swr)
|
SwrContext *swr)
|
||||||
{
|
{
|
||||||
AVPacket pkt_tmp = *pkt;
|
AVPacket pkt_tmp = *pkt;
|
||||||
|
@ -1020,7 +1028,9 @@ static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt, AVFrame *frame,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
decode_last_audio_time = pts * av_q2d(fctx->streams[audio_streams[audio_streams_ptr]]->time_base);
|
decode_last_audio_time = pts * av_q2d(
|
||||||
|
fctx->streams[audio_streams[audio_streams_ptr]]->time_base);
|
||||||
|
|
||||||
if (!decode_thread_dead)
|
if (!decode_thread_dead)
|
||||||
fifo_write(audio_decode_fifo, buffer, required_buffer);
|
fifo_write(audio_decode_fifo, buffer, required_buffer);
|
||||||
|
|
||||||
|
@ -1101,7 +1111,8 @@ static void render_ass_img(AVFrame *conv_frame, ASS_Image *img)
|
||||||
dst_g = (g * src_alpha + dst_g * dst_alpha) >> 8;
|
dst_g = (g * src_alpha + dst_g * dst_alpha) >> 8;
|
||||||
dst_b = (b * src_alpha + dst_b * dst_alpha) >> 8;
|
dst_b = (b * src_alpha + dst_b * dst_alpha) >> 8;
|
||||||
|
|
||||||
dst[x] = (0xffu << 24) | (dst_r << 16) | (dst_g << 8) | (dst_b << 0);
|
dst[x] = (0xffu << 24) | (dst_r << 16) |
|
||||||
|
(dst_g << 8) | (dst_b << 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1285,7 +1296,8 @@ static void decode_thread(void *data)
|
||||||
for (i = 0; i < sub.num_rects; i++)
|
for (i = 0; i < sub.num_rects; i++)
|
||||||
{
|
{
|
||||||
if (sub.rects[i]->ass)
|
if (sub.rects[i]->ass)
|
||||||
ass_process_data(ass_track_active, sub.rects[i]->ass, strlen(sub.rects[i]->ass));
|
ass_process_data(ass_track_active,
|
||||||
|
sub.rects[i]->ass, strlen(sub.rects[i]->ass));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1406,14 +1418,16 @@ static void context_reset(void)
|
||||||
#if !defined(HAVE_OPENGLES)
|
#if !defined(HAVE_OPENGLES)
|
||||||
glGenBuffers(1, &frames[i].pbo);
|
glGenBuffers(1, &frames[i].pbo);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, frames[i].pbo);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, frames[i].pbo);
|
||||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, media.width * media.height * sizeof(uint32_t), NULL, GL_STREAM_DRAW);
|
glBufferData(GL_PIXEL_UNPACK_BUFFER, media.width
|
||||||
|
* media.height * sizeof(uint32_t), NULL, GL_STREAM_DRAW);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
glGenBuffers(1, &vbo);
|
glGenBuffers(1, &vbo);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
glBindBuffer(GL_ARRAY_BUFFER, vbo);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER,
|
||||||
|
sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
@ -1569,7 +1583,8 @@ bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
||||||
|
|
||||||
if (video_stream >= 0 || is_glfft)
|
if (video_stream >= 0 || is_glfft)
|
||||||
{
|
{
|
||||||
video_decode_fifo = fifo_new(media.width * media.height * sizeof(uint32_t) * 32);
|
video_decode_fifo = fifo_new(media.width
|
||||||
|
* media.height * sizeof(uint32_t) * 32);
|
||||||
|
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
use_gl = true;
|
use_gl = true;
|
||||||
|
|
Loading…
Reference in New Issue