fakesrc: put byte position rather than buffer count into GST_BUFFER_OFFSET

If we're sending a segment in BYTE format, the offset
should be in bytes as well.
This commit is contained in:
Tim-Philipp Müller 2012-05-24 23:30:29 +01:00
parent dc1c3c5094
commit b259b5c476
2 changed files with 1 additions and 6 deletions

View file

@ -357,7 +357,6 @@ static void
gst_fake_src_init (GstFakeSrc * fakesrc) gst_fake_src_init (GstFakeSrc * fakesrc)
{ {
fakesrc->output = FAKE_SRC_FIRST_LAST_LOOP; fakesrc->output = FAKE_SRC_FIRST_LAST_LOOP;
fakesrc->buffer_count = 0;
fakesrc->silent = DEFAULT_SILENT; fakesrc->silent = DEFAULT_SILENT;
fakesrc->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS; fakesrc->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
fakesrc->dump = DEFAULT_DUMP; fakesrc->dump = DEFAULT_DUMP;
@ -781,7 +780,7 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
src = GST_FAKE_SRC (basesrc); src = GST_FAKE_SRC (basesrc);
buf = gst_fake_src_create_buffer (src, &size); buf = gst_fake_src_create_buffer (src, &size);
GST_BUFFER_OFFSET (buf) = src->buffer_count++; GST_BUFFER_OFFSET (buf) = offset;
if (src->datarate > 0) { if (src->datarate > 0) {
time = (src->bytes_sent * GST_SECOND) / src->datarate; time = (src->bytes_sent * GST_SECOND) / src->datarate;
@ -885,7 +884,6 @@ gst_fake_src_start (GstBaseSrc * basesrc)
src = GST_FAKE_SRC (basesrc); src = GST_FAKE_SRC (basesrc);
src->buffer_count = 0;
src->pattern_byte = 0x00; src->pattern_byte = 0x00;
src->bytes_sent = 0; src->bytes_sent = 0;

View file

@ -140,9 +140,6 @@ struct _GstFakeSrc {
gboolean sync; gboolean sync;
GstClock *clock; GstClock *clock;
gint num_buffers;
gint rt_num_buffers; /* we are going to change this at runtime */
gint64 buffer_count;
gboolean silent; gboolean silent;
gboolean signal_handoffs; gboolean signal_handoffs;
gboolean dump; gboolean dump;