mpegvideoparse: Fix level code
authorEdward Hervey <edward.hervey@collabora.co.uk>
Fri, 2 Mar 2012 10:07:47 +0000 (11:07 +0100)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Fri, 2 Mar 2012 10:07:47 +0000 (11:07 +0100)
Valid ranges            are from 4 to 10
Valid ranges >> 1       are from 2 to 5
Valid ranges >> 1 - 2   are from 0 to 3

 (and not from 1 to 4)

gst/videoparsers/gstmpegvideoparse.c

index 8d19046..f00a795 100644 (file)
@@ -636,7 +636,7 @@ gst_mpegv_parse_update_src_caps (GstMpegvParse * mpvparse)
       profile = profiles[profile_c - 1];
 
     if ((level_c > 3) && (level_c < 11) && (level_c % 2 == 0))
-      level = levels[(level_c >> 1) - 1];
+      level = levels[(level_c >> 1) - 2];
 
     if (profile_c == 8) {
       /* Non-hierarchical profile */
@@ -664,6 +664,8 @@ gst_mpegv_parse_update_src_caps (GstMpegvParse * mpvparse)
 
     /* FIXME does it make sense to expose profile/level in the caps ? */
 
+    GST_DEBUG_OBJECT (mpvparse, "profile:'%s' level:'%s'", profile, level);
+
     if (profile)
       gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile, NULL);
     else