|
|
@@ -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);
|