Changeset 2099:858f02f3765e in roaraudio


Ignore:
Timestamp:
07/21/09 13:20:23 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

got it working :) (samples vs. frames)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/convert.c

    r2098 r2099  
    3333 */ 
    3434 
     35#define DEBUG 
    3536#include "libroardsp.h" 
    3637//#define free(p) {ROAR_WARN("free(%p) = ?", (p)); free((p)); ROAR_WARN("free(%p): OK", (p));} 
     
    745746 
    746747 // calcumate number of input samples: 
    747  samples = (inlen * 8) / (from->channels * from->bits); 
     748 samples = (inlen * 8) / (from->bits); 
     749 
     750 ROAR_WARN("roar_conv2(*): input samples: %i", samples); 
    748751 
    749752 // calculate size per frame 
     
    751754 
    752755 needed_buffer *= samples; 
     756 needed_buffer /= from->channels; 
    753757 
    754758 if ( from->rate < to->rate ) 
     
    797801 if ( to->channels > from->channels ) { 
    798802  ROAR_WARN("roar_conv2(*): channels: %i->%i", from->channels, to->channels); 
    799   if ( roar_conv_chans(out, cin, samples, from->channels, to->channels, cinfo.bits) == -1 ) 
     803  if ( roar_conv_chans(out, cin, samples/from->channels, from->channels, to->channels, cinfo.bits) == -1 ) 
    800804   return -1; 
    801805 
Note: See TracChangeset for help on using the changeset viewer.