提交 c2a2bc5e 编写于 作者: V VodBox 提交者: jp9000

deps/media-playback: Use hwaccel with non-alpha WebM files

上级 4f2c8ad4
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册