commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/04: Corrected double-to-int conversion i


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/04: Corrected double-to-int conversion in tags propagation that should have included rounding behavior
Date: Sat, 22 Feb 2014 22:27:30 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch maint
in repository gnuradio.

commit 6c139b8908b2edaaf6d5d9634b56683eecd74ac2
Author: Ethan Trewhitt <address@hidden>
Date:   Fri Feb 21 21:26:50 2014 -0500

    Corrected double-to-int conversion in tags propagation that should have 
included rounding behavior
---
 gnuradio-runtime/lib/block_executor.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnuradio-runtime/lib/block_executor.cc 
b/gnuradio-runtime/lib/block_executor.cc
index ee22ef5..d371820 100644
--- a/gnuradio-runtime/lib/block_executor.cc
+++ b/gnuradio-runtime/lib/block_executor.cc
@@ -121,7 +121,8 @@ namespace gr {
         else {
           for(t = rtags.begin(); t != rtags.end(); t++) {
             tag_t new_tag = *t;
-            new_tag.offset *= rrate;
+            //new_tag.offset *= rrate;
+            new_tag.offset = ((double)new_tag.offset * rrate) + 0.5;
             for(int o = 0; o < d->noutputs(); o++)
               d->output(o)->add_item_tag(new_tag);
           }
@@ -140,7 +141,8 @@ namespace gr {
           std::vector<tag_t>::iterator t;
           for(t = rtags.begin(); t != rtags.end(); t++) {
             tag_t new_tag = *t;
-            new_tag.offset *= rrate;
+            //new_tag.offset *= rrate;
+            new_tag.offset = ((double)new_tag.offset * rrate) + 0.5;
             d->output(i)->add_item_tag(new_tag);
           }
         }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]