diff options
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc b/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc index f51e52ce3..b70135b85 100644 --- a/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc +++ b/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc @@ -287,10 +287,10 @@ gr_flat_flowgraph::setup_buffer_alignment(gr_block_sptr block) for(int i = 0; i < block->detail()->ninputs(); i++) { void *r = (void*)block->detail()->input(i)->read_pointer(); unsigned long int ri = (unsigned long int)r % alignment; - //std::cout << "reader: " << r << " alignment: " << ri << std::endl; + //std::cerr << "reader: " << r << " alignment: " << ri << std::endl; if(ri != 0) { size_t itemsize = block->detail()->input(i)->get_sizeof_item(); - block->detail()->input(i)->update_read_pointer(ri/itemsize); + block->detail()->input(i)->update_read_pointer(alignment-ri/itemsize); } block->set_unaligned(0); block->set_is_unaligned(false); @@ -299,10 +299,10 @@ gr_flat_flowgraph::setup_buffer_alignment(gr_block_sptr block) for(int i = 0; i < block->detail()->noutputs(); i++) { void *w = (void*)block->detail()->output(i)->write_pointer(); unsigned long int wi = (unsigned long int)w % alignment; - size_t itemsize = block->detail()->output(i)->get_sizeof_item(); - //std::cout << "writer: " << w << " alignment: " << wi << std::endl; + //std::cerr << "writer: " << w << " alignment: " << wi << std::endl; if(wi != 0) { - block->detail()->output(i)->update_write_pointer(wi/itemsize); + size_t itemsize = block->detail()->output(i)->get_sizeof_item(); + block->detail()->output(i)->update_write_pointer(alignment-wi/itemsize); } block->set_unaligned(0); block->set_is_unaligned(false); |