Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 834421
Collapse All | Expand All

(-)file_not_specified_in_diff (-15 / +24 lines)
Line  Link Here
0
-- a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
0
++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.cpp
Lines 154-160 void FormatDeleter::operator()(AVFormatC Link Here
154
	}
154
	}
155
}
155
}
156
156
157
AVCodec *FindDecoder(not_null<AVCodecContext*> context) {
157
const AVCodec *FindDecoder(not_null<AVCodecContext*> context) {
158
	// Force libvpx-vp9, because we need alpha channel support.
158
	// Force libvpx-vp9, because we need alpha channel support.
159
	return (context->codec_id == AV_CODEC_ID_VP9)
159
	return (context->codec_id == AV_CODEC_ID_VP9)
160
		? avcodec_find_decoder_by_name("libvpx-vp9")
160
		? avcodec_find_decoder_by_name("libvpx-vp9")
161
-- a/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.h
161
++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_utility.h
Lines 158-164 using SwscalePointer = std::unique_ptr<S Link Here
158
void LogError(QLatin1String method);
158
void LogError(QLatin1String method);
159
void LogError(QLatin1String method, FFmpeg::AvErrorWrap error);
159
void LogError(QLatin1String method, FFmpeg::AvErrorWrap error);
160
160
161
[[nodiscard]] AVCodec *FindDecoder(not_null<AVCodecContext*> context);
161
[[nodiscard]] const AVCodec *FindDecoder(not_null<AVCodecContext*> context);
162
[[nodiscard]] crl::time PtsToTime(int64_t pts, AVRational timeBase);
162
[[nodiscard]] crl::time PtsToTime(int64_t pts, AVRational timeBase);
163
// Used for full duration conversion.
163
// Used for full duration conversion.
164
[[nodiscard]] crl::time PtsToTimeCeil(int64_t pts, AVRational timeBase);
164
[[nodiscard]] crl::time PtsToTimeCeil(int64_t pts, AVRational timeBase);
165
-- a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
165
++ b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
Lines 147-153 struct Instance::Inner::Private { Link Here
147
	AVIOContext *ioContext = nullptr;
147
	AVIOContext *ioContext = nullptr;
148
	AVFormatContext *fmtContext = nullptr;
148
	AVFormatContext *fmtContext = nullptr;
149
	AVStream *stream = nullptr;
149
	AVStream *stream = nullptr;
150
	AVCodec *codec = nullptr;
150
	const AVCodec *codec = nullptr;
151
	AVCodecContext *codecContext = nullptr;
151
	AVCodecContext *codecContext = nullptr;
152
	bool opened = false;
152
	bool opened = false;
153
	bool processing = false;
153
	bool processing = false;
154
-- a/Telegram/SourceFiles/media/audio/media_audio_ffmpeg_loader.h
154
++ b/Telegram/SourceFiles/media/audio/media_audio_ffmpeg_loader.h
Lines 60-65 protected: Link Here
60
	uchar *ioBuffer = nullptr;
60
	uchar *ioBuffer = nullptr;
61
	AVIOContext *ioContext = nullptr;
61
	AVIOContext *ioContext = nullptr;
62
	AVFormatContext *fmtContext = nullptr;
62
	AVFormatContext *fmtContext = nullptr;
63
#if LIBAVFORMAT_VERSION_MAJOR >= 59
64
	const
65
#endif
63
	AVCodec *codec = nullptr;
66
	AVCodec *codec = nullptr;
64
	int32 streamId = 0;
67
	int32 streamId = 0;
65
68
66
-- a/Telegram/SourceFiles/media/streaming/media_streaming_file.cpp
69
++ b/Telegram/SourceFiles/media/streaming/media_streaming_file.cpp
Lines 23-30 constexpr auto kMaxQueuedPackets = 1024; Link Here
23
		not_null<AVStream*> stream,
23
		not_null<AVStream*> stream,
24
		Mode mode) {
24
		Mode mode) {
25
	return (mode == Mode::Video || mode == Mode::Inspection)
25
	return (mode == Mode::Video || mode == Mode::Inspection)
26
		&& stream->codec
26
		&& stream->codecpar
27
		&& (stream->codec->codec_id == AV_CODEC_ID_VP9)
27
		&& (stream->codecpar->codec_id == AV_CODEC_ID_VP9)
28
		&& format->iformat
28
		&& format->iformat
29
		&& format->iformat->name
29
		&& format->iformat->name
30
		&& QString::fromLatin1(
30
		&& QString::fromLatin1(
31
-- a/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
31
++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/AudioStreamingPart.cpp
Lines 170-175 public: Link Here
170
170
171
        _frame = av_frame_alloc();
171
        _frame = av_frame_alloc();
172
172
173
#if LIBAVFORMAT_VERSION_MAJOR >= 59
174
        const
175
#endif
173
        AVInputFormat *inputFormat = av_find_input_format("ogg");
176
        AVInputFormat *inputFormat = av_find_input_format("ogg");
174
        if (!inputFormat) {
177
        if (!inputFormat) {
175
            _didReadToEnd = true;
178
            _didReadToEnd = true;
Lines 209-215 public: Link Here
209
            audioCodecParameters = inCodecpar;
212
            audioCodecParameters = inCodecpar;
210
            audioStream = inStream;
213
            audioStream = inStream;
211
214
212
            _durationInMilliseconds = (int)((inStream->duration + inStream->first_dts) * 1000 / 48000);
215
            _durationInMilliseconds = (int)(inStream->duration * av_q2d(inStream->time_base) * 1000);
213
216
214
            if (inStream->metadata) {
217
            if (inStream->metadata) {
215
                AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
218
                AVDictionaryEntry *entry = av_dict_get(inStream->metadata, "TG_META", nullptr, 0);
Lines 255-261 public: Link Here
255
        }
258
        }
256
259
257
        if (audioCodecParameters && audioStream) {
260
        if (audioCodecParameters && audioStream) {
258
            AVCodec *codec = avcodec_find_decoder(audioCodecParameters->codec_id);
261
            const AVCodec *codec = avcodec_find_decoder(audioCodecParameters->codec_id);
259
            if (codec) {
262
            if (codec) {
260
                _codecContext = avcodec_alloc_context3(codec);
263
                _codecContext = avcodec_alloc_context3(codec);
261
                ret = avcodec_parameters_to_context(_codecContext, audioCodecParameters);
264
                ret = avcodec_parameters_to_context(_codecContext, audioCodecParameters);
262
-- a/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
265
++ b/Telegram/ThirdParty/tgcalls/tgcalls/group/VideoStreamingPart.cpp
Lines 337-342 public: Link Here
337
337
338
        int ret = 0;
338
        int ret = 0;
339
339
340
#if LIBAVFORMAT_VERSION_MAJOR >= 59
341
        const
342
#endif
340
        AVInputFormat *inputFormat = av_find_input_format(container.c_str());
343
        AVInputFormat *inputFormat = av_find_input_format(container.c_str());
341
        if (!inputFormat) {
344
        if (!inputFormat) {
342
            _didReadToEnd = true;
345
            _didReadToEnd = true;
Lines 380-386 public: Link Here
380
        }
383
        }
381
384
382
        if (videoCodecParameters && videoStream) {
385
        if (videoCodecParameters && videoStream) {
383
            AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
386
            const AVCodec *codec = avcodec_find_decoder(videoCodecParameters->codec_id);
384
            if (codec) {
387
            if (codec) {
385
                _codecContext = avcodec_alloc_context3(codec);
388
                _codecContext = avcodec_alloc_context3(codec);
386
                ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters);
389
                ret = avcodec_parameters_to_context(_codecContext, videoCodecParameters);

Return to bug 834421