gst/realmedia/rmdemux.c: Also, don't read the index for a stream a second time when operating in pull-mode and reachi...

Original commit message from CVS:
* gst/realmedia/rmdemux.c: (gst_rmdemux_parse_indx_data):
Also, don't read the index for a stream a second time when
operating in pull-mode and reaching the end of the file.
This commit is contained in:
Tim-Philipp Müller 2006-12-14 11:49:39 +00:00
parent d54f267bc4
commit fe3357b647
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2006-12-14 Tim-Philipp Müller <tim at centricular dot net>
* gst/realmedia/rmdemux.c: (gst_rmdemux_parse_indx_data):
Also, don't read the index for a stream a second time when
operating in pull-mode and reaching the end of the file.
2006-12-14 Tim-Philipp Müller <tim at centricular dot net> 2006-12-14 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Roland Kay <roland.kay at ox compsoc net> Patch by: Roland Kay <roland.kay at ox compsoc net>

View file

@ -1727,6 +1727,13 @@ gst_rmdemux_parse_indx_data (GstRMDemux * rmdemux, const guint8 * data,
if (rmdemux->index_stream == NULL) if (rmdemux->index_stream == NULL)
return; return;
/* don't parse the index a second time when operating pull-based and
* reaching the end of the file */
if (rmdemux->index_stream->index_length > 0) {
GST_DEBUG_OBJECT (rmdemux, "Already have an index for this stream");
return;
}
index = g_malloc (sizeof (GstRMDemuxIndex) * n); index = g_malloc (sizeof (GstRMDemuxIndex) * n);
rmdemux->index_stream->index = index; rmdemux->index_stream->index = index;
rmdemux->index_stream->index_length = n; rmdemux->index_stream->index_length = n;