You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.9 KiB
64 lines
1.9 KiB
2 years ago
|
--- a/decoder_plugins/ffmpeg/ffmpeg.orig.c 2020-02-19 22:47:44.000000000 +0100
|
||
|
+++ b/decoder_plugins/ffmpeg/ffmpeg.c 2022-01-05 22:14:24.095941842 +0100
|
||
|
@@ -32,6 +32,7 @@
|
||
|
#include <stdint.h>
|
||
|
#include <errno.h>
|
||
|
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <libavformat/avformat.h>
|
||
|
#include <libavutil/mathematics.h>
|
||
|
#if HAVE_LIBAVUTIL_CHANNEL_LAYOUT_H
|
||
|
--- a/decoder_plugins/ffmpeg/ffmpeg.c 2022-02-07 15:26:04.819317207 +1300
|
||
|
+++ b/decoder_plugins/ffmpeg/ffmpeg.c 2022-02-07 15:36:40.767288638 +1300
|
||
|
@@ -79,7 +79,7 @@ struct ffmpeg_data
|
||
|
AVIOContext *pb;
|
||
|
AVStream *stream;
|
||
|
AVCodecContext *enc;
|
||
|
- AVCodec *codec;
|
||
|
+ const AVCodec *codec;
|
||
|
|
||
|
char *remain_buf;
|
||
|
int remain_buf_len;
|
||
|
@@ -848,7 +848,7 @@ static int ffmpeg_can_decode (struct io_
|
||
|
{
|
||
|
int res;
|
||
|
AVProbeData probe_data;
|
||
|
- AVInputFormat *fmt;
|
||
|
+ const AVInputFormat *fmt;
|
||
|
char buf[8096 + AVPROBE_PADDING_SIZE] = {0};
|
||
|
|
||
|
res = io_peek (stream, buf, sizeof (buf));
|
||
|
@@ -1411,7 +1411,7 @@ static int ffmpeg_our_format_ext (const
|
||
|
|
||
|
static int ffmpeg_our_format_mime (const char *mime_type)
|
||
|
{
|
||
|
- AVOutputFormat *fmt;
|
||
|
+ const AVOutputFormat *fmt;
|
||
|
|
||
|
fmt = av_guess_format (NULL, NULL, mime_type);
|
||
|
return fmt ? 1 : 0;
|
||
|
--- a/decoder_plugins/ffmpeg/ffmpeg.c 2022-02-08 10:15:49.468786495 +1300
|
||
|
+++ b/decoder_plugins/ffmpeg/ffmpeg.c 2022-02-08 10:17:23.894780498 +1300
|
||
|
@@ -1172,7 +1172,7 @@ static bool seek_in_stream (struct ffmpe
|
||
|
static bool seek_in_stream (struct ffmpeg_data *data, int sec)
|
||
|
#endif
|
||
|
{
|
||
|
- int rc, flags = AVSEEK_FLAG_ANY;
|
||
|
+ int rc;
|
||
|
int64_t seek_ts;
|
||
|
|
||
|
#if SEEK_IN_DECODER
|
||
|
@@ -1198,10 +1198,8 @@ static bool seek_in_stream (struct ffmpe
|
||
|
seek_ts += data->stream->start_time;
|
||
|
}
|
||
|
|
||
|
- if (data->stream->cur_dts > seek_ts)
|
||
|
- flags |= AVSEEK_FLAG_BACKWARD;
|
||
|
-
|
||
|
- rc = av_seek_frame (data->ic, data->stream->index, seek_ts, flags);
|
||
|
+ rc = av_seek_frame (data->ic, data->stream->index, seek_ts,
|
||
|
+ AVSEEK_FLAG_BACKWARD);
|
||
|
if (rc < 0) {
|
||
|
log_errno ("Seek error", rc);
|
||
|
return false;
|