--- 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 #include +#include #include #include #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;