gst/mpegstream/: Reset last_flow values for the various streams after a flushing seek, otherwise we might aggregate w...

Original commit message from CVS:
Based on patch by: Mark Nauwelaerts  <manauw skynet be>
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_streams_reset_last_flow):
* gst/mpegstream/gstmpegdemux.h:
Reset last_flow values for the various streams after a flushing
seek, otherwise we might aggregate wrong flow returns afterwards
that will make upstream pause silently. This should fix seeking
in DVDs and also fix the Thoggen cropping dialog (#438610).
This commit is contained in:
Mark Nauwelaerts 2007-05-16 12:48:43 +00:00 committed by Tim-Philipp Müller
parent 08c63b6800
commit 971b4e3614
5 changed files with 65 additions and 3 deletions

View file

@ -1,3 +1,16 @@
2007-05-16 Tim-Philipp Müller <tim at centricular dot net>
Based on patch by: Mark Nauwelaerts <manauw skynet be>
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
(gst_mpeg_demux_process_event), (gst_mpeg_streams_reset_last_flow):
* gst/mpegstream/gstmpegdemux.h:
Reset last_flow values for the various streams after a flushing
seek, otherwise we might aggregate wrong flow returns afterwards
that will make upstream pause silently. This should fix seeking
in DVDs and also fix the Thoggen cropping dialog (#438610).
2007-05-07 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_reset),

2
common

@ -1 +1 @@
Subproject commit 61edc2dc7b8eba179d85a6545e46e0d65239e94d
Subproject commit b5971d76ccd216c27e095c02c3a369a9d05cb36d

View file

@ -319,6 +319,10 @@ gst_dvd_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event)
dvd_demux->segment_filter = TRUE;
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
event);
/* parent class will have reset the other streams */
gst_mpeg_streams_reset_last_flow (dvd_demux->subpicture_stream,
GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS);
break;
case GST_EVENT_CUSTOM_DOWNSTREAM:
case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:

View file

@ -92,6 +92,9 @@ GST_BOILERPLATE_FULL (GstMPEGDemux, gst_mpeg_demux, GstMPEGParse,
static void gst_mpeg_demux_class_init (GstMPEGDemuxClass * klass);
static gboolean gst_mpeg_demux_process_event (GstMPEGParse * mpeg_parse,
GstEvent * event);
static GstPad *gst_mpeg_demux_new_output_pad (GstMPEGDemux * mpeg_demux,
const gchar * name, GstPadTemplate * temp);
static void gst_mpeg_demux_init_stream (GstMPEGDemux * mpeg_demux,
@ -190,6 +193,7 @@ gst_mpeg_demux_class_init (GstMPEGDemuxClass * klass)
mpeg_parse_class->parse_packet = gst_mpeg_demux_parse_packet;
mpeg_parse_class->parse_pes = gst_mpeg_demux_parse_pes;
mpeg_parse_class->send_buffer = NULL;
mpeg_parse_class->process_event = gst_mpeg_demux_process_event;
klass->new_output_pad = gst_mpeg_demux_new_output_pad;
klass->init_stream = gst_mpeg_demux_init_stream;
@ -229,6 +233,34 @@ gst_mpeg_demux_init (GstMPEGDemux * mpeg_demux, GstMPEGDemuxClass * klass)
mpeg_demux->last_pts = -1;
}
static gboolean
gst_mpeg_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event)
{
GstMPEGDemux *demux = GST_MPEG_DEMUX (mpeg_parse);
gboolean ret;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_STOP:
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
event);
gst_mpeg_streams_reset_last_flow (demux->video_stream,
GST_MPEG_DEMUX_NUM_VIDEO_STREAMS);
gst_mpeg_streams_reset_last_flow (demux->audio_stream,
GST_MPEG_DEMUX_NUM_AUDIO_STREAMS);
gst_mpeg_streams_reset_last_flow (demux->private_stream,
GST_MPEG_DEMUX_NUM_PRIVATE_STREAMS);
break;
default:
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
event);
break;
}
return ret;
}
static gint
_demux_get_writer_id (GstIndex * index, GstPad * pad)
{
@ -1310,6 +1342,16 @@ gst_mpeg_demux_get_index (GstElement * element)
return mpeg_demux->index;
}
void
gst_mpeg_streams_reset_last_flow (GstMPEGStream * streams[], guint num)
{
guint i;
for (i = 0; i < num; ++i) {
if (streams[i] != NULL)
streams[i]->last_flow = GST_FLOW_OK;
}
}
gboolean
gst_mpeg_demux_plugin_init (GstPlugin * plugin)

View file

@ -204,9 +204,12 @@ struct _GstMPEGDemuxClass {
GstClockTime last_ts);
};
GType gst_mpeg_demux_get_type (void);
void gst_mpeg_streams_reset_last_flow (GstMPEGStream *streams[],
guint num);
gboolean gst_mpeg_demux_plugin_init (GstPlugin *plugin);
GType gst_mpeg_demux_get_type (void);
gboolean gst_mpeg_demux_plugin_init (GstPlugin *plugin);
G_END_DECLS