Merge pull request #2048 from VodBox/webm-hwaccel
deps/media-playback: Use hardware decoding with non-alpha WebM files
This commit is contained in:
commit
f2ad6ab076
15
deps/media-playback/media-playback/decode.c
vendored
15
deps/media-playback/media-playback/decode.c
vendored
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user