bufferpool: Fix the buffer size reset code
[platform/upstream/gstreamer.git] / gst / printf / printf-parse.c
index 1502053..d045ae8 100644 (file)
 #include <stddef.h>
 
 /* Get intmax_t.  */
-#if HAVE_STDINT_H_WITH_UINTMAX
+#ifdef HAVE_STDINT_H_WITH_UINTMAX
 # include <stdint.h>
 #endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
+#ifdef HAVE_INTTYPES_H_WITH_UINTMAX
 # include <inttypes.h>
 #endif
 
@@ -256,6 +256,10 @@ printf_parse (const char *format, char_directives * d, arguments * a)
               cp += 3;
             }
 #endif
+            else if (cp[0] == 'I' && cp[1] == '3' && cp[2] == '2') {
+              //flags = 32;
+              cp += 3;
+            }
 #ifdef HAVE_INTMAX_T
             else if (*cp == 'j') {
               if (sizeof (intmax_t) > sizeof (long)) {
@@ -387,12 +391,20 @@ printf_parse (const char *format, char_directives * d, arguments * a)
               c = 's';
               break;
 #endif
+              /* Old GST_PTR_FORMAT, handle for binary backwards compatibility */
+            case 'P':
+              type = TYPE_POINTER_EXT;
+              dp->flags |= FLAG_PTR_EXT;
+              dp->ptr_ext_char = 'A';
+              c = 'p';
+              break;
             case 'p':
               /* Note: cp points already to the char after the 'p' now */
               if (cp[0] == POINTER_EXT_SIGNIFIER_CHAR && cp[1] != '\0') {
                 type = TYPE_POINTER_EXT;
                 dp->flags |= FLAG_PTR_EXT;
                 dp->ptr_ext_char = cp[1];
+                cp += 2;
                 /* we do not use dp->conversion='s' on purpose here, so we
                  * can fall back to printing just the pointer with %p if the
                  * serialisation function returned NULL for some reason */
@@ -400,6 +412,13 @@ printf_parse (const char *format, char_directives * d, arguments * a)
                 type = TYPE_POINTER;
               }
               break;
+              /* Old GST_SEGMENT_FORMAT, handle for backwards compatibility */
+            case 'Q':
+              type = TYPE_POINTER_EXT;
+              dp->flags |= FLAG_PTR_EXT;
+              dp->ptr_ext_char = 'B';
+              c = 'p';
+              break;
             case 'n':
 #ifdef HAVE_LONG_LONG
               if (flags >= 16 || (flags & 4))