Skip to content

Commit e426a09

Browse files
committed
ffmpeg: fix compilation for and before debian:trixie
1 parent 965652d commit e426a09

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

device/dummy/buffer_list.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "util/opts/log.h"
55

66
#include <stdlib.h>
7+
#include <inttypes.h>
78
#include <sys/types.h>
89
#include <sys/stat.h>
910

@@ -36,12 +37,12 @@ int dummy_buffer_list_open(buffer_list_t *buf_list)
3637

3738
buf_list->dummy->data = malloc(st.st_size);
3839
if (!buf_list->dummy->data) {
39-
LOG_ERROR(buf_list, "Can't allocate %ld bytes for %s", st.st_size, buf_list->dev->path);
40+
LOG_ERROR(buf_list, "Can't allocate %" PRId64 " bytes for %s", (off64_t)st.st_size, buf_list->dev->path);
4041
}
4142

4243
buf_list->dummy->length = read(fd, buf_list->dummy->data, st.st_size);
4344
if (!buf_list->dummy->data) {
44-
LOG_ERROR(buf_list, "Can't read %ld bytes for %s. Only read %zu.", st.st_size, buf_list->dev->path, buf_list->dummy->length);
45+
LOG_ERROR(buf_list, "Can't read %" PRId64 " bytes for %s. Only read %zu.", (off64_t)st.st_size, buf_list->dev->path, buf_list->dummy->length);
4546
}
4647

4748
close(fd);

util/ffmpeg/remuxer.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
static AVRational time_base = {1, 1000LL * 1000LL};
88
static unsigned avio_ctx_buffer_size = 4096;
99

10+
#if LIBAVFORMAT_VERSION_MAJOR < 61
11+
typedef int (*ffmpeg_write_nonconst_packet)(void *opaque, uint8_t *buf, int buf_size);
12+
#else // LIBAVFORMAT_VERSION_MAJOR < 61
13+
#define ffmpeg_write_nonconst_packet ffmpeg_write_packet
14+
#endif // LIBAVFORMAT_VERSION_MAJOR < 61
15+
1016
static int ffmpeg_remuxer_init_avcontext(AVFormatContext **context, ffmpeg_remuxer_t *remuxer, int output, ffmpeg_write_packet packet_out, ffmpeg_read_packet packet_in)
1117
{
1218
uint8_t *buffer = NULL;
@@ -20,7 +26,7 @@ static int ffmpeg_remuxer_init_avcontext(AVFormatContext **context, ffmpeg_remux
2026
buffer = av_malloc(buffer_size);
2127
if (!buffer)
2228
return AVERROR(ENOMEM);
23-
avio = avio_alloc_context(buffer, buffer_size, output, remuxer->opaque, packet_in, packet_out, NULL);
29+
avio = avio_alloc_context(buffer, buffer_size, output, remuxer->opaque, packet_in, (ffmpeg_write_nonconst_packet)packet_out, NULL);
2430
if (!avio)
2531
goto error;
2632
if (output && (ret = avformat_alloc_output_context2(context, NULL, remuxer->video_format, NULL)) < 0)

0 commit comments

Comments
 (0)