gst/avi/gstavidemux.c: Because we don't know the frame order we need to push till the next keyframe

Original commit message from CVS:
* gst/avi/gstavidemux.c:
Because we don't know the frame order we need to push till
the next keyframe
This commit is contained in:
Thijs Vermeir 2008-06-04 18:03:24 +00:00
parent 22940c0010
commit b950285ac7
2 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2008-06-04 Thijs Vermeir <thijsvermeir@gmail.com>
* gst/avi/gstavidemux.c:
Because we don't know the frame order we need to push till
the next keyframe
2008-06-04 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: Sjoerd Simons <sjoerd at luon dot net>

View file

@ -287,7 +287,6 @@ gst_avi_demux_index_last (GstAviDemux * avi, gint stream_nr)
return result;
}
#if 0
static gst_avi_index_entry *
gst_avi_demux_index_next (GstAviDemux * avi, gint stream_nr, gint last,
guchar flags)
@ -308,7 +307,6 @@ gst_avi_demux_index_next (GstAviDemux * avi, gint stream_nr, gint last,
}
return result;
}
#endif
static gst_avi_index_entry *
gst_avi_demux_index_prev (GstAviDemux * avi, gint stream_nr, gint last,
@ -3154,9 +3152,21 @@ gst_avi_demux_do_seek (GstAviDemux * avi, GstSegment * segment)
avi->current_entry = kentry->index_nr;
if (segment->rate < 0.0) {
/* play between the keyframe and the destination entry */
gst_avi_index_entry *next_keyframe;
/* Because we don't know the frame order we need to push from the prev keyframe
* to the next keyframe. If there is a smart decoder downstream he will notice
* that there are too many decoded frames send and return UNEXPECTED when there
* are enough decoded frames to fill the segment.
*/
next_keyframe =
gst_avi_demux_index_next (avi, 0, kentry->index_nr,
GST_AVI_INDEX_ENTRY_FLAG_KEYFRAME);
if (!next_keyframe)
next_keyframe = gst_avi_demux_index_last (avi, 0);
avi->reverse_start_index = kentry->index_nr;
avi->reverse_stop_index = entry->index_nr;
avi->reverse_stop_index = next_keyframe->index_nr;
GST_DEBUG_OBJECT (avi, "reverse seek: start idx (%d) and stop idx (%d)",
avi->reverse_start_index, avi->reverse_stop_index);