From fe3357b64734e9bd1ae1e05ad782d98d27cafe0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 14 Dec 2006 11:49:39 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ gst/realmedia/rmdemux.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3a7d0ac282..7dd8fd034d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-12-14 Tim-Philipp Müller + + * 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 Patch by: Roland Kay diff --git a/gst/realmedia/rmdemux.c b/gst/realmedia/rmdemux.c index 0669d78c3a..e613faff03 100644 --- a/gst/realmedia/rmdemux.c +++ b/gst/realmedia/rmdemux.c @@ -1727,6 +1727,13 @@ gst_rmdemux_parse_indx_data (GstRMDemux * rmdemux, const guint8 * data, if (rmdemux->index_stream == NULL) 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); rmdemux->index_stream->index = index; rmdemux->index_stream->index_length = n;