Changeset 858

Show
Ignore:
Timestamp:
01/19/08 10:33:37 (13 years ago)
Author:
ppalmers
Message:

minor fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libutil/TimestampedBuffer.cpp

    r833 r858  
    7676 
    7777TimestampedBuffer::~TimestampedBuffer() { 
     78    pthread_mutex_destroy(&m_framecounter_lock); 
     79 
    7880    ffado_ringbuffer_free(m_event_buffer); 
    7981    free(m_process_buffer); 
     
    263265 */ 
    264266unsigned int TimestampedBuffer::getBufferFill() { 
    265     return ffado_ringbuffer_read_space(m_event_buffer)/(m_bytes_per_frame); 
     267    //return ffado_ringbuffer_read_space(m_event_buffer)/(m_bytes_per_frame); 
     268    return m_framecounter; 
    266269} 
    267270 
     
    276279 */ 
    277280unsigned int TimestampedBuffer::getBufferSpace() { 
    278     return ffado_ringbuffer_write_space(m_event_buffer)/(m_bytes_per_frame); 
     281    //return ffado_ringbuffer_write_space(m_event_buffer)/(m_bytes_per_frame); 
     282    assert(m_buffer_size-m_framecounter >= 0); 
     283    return m_buffer_size-m_framecounter; 
    279284} 
    280285 
     
    355360    // this will init the internal timestamps to a sensible value 
    356361    setBufferTailTimestamp(m_buffer_tail_timestamp); 
    357      
     362 
    358363    return true; 
    359364} 
     
    10851090 * @param nbframes number of frames to decrement 
    10861091 */ 
    1087 void TimestampedBuffer::decrementFrameCounter(int nbframes) { 
     1092void TimestampedBuffer::decrementFrameCounter(unsigned int nbframes) { 
    10881093    ENTER_CRITICAL_SECTION; 
    10891094    m_framecounter -= nbframes; 
     
    11011106 * @param new_timestamp the new timestamp 
    11021107 */ 
    1103 void TimestampedBuffer::incrementFrameCounter(int nbframes, ffado_timestamp_t new_timestamp) { 
     1108void TimestampedBuffer::incrementFrameCounter(unsigned int nbframes, ffado_timestamp_t new_timestamp) { 
    11041109 
    11051110    // add the offsets 
  • trunk/libffado/src/libutil/TimestampedBuffer.h

    r833 r858  
    2727#include "../debugmodule/debugmodule.h" 
    2828#include "libutil/ringbuffer.h" 
     29#include <pthread.h> 
    2930 
    3031//typedef float ffado_timestamp_t; 
     
    159160 
    160161    private: 
    161         void decrementFrameCounter ( int nbframes ); 
    162         void incrementFrameCounter ( int nbframes, ffado_timestamp_t new_timestamp ); 
     162        void decrementFrameCounter(unsigned int nbframes); 
     163        void incrementFrameCounter(unsigned int nbframes, ffado_timestamp_t new_timestamp); 
    163164        void resetFrameCounter(); 
    164165