mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
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:
parent
c90eadd581
commit
d502325ee9
2 changed files with 29 additions and 8 deletions
|
@ -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>
|
2006-02-13 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/rtp/gstrtpmp4gpay.h:
|
* gst/rtp/gstrtpmp4gpay.h:
|
||||||
|
|
|
@ -2268,14 +2268,7 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
|
||||||
if (avi->current_entry >= avi->index_size) {
|
if (avi->current_entry >= avi->index_size) {
|
||||||
GST_LOG_OBJECT (avi, "Handled last index entry, setting EOS (%d > %d)",
|
GST_LOG_OBJECT (avi, "Handled last index entry, setting EOS (%d > %d)",
|
||||||
avi->current_entry, avi->index_size);
|
avi->current_entry, avi->index_size);
|
||||||
if (avi->segment_flags & GST_SEEK_FLAG_SEGMENT)
|
goto eos;
|
||||||
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;
|
|
||||||
} else {
|
} else {
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
gst_avi_index_entry *entry = &avi->index_entries[avi->current_entry++];
|
gst_avi_index_entry *entry = &avi->index_entries[avi->current_entry++];
|
||||||
|
@ -2287,6 +2280,16 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
|
||||||
continue;
|
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];
|
stream = &avi->stream[entry->stream_nr];
|
||||||
|
|
||||||
if (entry->size == 0 || !stream->pad) {
|
if (entry->size == 0 || !stream->pad) {
|
||||||
|
@ -2327,6 +2330,17 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi)
|
||||||
} while (!processed);
|
} while (!processed);
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue