gst/mpegstream/: and also fix integer overflows at high PTS values (see #126967).

Original commit message from CVS:
2004-01-03  Ronald Bultje  <rbultje@ronald.bitfreak.net>

* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_pes):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init):
* gst/mpegstream/gstmpegparse.h:
Remove clock (which was never provided, i.e. dead code), and
also fix integer overflows at high PTS values (see #126967).
This commit is contained in:
Ronald S. Bultje 2004-01-03 13:06:10 +00:00
parent 6356f06238
commit cc5aa11ece
4 changed files with 15 additions and 29 deletions

View file

@ -1,3 +1,12 @@
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_pes):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init),
(gst_mpeg_parse_init):
* gst/mpegstream/gstmpegparse.h:
Remove clock (which was never provided, i.e. dead code), and
also fix integer overflows at high PTS values (see #126967).
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/flac/gstflacdec.c:

View file

@ -746,14 +746,14 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
/* check for PTS */
if ((flags2 & 0x80)) {
/*if ((flags2 & 0x80) && id == 0xe0) { */
pts = (*buf++ & 0x0E) << 29;
pts |= *buf++ << 22;
pts |= (*buf++ & 0xFE) << 14;
pts |= *buf++ << 7;
pts |= (*buf++ & 0xFE) >> 1;
pts = ((guint64) (*buf++ & 0x0E)) << 29;
pts |= ((guint64) *buf++ ) << 22;
pts |= ((guint64) (*buf++ & 0xFE)) << 14;
pts |= ((guint64) *buf++ ) << 7;
pts |= ((guint64) (*buf++ & 0xFE)) >> 1;
GST_DEBUG ("%x PTS = %" G_GUINT64_FORMAT,
id, MPEGTIME_TO_GSTTIME (pts));
id, MPEGTIME_TO_GSTTIME (pts));
}
if ((flags2 & 0x40)) {

View file

@ -85,8 +85,6 @@ static GstElementStateReturn
gst_mpeg_parse_change_state (GstElement *element);
static void gst_mpeg_parse_set_clock (GstElement *element, GstClock *clock);
static GstClock* gst_mpeg_parse_get_clock (GstElement *element);
static GstClockTime gst_mpeg_parse_get_time (GstClock *clock, gpointer data);
static gboolean gst_mpeg_parse_parse_packhead (GstMPEGParse *mpeg_parse, GstBuffer *buffer);
static void gst_mpeg_parse_send_data (GstMPEGParse *mpeg_parse, GstData *data, GstClockTime time);
@ -158,7 +156,6 @@ gst_mpeg_parse_class_init (GstMPEGParseClass *klass)
gobject_class->set_property = gst_mpeg_parse_set_property;
gstelement_class->change_state = gst_mpeg_parse_change_state;
gstelement_class->get_clock = gst_mpeg_parse_get_clock;
gstelement_class->set_clock = gst_mpeg_parse_set_clock;
gstelement_class->get_index = gst_mpeg_parse_get_index;
gstelement_class->set_index = gst_mpeg_parse_set_index;
@ -206,21 +203,10 @@ gst_mpeg_parse_init (GstMPEGParse *mpeg_parse)
mpeg_parse->sync = FALSE;
mpeg_parse->id = NULL;
mpeg_parse->max_discont = DEFAULT_MAX_DISCONT;
mpeg_parse->provided_clock = gst_mpeg_clock_new ("MPEGParseClock",
gst_mpeg_parse_get_time, mpeg_parse);
GST_FLAG_SET (mpeg_parse, GST_ELEMENT_EVENT_AWARE);
}
static GstClock*
gst_mpeg_parse_get_clock (GstElement *element)
{
/* GstMPEGParse *parse = GST_MPEG_PARSE (element); */
/* return parse->provided_clock; */
return NULL;
}
static void
gst_mpeg_parse_set_clock (GstElement *element, GstClock *clock)
{
@ -229,14 +215,6 @@ gst_mpeg_parse_set_clock (GstElement *element, GstClock *clock)
parse->clock = clock;
}
static GstClockTime
gst_mpeg_parse_get_time (GstClock *clock, gpointer data)
{
GstMPEGParse *parse = GST_MPEG_PARSE (data);
return MPEGTIME_TO_GSTTIME (parse->current_scr);
}
#if 0
static void
gst_mpeg_parse_update_streaminfo (GstMPEGParse *mpeg_parse)

View file

@ -71,7 +71,6 @@ struct _GstMPEGParse {
gboolean scr_pending;
gint max_discont;
GstClock *provided_clock;
GstClock *clock;
gboolean sync;
GstClockID id;