(ffmpeg) Fixups

This commit is contained in:
twinaphex 2020-01-18 05:40:11 +01:00
parent ffd9b1bede
commit 64d3408188
3 changed files with 12 additions and 12 deletions

View File

@ -16,7 +16,7 @@ struct packet_buffer
packet_buffer_t *packet_buffer_create()
{
packet_buffer_t *b = malloc(sizeof(packet_buffer_t));
packet_buffer_t *b = (packet_buffer_t*)malloc(sizeof(packet_buffer_t));
if (!b)
return NULL;

View File

@ -25,14 +25,14 @@ struct video_buffer
video_buffer_t *video_buffer_create(size_t capacity, int frame_size, int width, int height)
{
video_buffer_t *b = malloc(sizeof(video_buffer_t));
video_buffer_t *b = (video_buffer_t*)malloc(sizeof(video_buffer_t));
if (!b)
return NULL;
memset(b, 0, sizeof(video_buffer_t));
b->capacity = capacity;
b->status = malloc(sizeof(enum kbStatus) * capacity);
b->status = (enum kbStatus*)malloc(sizeof(enum kbStatus) * capacity);
if (!b->status)
goto fail;
for (int i = 0; i < capacity; i++)
@ -44,21 +44,21 @@ video_buffer_t *video_buffer_create(size_t capacity, int frame_size, int width,
if (!b->lock || !b->open_cond || !b->finished_cond)
goto fail;
b->buffer = malloc(sizeof(video_decoder_context_t) * capacity);
b->buffer = (video_decoder_context_t*)malloc(sizeof(video_decoder_context_t) * capacity);
if (!b->buffer)
goto fail;
for (int i = 0; i < capacity; i++)
{
b->buffer[i].index = i;
b->buffer[i].pts = 0;
b->buffer[i].sws = sws_alloc_context();
b->buffer[i].source = av_frame_alloc();
b->buffer[i].index = i;
b->buffer[i].pts = 0;
b->buffer[i].sws = sws_alloc_context();
b->buffer[i].source = av_frame_alloc();
#if LIBAVUTIL_VERSION_MAJOR > 55
b->buffer[i].hw_source = av_frame_alloc();
#endif
b->buffer[i].target = av_frame_alloc();
b->buffer[i].frame_buf = av_malloc(frame_size);
b->buffer[i].target = av_frame_alloc();
b->buffer[i].frame_buf = (uint8_t*)av_malloc(frame_size);
avpicture_fill((AVPicture*)b->buffer[i].target, (const uint8_t*)b->buffer[i].frame_buf,
PIX_FMT_RGB32, width, height);

View File

@ -101,8 +101,8 @@ static tpool_work_t *tpool_work_get(tpool_t *tp)
static void tpool_worker(void *arg)
{
tpool_t *tp = arg;
tpool_work_t *work;
tpool_work_t *work = NULL;
tpool_t *tp = (tpool_t*)arg;
while (true)
{