[vlc-commits] mediacodec: do not accept codecs declaring no capabilities

Felix Abecassis git at videolan.org
Wed Feb 19 16:42:34 CET 2014


vlc | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Wed Feb 19 16:36:09 2014 +0100| [93f201fbe17b194a16031a497e97704384501394] | committer: Jean-Baptiste Kempf

mediacodec: do not accept codecs declaring no capabilities

Previously, if profileLevels was NULL or length 0, the codec was
accepted.  Some devices have several codecs for mime type video/avc,
the first one is rejected based on the profile capability but the
second one was accepted since there was no capability declared. Since
the actual capability of the second codec was not better than the
first one, decoding failed.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93f201fbe17b194a16031a497e97704384501394
---

 modules/codec/omxil/android_mediacodec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index bc990b1..330997d 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -323,7 +323,7 @@ static int OpenDecoder(vlc_object_t *p_this)
                 /* The mime type is matching for this component. We
                    now check if the capabilities of the codec is
                    matching the video format. */
-                if (p_dec->fmt_in.i_codec == VLC_CODEC_H264 && fmt_profile && profile_levels_len) {
+                if (p_dec->fmt_in.i_codec == VLC_CODEC_H264 && fmt_profile) {
                     for (int i = 0; i < profile_levels_len && !found; ++i) {
                         jobject profile_level = (*env)->GetObjectArrayElement(env, profile_levels, i);
 



More information about the vlc-commits mailing list