diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2013-01-01 11:56:16 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-01-01 11:59:39 +0000 |
commit | d1e9a96a69a0eca498c25c1db42115a187969a55 (patch) | |
tree | 814281b62debb8cb0c6b082dba3c42079d7554a5 /gst/mpegpsmux/mpegpsmux.h | |
parent | 9e1faac4df6e27e061cb0ea2d8cb50bd690327ee (diff) | |
download | gstreamer-plugins-bad-d1e9a96a69a0eca498c25c1db42115a187969a55.tar.gz |
mpegpsmux: use DTS in addition to PTS
And refactor choose_best_stream() a little.
videotestsrc pattern=ball ! x264enc ! mpegpsmux ! ...
plays much nicer now.
Diffstat (limited to 'gst/mpegpsmux/mpegpsmux.h')
-rw-r--r-- | gst/mpegpsmux/mpegpsmux.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gst/mpegpsmux/mpegpsmux.h b/gst/mpegpsmux/mpegpsmux.h index a5002b457..c04edf4ed 100644 --- a/gst/mpegpsmux/mpegpsmux.h +++ b/gst/mpegpsmux/mpegpsmux.h @@ -94,9 +94,16 @@ struct MpegPsPadData { guint8 stream_id_ext; PsMuxStream *stream; - GstBuffer *queued_buf; /* Currently pulled buffer */ - GstClockTime cur_ts; /* Adjusted TS for the pulled buffer */ - GstClockTime last_ts; /* Most recent valid TS for this stream */ + /* Currently pulled buffer */ + struct { + GstBuffer *buf; + GstClockTime ts; /* adjusted TS = MIN (DTS, PTS) for the pulled buffer */ + GstClockTime pts; /* adjusted PTS (running time) */ + GstClockTime dts; /* adjusted DTS (running time) */ + } queued; + + /* Most recent valid TS (DTS or PTS) for this stream */ + GstClockTime last_ts; GstBuffer * codec_data; /* Optional codec data available in the caps */ @@ -110,10 +117,10 @@ GType mpegpsmux_get_type (void); #define CLOCK_BASE 9LL #define CLOCK_FREQ (CLOCK_BASE * 10000) -#define MPEGTIME_TO_GSTTIME(time) (gst_util_uint64_scale ((time), \ - GST_MSECOND/10, CLOCK_BASE)) -#define GSTTIME_TO_MPEGTIME(time) (gst_util_uint64_scale ((time), \ - CLOCK_BASE, GST_MSECOND/10)) +#define GSTTIME_TO_MPEGTIME(time) \ + (GST_CLOCK_TIME_IS_VALID(time) ? \ + gst_util_uint64_scale ((time), CLOCK_BASE, GST_MSECOND/10) : \ + -1) #define NORMAL_TS_PACKET_LENGTH 188 #define M2TS_PACKET_LENGTH 192 |