Changeset daed689 in mainline for uspace/drv/audio/sb16/dsp.c


Ignore:
Timestamp:
2012-08-20T15:14:50Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03d6e0d
Parents:
e7bf5f6
Message:

sb16: Report termination after the action has actually terminated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dsp.c

    re7bf5f6 rdaed689  
    256256#endif
    257257                break;
     258        case DSP_CAPTURE_TERMINATE:
     259                dsp_report_event(dsp, PCM_EVENT_CAPTURE_TERMINATED);
     260                async_exchange_end(dsp->event_exchange);
     261                dsp->event_exchange = NULL;
     262                sb_dsp_change_state(dsp, DSP_STOPPED);
     263                break;
     264        case DSP_PLAYBACK_TERMINATE:
     265                dsp_report_event(dsp, PCM_EVENT_PLAYBACK_TERMINATED);
     266                async_exchange_end(dsp->event_exchange);
     267                dsp->event_exchange = NULL;
     268                sb_dsp_change_state(dsp, DSP_STOPPED);
     269                break;
    258270        default:
    259271                ddf_log_warning("Interrupt while DSP not active");
     
    439451        sb_dsp_write(dsp, DMA_16B_EXIT);
    440452        ddf_log_debug("Stopping playback on buffer.");
    441         if (dsp->state == DSP_PLAYBACK_ACTIVE_EVENTS)
    442                 dsp_report_event(dsp, PCM_EVENT_PLAYBACK_TERMINATED);
    443         async_exchange_end(dsp->event_exchange);
    444         dsp->event_exchange = NULL;
    445         sb_dsp_change_state(dsp, DSP_STOPPED);
     453        sb_dsp_change_state(dsp, DSP_PLAYBACK_TERMINATE);
    446454        return EOK;
    447455}
     
    502510        sb_dsp_write(dsp, DMA_16B_EXIT);
    503511        ddf_log_debug("Stopped capture");
    504         if (dsp->state == DSP_CAPTURE_ACTIVE_EVENTS)
    505                 dsp_report_event(dsp, PCM_EVENT_CAPTURE_TERMINATED);
    506         async_exchange_end(dsp->event_exchange);
    507         dsp->event_exchange = NULL;
    508         sb_dsp_change_state(dsp, DSP_STOPPED);
     512        sb_dsp_change_state(dsp, DSP_CAPTURE_TERMINATE);
    509513        return EOK;
    510514}
Note: See TracChangeset for help on using the changeset viewer.