} else {
index = avi_stream_convert_time_to_frames_unchecked (stream, time);
}
- } else {
+ } else if (stream->strh->type == GST_RIFF_FCC_auds) {
/* constant rate stream */
total = avi_stream_convert_time_to_bytes_unchecked (stream, time);
- }
+ } else
+ return -1;
if (index == -1) {
GstAviIndexEntry *entry;
/* get the entry index for the requested position */
index = gst_avi_demux_index_for_time (avi, stream, seek_time);
GST_DEBUG_OBJECT (avi, "Got entry %u", index);
+ if (index == -1)
+ return FALSE;
/* check if we are already on a keyframe */
if (!ENTRY_IS_KEYFRAME (&stream->index[index])) {
/* get the entry index for the requested position */
index = gst_avi_demux_index_for_time (avi, ostream, seek_time);
+ if (index == -1)
+ continue;
/* move to previous keyframe */
if (!ENTRY_IS_KEYFRAME (&ostream->index[index]))
index = gst_avi_demux_index_for_time (avi, stream, cur);
GST_DEBUG_OBJECT (avi, "str %u: Found entry %u for %" GST_TIME_FORMAT,
str_num, index, GST_TIME_ARGS (cur));
+ if (index == -1)
+ return -1;
/* check if we are already on a keyframe */
if (!ENTRY_IS_KEYFRAME (&stream->index[index])) {
idx = gst_avi_demux_index_for_time (avi, str, cur);
GST_DEBUG_OBJECT (avi, "str %u: Found entry %u for %" GST_TIME_FORMAT, n,
idx, GST_TIME_ARGS (cur));
+ if (idx == -1)
+ continue;
/* check if we are already on a keyframe */
if (!ENTRY_IS_KEYFRAME (&str->index[idx])) {