+2006-10-10 Wim Taymans <wim@fluendo.com>
+
+ * ext/mpeg2dec/gstmpeg2dec.c: (handle_slice):
+ * ext/mpeg2dec/gstmpeg2dec.h:
+ Add some debugging to timestamp handling.
+ Make sure we don't convert invalid timestamps.
+
2006-10-09 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_sink_event),
time = GST_CLOCK_TIME_NONE;
#if MPEG2_RELEASE < MPEG2_VERSION(0,4,0)
- if (picture->flags & PIC_FLAG_PTS)
+ if (picture->flags & PIC_FLAG_PTS) {
time = MPEG_TIME_TO_GST_TIME (picture->pts);
+ GST_DEBUG_OBJECT (mpeg2dec, "picture pts %" G_GUINT64_FORMAT
+ ", time %" GST_TIME_FORMAT, picture->pts, GST_TIME_ARGS (time));
+ }
#else
- if (picture->flags & PIC_FLAG_TAGS)
- time = MPEG_TIME_TO_GST_TIME ((GstClockTime) (picture->
- tag2) << 32 | picture->tag);
+ if (picture->flags & PIC_FLAG_TAGS) {
+ guint64 pts = (((guint64) picture->tag2) << 32) | picture->tag;
+
+ time = MPEG_TIME_TO_GST_TIME (pts);
+ GST_DEBUG_OBJECT (mpeg2dec, "picture tags %" G_GUINT64_FORMAT
+ ", time %" GST_TIME_FORMAT, pts, GST_TIME_ARGS (time));
+ }
#endif
if (time == GST_CLOCK_TIME_NONE) {
#define GST_IS_MPEG2DEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MPEG2DEC))
-#define MPEG_TIME_TO_GST_TIME(time) (((time) * (GST_MSECOND/10)) / 9LL)
-#define GST_TIME_TO_MPEG_TIME(time) (((time) * 9LL) / (GST_MSECOND/10))
+#define MPEG_TIME_TO_GST_TIME(time) ((time) == -1 ? -1 : ((time) * (GST_MSECOND/10)) / 9LL)
+#define GST_TIME_TO_MPEG_TIME(time) ((time) == -1 ? -1 : ((time) * 9LL) / (GST_MSECOND/10))
typedef struct _GstMpeg2dec GstMpeg2dec;
typedef struct _GstMpeg2decClass GstMpeg2decClass;