gst/avi/gstavidemux.c: Properly handle end of segment. Closes #330885.

Original commit message from CVS:
Reviewed by: Edward Hervey  <edward@fluendo.com>
* gst/avi/gstavidemux.c: (gst_avi_demux_process_next_entry):
Properly handle end of segment. Closes #330885.
This commit is contained in:
Edward Hervey 2006-02-13 10:43:15 +00:00
parent c90eadd581
commit d502325ee9
2 changed files with 29 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2006-02-13 Mark Nauwelaerts <manauw@skynet.be>
Reviewed by: Edward Hervey <edward@fluendo.com>
* gst/avi/gstavidemux.c: (gst_avi_demux_process_next_entry):
Properly handle end of segment. Closes #330885.
2006-02-13 Wim Taymans <wim@fluendo.com>
* gst/rtp/gstrtpmp4gpay.h:

View file

@ -2268,14 +2268,7 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
if (avi->current_entry >= avi->index_size) {
GST_LOG_OBJECT (avi, "Handled last index entry, setting EOS (%d > %d)",
avi->current_entry, avi->index_size);
if (avi->segment_flags & GST_SEEK_FLAG_SEGMENT)
gst_element_post_message
(GST_ELEMENT (avi),
gst_message_new_segment_done (GST_OBJECT (avi), GST_FORMAT_TIME,
avi->segment_stop));
else
gst_avi_demux_send_event (avi, gst_event_new_eos ());
return GST_FLOW_WRONG_STATE;
goto eos;
} else {
GstBuffer *buf;
gst_avi_index_entry *entry = &avi->index_entries[avi->current_entry++];
@ -2287,6 +2280,16 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
continue;
}
if ((entry->flags & GST_RIFF_IF_KEYFRAME)
&& GST_CLOCK_TIME_IS_VALID (entry->ts)
&& GST_CLOCK_TIME_IS_VALID (avi->segment_stop)
&& (entry->ts > avi->segment_stop)) {
GST_LOG_OBJECT (avi, "Found keyframe after segment,"
" setting EOS (%" GST_TIME_FORMAT " > %" GST_TIME_FORMAT ")",
GST_TIME_ARGS (entry->ts), GST_TIME_ARGS (avi->segment_stop));
goto eos;
}
stream = &avi->stream[entry->stream_nr];
if (entry->size == 0 || !stream->pad) {
@ -2327,6 +2330,17 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
} while (!processed);
return GST_FLOW_OK;
eos:
/* handle end-of-stream/segment */
if (avi->segment_flags & GST_SEEK_FLAG_SEGMENT)
gst_element_post_message
(GST_ELEMENT (avi),
gst_message_new_segment_done (GST_OBJECT (avi), GST_FORMAT_TIME,
avi->segment_stop));
else
gst_avi_demux_send_event (avi, gst_event_new_eos ());
return GST_FLOW_WRONG_STATE;
}
/*