From 7e9f0b9582399a1e6194cf6d0ba2091674e61d01 Mon Sep 17 00:00:00 2001 From: "Arwed v. Merkatz" Date: Fri, 27 Aug 2004 14:10:09 +0000 Subject: [PATCH] Handle EOS correctly. Original commit message from CVS: Handle EOS correctly. --- ChangeLog | 5 +++++ gst/matroska/ebml-read.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4856e22f1c..f16574317d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-08-27 Arwed v. Merkatz + + * gst/matroska/ebml-read.c: (gst_ebml_peed_id), (gst_ebml_read_element_id), + handle EOS correctly + 2004-08-27 Thomas Vander Stichele patch by: Zaheer Abbas Merali diff --git a/gst/matroska/ebml-read.c b/gst/matroska/ebml-read.c index 064d5e1ef7..00d353dd88 100644 --- a/gst/matroska/ebml-read.c +++ b/gst/matroska/ebml-read.c @@ -160,8 +160,12 @@ gst_ebml_read_element_id (GstEbmlRead * ebml, guint32 * id, guint * level_up) /* Here, we might encounter EOS */ gst_bytestream_get_status (ebml->bs, &remaining, &event); - if (event) { + if (event && GST_IS_EVENT (event)) { + gboolean eos = (GST_EVENT_TYPE (event) == GST_EVENT_EOS); + gst_pad_event_default (ebml->sinkpad, event); + if (eos) + return FALSE; } else { guint64 pos = gst_bytestream_tell (ebml->bs); @@ -299,7 +303,7 @@ gst_ebml_peek_id (GstEbmlRead * ebml, guint * level_up) g_assert (level_up); - if (gst_ebml_read_element_id (ebml, &id, level_up) < 0) + if (gst_ebml_read_element_id (ebml, &id, level_up) <= 0) return 0; return id;