From 9200538b398a2f6d1be6bca107c58fd1a4070b01 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 8 Jul 2013 23:32:44 +0200 Subject: audio: remove decoder input buffer This was unused. --- audio/decode/ad.h | 1 - audio/decode/dec_audio.c | 11 ----------- core/mplayer.c | 6 ++---- demux/stheader.h | 5 ----- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/audio/decode/ad.h b/audio/decode/ad.h index ff51ecbe35..1f45e88f98 100644 --- a/audio/decode/ad.h +++ b/audio/decode/ad.h @@ -42,7 +42,6 @@ typedef struct ad_functions // NULL terminated array of all drivers extern const ad_functions_t * const mpcodecs_ad_drivers[]; -// fallback if ADCTRL_RESYNC not implemented: sh_audio->a_in_buffer_len=0; #define ADCTRL_RESYNC_STREAM 1 // resync, called after seeking // fallback if ADCTRL_SKIP not implemented: ds_fill_buffer(sh_audio->ds); diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index 3275bae705..1bf217de80 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -55,15 +55,6 @@ static int init_audio_codec(sh_audio_t *sh_audio, const char *decoder) return 0; } - /* allocate audio in buffer: */ - if (sh_audio->audio_in_minsize > 0) { - sh_audio->a_in_buffer_size = sh_audio->audio_in_minsize; - mp_tmsg(MSGT_DECAUDIO, MSGL_V, - "dec_audio: Allocating %d bytes for input buffer.\n", - sh_audio->a_in_buffer_size); - sh_audio->a_in_buffer = av_mallocz(sh_audio->a_in_buffer_size); - } - const int base_size = 65536; // At least 64 KiB plus rounding up to next decodable unit size sh_audio->a_buffer_size = base_size + sh_audio->audio_out_minsize; @@ -194,7 +185,6 @@ void uninit_audio(sh_audio_t *sh_audio) talloc_free(sh_audio->gsh->decoder_desc); sh_audio->gsh->decoder_desc = NULL; av_freep(&sh_audio->a_buffer); - av_freep(&sh_audio->a_in_buffer); } @@ -370,7 +360,6 @@ void decode_audio_prepend_bytes(struct bstr *outbuf, int count, int byte) void resync_audio_stream(sh_audio_t *sh_audio) { - sh_audio->a_in_buffer_len = 0; // clear audio input buffer sh_audio->pts = MP_NOPTS_VALUE; if (!sh_audio->initialized) return; diff --git a/core/mplayer.c b/core/mplayer.c index bb6a87642e..b1a7209a97 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -1708,11 +1708,9 @@ static double written_audio_pts(struct MPContext *mpctx) return a_pts; // ds_tell_pts returns bytes read after last timestamp from - // demuxing layer, decoder might use sh_audio->a_in_buffer for bytes - // it has read but not decoded + // demuxing layer if (sh_audio->i_bps) - a_pts += (ds_tell_pts(d_audio) - sh_audio->a_in_buffer_len) / - (double)sh_audio->i_bps; + a_pts += ds_tell_pts(d_audio) / (double)sh_audio->i_bps; } // Now a_pts hopefully holds the pts for end of audio from decoder. // Substract data in buffers between decoder and audio out. diff --git a/demux/stheader.h b/demux/stheader.h index 15c55fdeda..0351a29ee7 100644 --- a/demux/stheader.h +++ b/demux/stheader.h @@ -94,11 +94,6 @@ typedef struct sh_audio { struct mp_chmap channels; int o_bps; // == samplerate*samplesize*channels.num (uncompr. bytes/sec) int i_bps; // == bitrate (compressed bytes/sec) - // in buffers: - int audio_in_minsize; // initial size to allocate for a_in_buffer if any - char *a_in_buffer; // input buffer used by some decoders - int a_in_buffer_len; - int a_in_buffer_size; // decoder buffers: int audio_out_minsize; // minimal output from decoder may be this much char *a_buffer; // buffer for decoder output -- cgit v1.2.3