summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libmpeg2/decode.c2
-rw-r--r--src/libw32dll/w32codec.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c
index 8795bdb09..b5c28a5a3 100644
--- a/src/libmpeg2/decode.c
+++ b/src/libmpeg2/decode.c
@@ -356,6 +356,8 @@ void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec,
if (current == NULL)
return ;
+ /* printf ("looking for sequence header... %02x\n", code); */
+
stats_header (code, mpeg2dec->chunk_buffer);
if (code == 0xb3) { /* sequence_header_code */
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index 4700799b8..924618f2f 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: w32codec.c,v 1.6 2001/06/15 08:58:12 f1rmb Exp $
+ * $Id: w32codec.c,v 1.7 2001/06/18 12:56:28 guenter Exp $
*
* routines for using w32 codecs
*
@@ -69,6 +69,7 @@ typedef struct w32a_decoder_s {
unsigned char sample_buf[40000];
HACMSTREAM srcstream;
int rec_audio_src_size;
+ int num_channels;
} w32a_decoder_t;
@@ -378,10 +379,11 @@ static int w32a_init_audio (w32a_decoder_t *this, WAVEFORMATEX *in_fmt_){
}
this->srcstream = 0;
+ this->num_channels = in_fmt->nChannels;
this->audio_out->open( this->audio_out,
16, in_fmt->nSamplesPerSec,
- AO_CAP_MODE_STEREO);
+ (in_fmt->nChannels == 2) ? AO_CAP_MODE_STEREO : AO_CAP_MODE_MONO);
wf.nChannels = in_fmt->nChannels;
wf.nSamplesPerSec = in_fmt->nSamplesPerSec;
@@ -471,7 +473,8 @@ static void w32a_decode_audio (w32a_decoder_t *this,
this->sample_buf[ash.cbDstLengthUsed-2], this->sample_buf[ash.cbDstLengthUsed-1]);
*/
this->audio_out->write_audio_data (this->audio_out,
- (int16_t*) this->sample_buf, ash.cbDstLengthUsed / 4,
+ (int16_t*) this->sample_buf,
+ ash.cbDstLengthUsed / (this->num_channels*2),
nPTS);
}
}