avidemux: Use the first entry for a given stream if the first entry is after the seek position

This commit is contained in:
Sebastian Dröge 2009-05-11 18:15:22 +02:00
parent 97fa58f397
commit a62ed3b153

View file

@ -362,10 +362,19 @@ gst_avi_demux_index_entry_for_time (GstAviDemux * avi,
(GCompareDataFunc) gst_avi_demux_index_entry_search, (GCompareDataFunc) gst_avi_demux_index_entry_search,
GST_SEARCH_MODE_BEFORE, &time, NULL); GST_SEARCH_MODE_BEFORE, &time, NULL);
n = (entry - avi->index_entries) / sizeof (gst_avi_index_entry); if (entry == NULL) {
while (entry->stream_nr != stream_nr && n > 0) { entry = &avi->index_entries[0];
n--; n = 0;
entry = &avi->index_entries[n]; while (entry->stream_nr != stream_nr && n < avi->index_size - 1) {
n++;
entry = &avi->index_entries[n];
}
} else if (entry->stream_nr != stream_nr) {
n = (entry - avi->index_entries) / sizeof (gst_avi_index_entry);
while (entry->stream_nr != stream_nr && n > 0) {
n--;
entry = &avi->index_entries[n];
}
} }
GST_LOG_OBJECT (avi, GST_LOG_OBJECT (avi,