aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libmpcodecs/dec_audio.c19
-rw-r--r--libmpdemux/demux_audio.c1
-rw-r--r--libmpdemux/demuxer.c7
3 files changed, 7 insertions, 20 deletions
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index 4bf93df094..bcdb819dfa 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -49,25 +49,6 @@ void afm_help(){
int init_audio_codec(sh_audio_t *sh_audio)
{
-
- // reset in/out buffer size/pointer:
- sh_audio->a_buffer_size=0;
- sh_audio->a_buffer=NULL;
- sh_audio->a_in_buffer_size=0;
- sh_audio->a_in_buffer=NULL;
-
- // Set up some common usefull defaults. ad->preinit() can override these:
-
- sh_audio->samplesize=2;
- sh_audio->sample_format=AFMT_S16_NE;
- sh_audio->samplerate=0;
- sh_audio->channels=0;
- sh_audio->i_bps=0; // input rate (bytes/sec)
- sh_audio->o_bps=0; // output rate (bytes/sec)
-
- sh_audio->audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/
- sh_audio->audio_in_minsize=0;
-
if(!mpadec->preinit(sh_audio))
{
mp_msg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_ADecoderPreinitFailed);
diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c
index 001f797a13..4207265684 100644
--- a/libmpdemux/demux_audio.c
+++ b/libmpdemux/demux_audio.c
@@ -373,7 +373,6 @@ void demux_audio_seek(demuxer_t *demuxer,float rel_seek_secs,int flags){
priv = demuxer->priv;
if(priv->frmt == MP3 && hr_mp3_seek && !(flags & 2)) {
- if(isinf(priv->last_pts)) priv->last_pts=0;
len = (flags & 1) ? rel_seek_secs - priv->last_pts : rel_seek_secs;
if(len < 0) {
stream_seek(s,demuxer->movi_start);
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index aa8a61d755..35b87aca76 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -18,6 +18,7 @@
#include "stheader.h"
#include "mf.h"
+#include "../libao2/afmt.h"
#include "../libvo/fastmemcpy.h"
void free_demuxer_stream(demux_stream_t *ds){
@@ -79,9 +80,15 @@ sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id){
if(demuxer->a_streams[id]){
mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_AudioStreamRedefined,id);
} else {
+ sh_audio_t *sh;
mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_FoundAudioStream,id);
demuxer->a_streams[id]=malloc(sizeof(sh_audio_t));
memset(demuxer->a_streams[id],0,sizeof(sh_audio_t));
+ sh = demuxer->a_streams[id];
+ // set some defaults
+ sh->samplesize=2;
+ sh->sample_format=AFMT_S16_NE;
+ sh->audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/
}
return demuxer->a_streams[id];
}