1
/***************************************************************************
2
audioeng_null.cpp - description
4
This audio plug in does nothing at all.
5
except that you are sure that the output is WAV PCM with the given size
7
begin : Sun Jan 13 2002
8
copyright : (C) 2002 by mean
9
email : fixounet@free.fr
10
***************************************************************************/
12
/***************************************************************************
14
* This program is free software; you can redistribute it and/or modify *
15
* it under the terms of the GNU General Public License as published by *
16
* the Free Software Foundation; either version 2 of the License, or *
17
* (at your option) any later version. *
19
***************************************************************************/
24
#include <ADM_assert.h>
32
//#include "aviaudio.hxx"
33
#include "audioprocess.hxx"
34
//#include "toolkit.hxx"
40
AVDMProcessAudio_Null::AVDMProcessAudio_Null
41
(AVDMGenericAudioStream * instream, uint32_t time_offset, uint32_t duration):
42
AVDMBufferedAudioStream (instream)
45
_wavheader = new WAVHeader;
47
memcpy(_wavheader, _instream->getInfo(), sizeof(WAVHeader));
48
_wavheader->encoding = WAV_PCM;
50
// bug spotted by jmisack
51
_wavheader->bitspersample=16;
54
// Case AC3 Downmixing to stereo ...
55
if( _wavheader->channels >2)
56
_wavheader->channels =2;
57
_wavheader->byterate =_wavheader->channels * _wavheader->frequency * 2;
58
strcpy(_name, "PROC:NULL");
59
_instream->goToTime(time_offset);
60
_start_time = time_offset;
63
dur=dur*_wavheader->byterate*1.1;
65
_size = (uint32_t)dur;
66
_length = (uint32_t)dur;
70
AVDMProcessAudio_Null::~AVDMProcessAudio_Null()
74
uint32_t AVDMProcessAudio_Null::grab(uint8_t *obuffer)
77
rdall = _instream->readDecompress(1000, obuffer);
79
return MINUS_ONE; // we could not get a single byte ! End of stream
82
uint8_t AVDMProcessAudio_Null::goToTime(uint32_t newoffset)
84
_instream->goToTime(_start_time);
87
printf("AFNull: MMm Null not going to 0 ?\n");