Skip to content

Commit 58cc373

Browse files
committed
ffmpeg: fix compilation for and before debian:trixie
1 parent c420110 commit 58cc373

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

device/dummy/buffer_list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ int dummy_buffer_list_open(buffer_list_t *buf_list)
3636

3737
buf_list->dummy->data = malloc(st.st_size);
3838
if (!buf_list->dummy->data) {
39-
LOG_ERROR(buf_list, "Can't allocate %ld bytes for %s", st.st_size, buf_list->dev->path);
39+
LOG_ERROR(buf_list, "Can't allocate %lld bytes for %s", (off64_t)st.st_size, buf_list->dev->path);
4040
}
4141

4242
buf_list->dummy->length = read(fd, buf_list->dummy->data, st.st_size);
4343
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);
44+
LOG_ERROR(buf_list, "Can't read %lld bytes for %s. Only read %zu.", (off64_t)st.st_size, buf_list->dev->path, buf_list->dummy->length);
4545
}
4646

4747
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)