summaryrefslogtreecommitdiffstats
path: root/audio/decode/dec_audio.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-21 22:10:15 +0100
committerwm4 <wm4@nowhere>2016-01-22 00:25:44 +0100
commitfef8b7984be5a6244612d346bd60d2badd4a2e63 (patch)
tree9a9c4ef4b3cbe9d8ee0854a77913df8ce00dab8f /audio/decode/dec_audio.h
parent27ecc417fedf25b2408e49fafdae4421d5115532 (diff)
downloadmpv-fef8b7984be5a6244612d346bd60d2badd4a2e63.tar.bz2
mpv-fef8b7984be5a6244612d346bd60d2badd4a2e63.tar.xz
audio: refactor: work towards unentangling audio decoding and filtering
Similar to the video path. dec_audio.c now handles decoding only. It also looks very similar to dec_video.c, and actually contains some of the rewritten code from it. (A further goal might be unifying the decoders, I guess.) High potential for regressions.
Diffstat (limited to 'audio/decode/dec_audio.h')
-rw-r--r--audio/decode/dec_audio.h41
1 files changed, 20 insertions, 21 deletions
diff --git a/audio/decode/dec_audio.h b/audio/decode/dec_audio.h
index d88d8bfaea..27752f7be1 100644
--- a/audio/decode/dec_audio.h
+++ b/audio/decode/dec_audio.h
@@ -30,39 +30,38 @@ struct dec_audio {
struct mp_log *log;
struct MPOpts *opts;
struct mpv_global *global;
- bool spdif_passthrough, spdif_failed;
const struct ad_functions *ad_driver;
struct sh_stream *header;
- struct af_stream *afilter;
char *decoder_desc;
- struct mp_audio decode_format;
- struct mp_audio *waiting; // used on format-change
- // last known pts value in output from decoder
- double pts;
- // number of samples output by decoder after last known pts
- int pts_offset;
+
+ bool try_spdif;
+
// set every time a jump in timestamps is encountered
bool pts_reset;
+
// For free use by the ad_driver
void *priv;
- // Strictly internal to dec_audio.c
- struct demux_packet *packet;
-};
-enum {
- AD_OK = 0,
- AD_ERR = -1,
- AD_EOF = -2,
- AD_NEW_FMT = -3,
- AD_WAIT = -4,
+ // Strictly internal (dec_audio.c).
+
+ double pts; // endpts of previous frame
+ struct demux_packet *packet;
+ struct mp_audio *current_frame;
+ int current_state;
};
struct mp_decoder_list *audio_decoder_list(void);
int audio_init_best_codec(struct dec_audio *d_audio);
-int audio_decode(struct dec_audio *d_audio, struct mp_audio_buffer *outbuf,
- int minsamples);
-int initial_audio_decode(struct dec_audio *d_audio);
-void audio_reset_decoding(struct dec_audio *d_audio);
void audio_uninit(struct dec_audio *d_audio);
+void audio_work(struct dec_audio *d_audio);
+
+#define AUDIO_OK 1
+#define AUDIO_WAIT 0
+#define AUDIO_EOF -1
+#define AUDIO_SKIP -2
+int audio_get_frame(struct dec_audio *d_audio, struct mp_audio **out_frame);
+
+void audio_reset_decoding(struct dec_audio *d_audio);
+
#endif /* MPLAYER_DEC_AUDIO_H */