+2005-01-05 Martin Eikermann <meiker@upb.de>
+
+ Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_class_init),
+ (gst_dvd_demux_handle_discont):
+ * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
+ (gst_mpeg_demux_handle_discont):
+ Recreate pads on new-media (#160730).
+ * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_new_pad):
+ Send discont even if manager changes timestamps (#161929).
+
2005-01-05 Sebastien Cote <sc5@hermes.usherb.ca>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
static void gst_dvd_demux_send_discont
(GstMPEGParse * mpeg_parse, GstClockTime time);
+static void gst_dvd_demux_handle_discont
+ (GstMPEGParse * mpeg_parse, GstEvent * event);
static gboolean gst_dvd_demux_handle_dvd_event
(GstDVDDemux * dvd_demux, GstEvent * event);
static void gst_dvd_demux_set_cur_subpicture
(GstDVDDemux * dvd_demux, gint stream_nr);
+static void gst_dvd_demux_reset (GstDVDDemux * dvd_demux);
+
+
static GstElementStateReturn gst_dvd_demux_change_state (GstElement * element);
static GstMPEGDemuxClass *parent_class = NULL;
gstelement_class->change_state = gst_dvd_demux_change_state;
mpeg_parse_class->send_discont = gst_dvd_demux_send_discont;
+ mpeg_parse_class->handle_discont = gst_dvd_demux_handle_discont;
mpeg_demux_class->get_audio_stream = gst_dvd_demux_get_audio_stream;
mpeg_demux_class->get_video_stream = gst_dvd_demux_get_video_stream;
}
}
+static void
+gst_dvd_demux_handle_discont (GstMPEGParse * mpeg_parse, GstEvent * event)
+{
+ GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_parse);
+
+ if (GST_EVENT_DISCONT_NEW_MEDIA (event)) {
+ gst_dvd_demux_reset (dvd_demux);
+ }
+
+ /* before we reset let parent handle and forward discont */
+ if (GST_MPEG_PARSE_CLASS (parent_class)->handle_discont != NULL)
+ GST_MPEG_PARSE_CLASS (parent_class)->handle_discont (mpeg_parse, event);
+}
+
static GstMPEGStream *
gst_dvd_demux_get_video_stream (GstMPEGDemux * mpeg_demux,
guint8 stream_nr, gint type, const gpointer info)
GstData * data, GstClockTime time);
static void gst_mpeg_demux_send_discont (GstMPEGParse * mpeg_parse,
GstClockTime time);
+static void gst_mpeg_demux_handle_discont (GstMPEGParse * mpeg_parse,
+ GstEvent * event);
+
static GstPad *gst_mpeg_demux_new_output_pad (GstMPEGDemux * mpeg_demux,
const gchar * name, GstPadTemplate * temp);
static gboolean gst_mpeg_demux_handle_src_event (GstPad * pad,
GstEvent * event);
+static void gst_mpeg_demux_reset (GstMPEGDemux * mpeg_demux);
+
static GstElementStateReturn gst_mpeg_demux_change_state (GstElement * element);
mpeg_parse_class->parse_pes = gst_mpeg_demux_parse_pes;
mpeg_parse_class->send_data = gst_mpeg_demux_send_data;
mpeg_parse_class->send_discont = gst_mpeg_demux_send_discont;
+ mpeg_parse_class->handle_discont = gst_mpeg_demux_handle_discont;
klass->new_output_pad = gst_mpeg_demux_new_output_pad;
klass->init_stream = gst_mpeg_demux_init_stream;
}
}
+static void
+gst_mpeg_demux_handle_discont (GstMPEGParse * mpeg_parse, GstEvent * event)
+{
+ GstMPEGDemux *mpeg_demux = GST_MPEG_DEMUX (mpeg_parse);
+
+ if (GST_EVENT_DISCONT_NEW_MEDIA (event)) {
+ gst_mpeg_demux_reset (mpeg_demux);
+ }
+
+ if (parent_class->handle_discont != NULL)
+ parent_class->handle_discont (mpeg_parse, event);
+}
+
static gint
_demux_get_writer_id (GstIndex * index, GstPad * pad)
{
* time. This is required because MPEG allows any sort of order of
* packets, including setting base time before defining streams or
* even adding streams halfway a stream. */
- if (!mpeg_parse->scr_pending && !mpeg_parse->do_adjust) {
+ if (!mpeg_parse->scr_pending) {
GstEvent *event = gst_event_new_discontinuous (FALSE,
GST_FORMAT_TIME,
(guint64) MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr +