mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
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:
parent
6356f06238
commit
cc5aa11ece
4 changed files with 15 additions and 29 deletions
|
@ -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>
|
2004-01-03 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* ext/flac/gstflacdec.c:
|
* ext/flac/gstflacdec.c:
|
||||||
|
|
|
@ -746,14 +746,14 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
|
||||||
/* check for PTS */
|
/* check for PTS */
|
||||||
if ((flags2 & 0x80)) {
|
if ((flags2 & 0x80)) {
|
||||||
/*if ((flags2 & 0x80) && id == 0xe0) { */
|
/*if ((flags2 & 0x80) && id == 0xe0) { */
|
||||||
pts = (*buf++ & 0x0E) << 29;
|
pts = ((guint64) (*buf++ & 0x0E)) << 29;
|
||||||
pts |= *buf++ << 22;
|
pts |= ((guint64) *buf++ ) << 22;
|
||||||
pts |= (*buf++ & 0xFE) << 14;
|
pts |= ((guint64) (*buf++ & 0xFE)) << 14;
|
||||||
pts |= *buf++ << 7;
|
pts |= ((guint64) *buf++ ) << 7;
|
||||||
pts |= (*buf++ & 0xFE) >> 1;
|
pts |= ((guint64) (*buf++ & 0xFE)) >> 1;
|
||||||
|
|
||||||
GST_DEBUG ("%x PTS = %" G_GUINT64_FORMAT,
|
GST_DEBUG ("%x PTS = %" G_GUINT64_FORMAT,
|
||||||
id, MPEGTIME_TO_GSTTIME (pts));
|
id, MPEGTIME_TO_GSTTIME (pts));
|
||||||
|
|
||||||
}
|
}
|
||||||
if ((flags2 & 0x40)) {
|
if ((flags2 & 0x40)) {
|
||||||
|
|
|
@ -85,8 +85,6 @@ static GstElementStateReturn
|
||||||
gst_mpeg_parse_change_state (GstElement *element);
|
gst_mpeg_parse_change_state (GstElement *element);
|
||||||
|
|
||||||
static void gst_mpeg_parse_set_clock (GstElement *element, GstClock *clock);
|
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 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);
|
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;
|
gobject_class->set_property = gst_mpeg_parse_set_property;
|
||||||
|
|
||||||
gstelement_class->change_state = gst_mpeg_parse_change_state;
|
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->set_clock = gst_mpeg_parse_set_clock;
|
||||||
gstelement_class->get_index = gst_mpeg_parse_get_index;
|
gstelement_class->get_index = gst_mpeg_parse_get_index;
|
||||||
gstelement_class->set_index = gst_mpeg_parse_set_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->sync = FALSE;
|
||||||
mpeg_parse->id = NULL;
|
mpeg_parse->id = NULL;
|
||||||
mpeg_parse->max_discont = DEFAULT_MAX_DISCONT;
|
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);
|
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
|
static void
|
||||||
gst_mpeg_parse_set_clock (GstElement *element, GstClock *clock)
|
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;
|
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
|
#if 0
|
||||||
static void
|
static void
|
||||||
gst_mpeg_parse_update_streaminfo (GstMPEGParse *mpeg_parse)
|
gst_mpeg_parse_update_streaminfo (GstMPEGParse *mpeg_parse)
|
||||||
|
|
|
@ -71,7 +71,6 @@ struct _GstMPEGParse {
|
||||||
gboolean scr_pending;
|
gboolean scr_pending;
|
||||||
gint max_discont;
|
gint max_discont;
|
||||||
|
|
||||||
GstClock *provided_clock;
|
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
gboolean sync;
|
gboolean sync;
|
||||||
GstClockID id;
|
GstClockID id;
|
||||||
|
|
Loading…
Reference in a new issue