0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

Merge pull request #2048 from VodBox/webm-hwaccel

deps/media-playback: Use hardware decoding with non-alpha WebM files
This commit is contained in:
Jim 2019-08-28 08:31:02 -07:00 committed by GitHub
commit f2ad6ab076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,10 +142,17 @@ bool mp_decode_init(mp_media_t *m, enum AVMediaType type, bool hw)
id = stream->codec->codec_id;
#endif
if (id == AV_CODEC_ID_VP8)
d->codec = avcodec_find_decoder_by_name("libvpx");
else if (id == AV_CODEC_ID_VP9)
d->codec = avcodec_find_decoder_by_name("libvpx-vp9");
if (id == AV_CODEC_ID_VP8 || id == AV_CODEC_ID_VP9) {
AVDictionaryEntry *tag = NULL;
tag = av_dict_get(stream->metadata, "alpha_mode", tag,
AV_DICT_IGNORE_SUFFIX);
if (tag && strcmp(tag->value, "1") == 0) {
char *codec = (id == AV_CODEC_ID_VP8) ? "libvpx"
: "libvpx-vp9";
d->codec = avcodec_find_decoder_by_name(codec);
}
}
if (!d->codec)
d->codec = avcodec_find_decoder(id);