Package: aiscm Version: 0.23.1-1 Followup-For: Bug #1004784 User: [email protected] Usertags: origin-ubuntu kinetic ubuntu-patch Control: tags -1 patch
Please see attached a patch that fixes this build failure. It has been uploaded to Ubuntu for the ffmpeg 5.0 transition. Thanks, -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer https://www.debian.org/ [email protected] [email protected]
diff -Nru aiscm-0.23.1/debian/patches/ffmpeg-5.0.patch aiscm-0.23.1/debian/patches/ffmpeg-5.0.patch --- aiscm-0.23.1/debian/patches/ffmpeg-5.0.patch 1969-12-31 16:00:00.000000000 -0800 +++ aiscm-0.23.1/debian/patches/ffmpeg-5.0.patch 2022-07-20 05:38:19.000000000 -0700 @@ -0,0 +1,152 @@ +Description: compatibility with FFMpeg 5.0 + AVCodecContext is now available only as a struct, not a raw type. +Author: Steve Langasek <[email protected]> +Bug-Debian: https://bugs.debian.org/1004784 +Last-Update: 2022-07-20 +Forwarded: no + +Index: aiscm-0.23.1/aiscm/ffmpeg.c +=================================================================== +--- aiscm-0.23.1.orig/aiscm/ffmpeg.c ++++ aiscm-0.23.1/aiscm/ffmpeg.c +@@ -60,8 +60,8 @@ + + struct ffmpeg_t { + AVFormatContext *fmt_ctx; +- AVCodecContext *video_codec_ctx; +- AVCodecContext *audio_codec_ctx; ++ struct AVCodecContext *video_codec_ctx; ++ struct AVCodecContext *audio_codec_ctx; + int video_stream_idx; + int audio_stream_idx; + long output_video_pts; +@@ -94,14 +94,14 @@ + return get_self_no_check(scm_self); + } + +-static AVCodecContext *video_codec_ctx(struct ffmpeg_t *self) ++static struct AVCodecContext *video_codec_ctx(struct ffmpeg_t *self) + { + if (!self->video_codec_ctx) + scm_misc_error("video-codec-ctx", "File format does not have a video stream", SCM_EOL); + return self->video_codec_ctx; + } + +-static AVCodecContext *audio_codec_ctx(struct ffmpeg_t *self) ++static struct AVCodecContext *audio_codec_ctx(struct ffmpeg_t *self) + { + if (!self->audio_codec_ctx) + scm_misc_error("audio-codec-ctx", "File format does not have an audio stream", SCM_EOL); +@@ -127,7 +127,7 @@ + return self->fmt_ctx->iformat != NULL; + } + +-static void write_frame(struct ffmpeg_t *self, AVPacket *packet, AVCodecContext *codec, AVStream *stream, int stream_idx) ++static void write_frame(struct ffmpeg_t *self, AVPacket *packet, struct AVCodecContext *codec, AVStream *stream, int stream_idx) + { + #ifdef HAVE_AV_PACKET_RESCALE_TS + av_packet_rescale_ts(packet, codec->time_base, stream->time_base); +@@ -144,7 +144,7 @@ + + static int encode_video(struct ffmpeg_t *self, AVFrame *video_frame) + { +- AVCodecContext *codec = video_codec_ctx(self); ++ struct AVCodecContext *codec = video_codec_ctx(self); + + // Initialise data packet + AVPacket pkt = { 0 }; +@@ -166,7 +166,7 @@ + + static int encode_audio(struct ffmpeg_t *self, AVFrame *audio_frame) + { +- AVCodecContext *codec = audio_codec_ctx(self); ++ struct AVCodecContext *codec = audio_codec_ctx(self); + + // Initialise data packet + AVPacket pkt = { 0 }; +@@ -267,7 +267,7 @@ + return 0; + } + +-static AVCodecContext *open_codec(SCM scm_self, AVCodecContext *codec_ctx, AVCodec *codec, ++static struct AVCodecContext *open_codec(SCM scm_self, struct AVCodecContext *codec_ctx, AVCodec *codec, + const char *media_type, SCM scm_file_name) + { + int err = avcodec_open2(codec_ctx, codec, NULL); +@@ -279,10 +279,10 @@ + return codec_ctx; + } + +-static AVCodecContext *open_decoder(SCM scm_self, SCM scm_file_name, ++static struct AVCodecContext *open_decoder(SCM scm_self, SCM scm_file_name, + AVStream *stream, const char *media_type) + { +- AVCodecContext *dec_ctx = stream->codec; ++ struct AVCodecContext *dec_ctx = stream->codec; + AVCodec *decoder = avcodec_find_decoder(dec_ctx->codec_id); + if (!decoder) { + ffmpeg_destroy(scm_self); +@@ -387,11 +387,11 @@ + return retval; + } + +-static AVCodecContext *configure_output_video_codec(AVStream *video_stream, enum AVCodecID video_codec_id, ++static struct AVCodecContext *configure_output_video_codec(AVStream *video_stream, enum AVCodecID video_codec_id, + SCM scm_video_bit_rate, SCM scm_shape, SCM scm_frame_rate, SCM scm_aspect_ratio) + { + // Get codec context +- AVCodecContext *retval = video_stream->codec; ++ struct AVCodecContext *retval = video_stream->codec; + + // Set codec id + retval->codec_id = video_codec_id; +@@ -427,11 +427,11 @@ + return retval; + } + +-static AVCodecContext *configure_output_audio_codec(SCM scm_self, AVStream *audio_stream, enum AVCodecID audio_codec_id, ++static struct AVCodecContext *configure_output_audio_codec(SCM scm_self, AVStream *audio_stream, enum AVCodecID audio_codec_id, + SCM scm_select_rate, SCM scm_channels, SCM scm_audio_bit_rate, SCM scm_select_format) + { + // Get codec context +- AVCodecContext *retval = audio_stream->codec; ++ struct AVCodecContext *retval = audio_stream->codec; + const AVCodec *codec = retval->codec; + + // Select sample format +@@ -471,7 +471,7 @@ + return retval; + } + +-static AVFrame *allocate_output_video_frame(SCM scm_self, AVCodecContext *video_context) ++static AVFrame *allocate_output_video_frame(SCM scm_self, struct AVCodecContext *video_context) + { + AVFrame *retval = allocate_frame(scm_self); + int width = video_context->width; +@@ -498,7 +498,7 @@ + return retval; + } + +-static AVFrame *allocate_output_audio_frame(SCM scm_self, AVCodecContext *audio_codec, enum AVSampleFormat sample_fmt) ++static AVFrame *allocate_output_audio_frame(SCM scm_self, struct AVCodecContext *audio_codec, enum AVSampleFormat sample_fmt) + { + AVFrame *retval = allocate_frame(scm_self); + retval->format = sample_fmt; +@@ -683,7 +683,7 @@ + + SCM ffmpeg_shape(SCM scm_self) + { +- AVCodecContext *ctx = video_codec_ctx(get_self(scm_self)); ++ struct AVCodecContext *ctx = video_codec_ctx(get_self(scm_self)); + return scm_list_2(scm_from_int(ctx->height), scm_from_int(ctx->width)); + } + +@@ -975,7 +975,7 @@ + SCM ffmpeg_encode_audio(SCM scm_self) + { + struct ffmpeg_t *self = get_self(scm_self); +- AVCodecContext *codec = audio_codec_ctx(self); ++ struct AVCodecContext *codec = audio_codec_ctx(self); + AVFrame *audio_frame = self->audio_target_frame; + audio_frame->pts = av_rescale_q(self->samples_count, (AVRational){1, codec->sample_rate}, codec->time_base); + self->samples_count += audio_frame->nb_samples; diff -Nru aiscm-0.23.1/debian/patches/series aiscm-0.23.1/debian/patches/series --- aiscm-0.23.1/debian/patches/series 1969-12-31 16:00:00.000000000 -0800 +++ aiscm-0.23.1/debian/patches/series 2022-07-20 05:34:18.000000000 -0700 @@ -0,0 +1 @@ +ffmpeg-5.0.patch

