flacparse: use shift instead of mask & comp
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Thu, 31 Dec 2015 22:12:36 +0000 (14:12 -0800)
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Thu, 31 Dec 2015 22:12:36 +0000 (14:12 -0800)
We are only interested on the first bit of the first
byte of the metadata block header to figure out whether
is marked as the last one. The shift makes it quite
clearer.

gst/audioparsers/gstflacparse.c

index 86e84ea957a49e30f58dcedf1056bdb587c77a3e..98593b8b04b768b3845a4cffe5503d8f8c867989 100644 (file)
@@ -1558,7 +1558,7 @@ gst_flac_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame,
 
     res = GST_BASE_PARSE_FLOW_DROPPED;
   } else if (flacparse->state == GST_FLAC_PARSE_STATE_HEADERS) {
-    gboolean is_last = ((map.data[0] & 0x80) == 0x80);
+    gboolean is_last = map.data[0] >> 7;
     guint type = (map.data[0] & 0x7F);
 
     if (type == 127) {