]> git.sesse.net Git - vlc/commitdiff
Added BLOCK_TS_INVALID define to check against unset/invalid timestamp.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 25 Apr 2009 14:00:27 +0000 (16:00 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 25 Apr 2009 14:03:29 +0000 (16:03 +0200)
Its current value is 0 because of historical reasons. Once all the code
has been reviewed and changed to use BLOCK_TS_INVALID, we can then lower it
to INT64_MIN for example.

include/vlc_block.h
src/misc/block.c

index 7b1d6d017dd898361957b938ad14b16936093670..37d21badf027d34ab1a83db9f847a6dbe674e774 100644 (file)
@@ -37,7 +37,7 @@
  * - i_flags may not always be set (ie could be 0, even for a key frame
  *      it depends where you receive the buffer (before/after a packetizer
  *      and the demux/packetizer implementations.
- * - i_dts/i_pts could be 0, it means no pts
+ * - i_dts/i_pts could be BLOCK_TS_INVALID, it means no pts/dts
  * - i_length: length in microseond of the packet, can be null except in the
  *      sout where it is mandatory.
  * - i_rate 0 or a valid input rate, look at vlc_input.h
@@ -90,6 +90,10 @@ typedef struct block_sys_t block_sys_t;
 #define BLOCK_FLAG_PRIVATE_MASK  0xff000000
 #define BLOCK_FLAG_PRIVATE_SHIFT 24
 
+/* All timestamp below or equal to this define are invalid/unset
+ * XXX the numerical value is 0 because of historical reason and will change.*/
+#define BLOCK_TS_INVALID (0)
+
 typedef void (*block_free_t) (block_t *);
 
 struct block_t
index 001ddf2c4b2d574eaf7599dae92e7336696798c1..c60ce45980bdf20e2b80c4bc66004a2f2c054973 100644 (file)
@@ -59,7 +59,8 @@ void block_Init( block_t *restrict b, void *buf, size_t size )
     /* Fill all fields to their default */
     b->p_next = NULL;
     b->i_flags = 0;
-    b->i_pts = b->i_dts = b->i_length = 0;
+    b->i_pts = b->i_dts = BLOCK_TS_INVALID;
+    b->i_length = 0;
     b->i_rate = 0;
     b->p_buffer = buf;
     b->i_buffer = size;