mirror of https://github.com/mpv-player/mpv
parent
32ad313844
commit
9200538b39
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue