Commit 5aa02968 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

oggparse: fix list iteration code

Not that it really matters, but let's fix it before someone
notices and makes fun of us.
parent 03ea1bea
...@@ -572,12 +572,11 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer) ...@@ -572,12 +572,11 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer)
for (l = ogg->oggstreams; l != NULL; l = l->next) { for (l = ogg->oggstreams; l != NULL; l = l->next) {
GstOggStream *stream = (GstOggStream *) l->data; GstOggStream *stream = (GstOggStream *) l->data;
int j; GList *j;
/* FIXME: list iteration */ /* already appended the first header, now do headers 2-N */
for (j = 1; j < g_list_length (stream->headers); j++) { for (j = stream->headers->next; j != NULL; j = j->next) {
gst_ogg_parse_append_header (&array, gst_ogg_parse_append_header (&array, GST_BUFFER (j->data));
GST_BUFFER (g_list_nth_data (stream->headers, j)));
count++; count++;
} }
} }
...@@ -613,12 +612,11 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer) ...@@ -613,12 +612,11 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer)
} }
for (l = ogg->oggstreams; l != NULL; l = l->next) { for (l = ogg->oggstreams; l != NULL; l = l->next) {
GstOggStream *stream = (GstOggStream *) l->data; GstOggStream *stream = (GstOggStream *) l->data;
int j; GList *j;
/* FIXME: list iteration */ /* pushed the first one for each stream already, now do 2-N */
for (j = 1; j < g_list_length (stream->headers); j++) { for (j = stream->headers->next; j != NULL; j = j->next) {
GstBuffer *buf = GstBuffer *buf = GST_BUFFER (j->data);
GST_BUFFER (g_list_nth_data (stream->headers, j));
buf = gst_buffer_make_metadata_writable (buf); buf = gst_buffer_make_metadata_writable (buf);
gst_buffer_set_caps (buf, caps); gst_buffer_set_caps (buf, caps);
...@@ -668,29 +666,25 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer) ...@@ -668,29 +666,25 @@ gst_ogg_parse_chain (GstPad * pad, GstBuffer * buffer)
stream->stored_buffers = g_list_append (stream->stored_buffers, stream->stored_buffers = g_list_append (stream->stored_buffers,
pagebuffer); pagebuffer);
} else { } else {
if (stream->stored_buffers) { while (stream->stored_buffers) {
int j; GstBuffer *buf = stream->stored_buffers->data;
/* FIXME: list iteration */ buf = gst_buffer_make_metadata_writable (buf);
for (j = 0; j < g_list_length (stream->stored_buffers); j++) { gst_buffer_set_caps (buf, ogg->caps);
GstBuffer *buf = GST_BUFFER_TIMESTAMP (buf) = buffertimestamp;
GST_BUFFER (g_list_nth_data (stream->stored_buffers, j)); if (!keyframe) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
} else {
keyframe = FALSE;
}
buf = gst_buffer_make_metadata_writable (buf); result = gst_pad_push (ogg->srcpad, buf);
gst_buffer_set_caps (buf, ogg->caps); if (result != GST_FLOW_OK)
GST_BUFFER_TIMESTAMP (buf) = buffertimestamp; return result;
if (!keyframe) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
} else {
keyframe = FALSE;
}
result = gst_pad_push (ogg->srcpad, buf); stream->stored_buffers =
if (result != GST_FLOW_OK) g_list_delete_link (stream->stored_buffers,
return result; stream->stored_buffers);
}
g_list_free (stream->stored_buffers);
stream->stored_buffers = NULL;
} }
pagebuffer = gst_buffer_make_metadata_writable (pagebuffer); pagebuffer = gst_buffer_make_metadata_writable (pagebuffer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment