gst/elements/gstbufferstore.c: set the offset of the buffer to the requested offset

Original commit message from CVS:
* gst/elements/gstbufferstore.c: (gst_buffer_store_get_buffer):
set the offset of the buffer to the requested offset
* gst/elements/gsttypefind.c: (stop_typefinding):
revert patch 1.18 (which I unfortunately don't know the reason for).
This is needed to allow downstream elements to seek. Otherwise
typefind might overwrite a previous seek by downstream elements.
This lead to errors with id3tag and typefind on some mp3s.
* gst/schedulers/entryscheduler.c: (COTHREADS_TYPE),
(gst_entry_scheduler_iterate):
be more verbose when debugging
This commit is contained in:
Benjamin Otte 2004-03-30 16:31:06 +00:00
parent 161bcaee42
commit 6d87ece93d
6 changed files with 34 additions and 16 deletions

View file

@ -1,3 +1,16 @@
2004-03-30 Benjamin Otte <otte@gnome.org>
* gst/elements/gstbufferstore.c: (gst_buffer_store_get_buffer):
set the offset of the buffer to the requested offset
* gst/elements/gsttypefind.c: (stop_typefinding):
revert patch 1.18 (which I unfortunately don't know the reason for).
This is needed to allow downstream elements to seek. Otherwise
typefind might overwrite a previous seek by downstream elements.
This lead to errors with id3tag and typefind on some mp3s.
* gst/schedulers/entryscheduler.c: (COTHREADS_TYPE),
(gst_entry_scheduler_iterate):
be more verbose when debugging
2004-03-30 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gstcaps.c: (gst_caps_from_string_inplace):

View file

@ -368,6 +368,7 @@ gst_buffer_store_get_buffer (GstBufferStore * store, guint64 offset, guint size)
}
/* uh, the requested data spans some buffers */
ret = gst_buffer_new_and_alloc (size);
GST_BUFFER_OFFSET (ret) = offset;
GST_LOG_OBJECT (store, "created buffer %p for offset %" G_GUINT64_FORMAT
" and size %u, will fill with data now", ret, offset, size);
data = GST_BUFFER_DATA (ret);

View file

@ -349,20 +349,20 @@ stop_typefinding (GstTypeFindElement * typefind)
GstBuffer *buffer;
guint size = gst_buffer_store_get_size (typefind->store, 0);
if (size
&& (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
GST_LOG_OBJECT (typefind, "pushing cached data (%u bytes)", size);
gst_pad_push (typefind->src, GST_DATA (buffer));
} else {
size = 0;
}
GST_LOG_OBJECT (typefind, "seeking back to current position %u", size);
GST_DEBUG_OBJECT (typefind, "seeking back to current position %u", size);
if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink),
gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES,
size))) {
GST_WARNING_OBJECT (typefind,
"could not seek to required position %u, hope for the best", size);
}
if (size
&& (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
GST_DEBUG_OBJECT (typefind, "pushing cached data (%u bytes)", size);
gst_pad_push (typefind->src, GST_DATA (buffer));
} else {
size = 0;
}
}
gst_buffer_store_clear (typefind->store);
}

View file

@ -1026,6 +1026,9 @@ gst_entry_scheduler_iterate (GstScheduler * scheduler)
gst_entry_scheduler_show (scheduler);
#endif
return GST_SCHEDULER_STATE_ERROR;
} else if (ret == GST_SCHEDULER_STATE_STOPPED) {
GST_INFO_OBJECT (sched, "done iterating returning STOPPED");
return GST_SCHEDULER_STATE_STOPPED;
} else {
return ret;
}

View file

@ -368,6 +368,7 @@ gst_buffer_store_get_buffer (GstBufferStore * store, guint64 offset, guint size)
}
/* uh, the requested data spans some buffers */
ret = gst_buffer_new_and_alloc (size);
GST_BUFFER_OFFSET (ret) = offset;
GST_LOG_OBJECT (store, "created buffer %p for offset %" G_GUINT64_FORMAT
" and size %u, will fill with data now", ret, offset, size);
data = GST_BUFFER_DATA (ret);

View file

@ -349,20 +349,20 @@ stop_typefinding (GstTypeFindElement * typefind)
GstBuffer *buffer;
guint size = gst_buffer_store_get_size (typefind->store, 0);
if (size
&& (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
GST_LOG_OBJECT (typefind, "pushing cached data (%u bytes)", size);
gst_pad_push (typefind->src, GST_DATA (buffer));
} else {
size = 0;
}
GST_LOG_OBJECT (typefind, "seeking back to current position %u", size);
GST_DEBUG_OBJECT (typefind, "seeking back to current position %u", size);
if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink),
gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES,
size))) {
GST_WARNING_OBJECT (typefind,
"could not seek to required position %u, hope for the best", size);
}
if (size
&& (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
GST_DEBUG_OBJECT (typefind, "pushing cached data (%u bytes)", size);
gst_pad_push (typefind->src, GST_DATA (buffer));
} else {
size = 0;
}
}
gst_buffer_store_clear (typefind->store);
}