Remove some unnecessary recursive includes

Remove some #include lines from headers, some of those removals made
possible by using incomplete struct types instead of typedefs. Include
mp_osd.h in mplayer.c and command.c after removing it from mp_core.h.
Remove "#ifdef USE_ASS" around some "struct ass_track_s *" fields
which will now compile even without ASS support.
This commit is contained in:
Uoti Urpala 2008-04-23 09:49:25 +03:00
parent 66bd120a3a
commit c510959da5
5 changed files with 17 additions and 30 deletions

View File

@ -18,6 +18,7 @@
#include "metadata.h"
#include "libmpcodecs/vf.h"
#include "libmpcodecs/vd.h"
#include "mp_osd.h"
#include "libvo/video_out.h"
#include "libvo/font_load.h"
#include "playtree.h"

View File

@ -6,9 +6,6 @@
#include <string.h>
#include "stream/stream.h"
#ifdef USE_ASS
#include "libass/ass_types.h"
#endif
struct MPOpts;
@ -108,7 +105,7 @@ typedef struct demux_packet_st {
struct demux_packet_st* next;
} demux_packet_t;
typedef struct {
typedef struct demux_stream {
int buffer_pos; // current buffer position
int buffer_size; // current buffer size
unsigned char* buffer; // current buffer, never free() it, always use free_demux_packet(buffer_ref);

View File

@ -1,7 +1,6 @@
#ifndef MPLAYER_STHEADER_H
#define MPLAYER_STHEADER_H
#include "demuxer.h"
#include "aviheader.h"
#include "ms_hdr.h"
struct MPOpts;
@ -11,7 +10,7 @@ struct MPOpts;
typedef struct sh_audio {
struct MPOpts *opts;
int aid;
demux_stream_t *ds;
struct demux_stream *ds;
struct codecs_st *codec;
unsigned int format;
int initialized;
@ -59,7 +58,7 @@ typedef struct sh_audio {
typedef struct sh_video {
struct MPOpts *opts;
int vid;
demux_stream_t *ds;
struct demux_stream *ds;
struct codecs_st *codec;
unsigned int format;
int initialized;
@ -109,9 +108,7 @@ typedef struct sh_sub {
int forced_subs_only;
unsigned char* extradata; // extra header data passed from demuxer
int extradata_len;
#ifdef USE_ASS
ass_track_t* ass_track; // for SSA/ASS streams (type == 'a')
#endif
struct ass_track_s *ass_track; // for SSA/ASS streams (type == 'a')
char* lang; // track language
int default_track;
} sh_sub_t;

View File

@ -2,14 +2,7 @@
#define MPLAYER_MP_CORE_H
#include "options.h"
#include "mp_osd.h"
#include "libao2/audio_out.h"
#include "playtree.h"
#include "stream/stream.h"
#include "libmpdemux/demuxer.h"
#include "libmpdemux/stheader.h"
#include "mixer.h"
#include "libvo/video_out.h"
#include "subreader.h"
// definitions used internally by the core player code
@ -48,18 +41,18 @@ typedef struct MPContext {
int osd_show_percentage;
int osd_function;
const ao_functions_t *audio_out;
play_tree_t *playtree;
play_tree_iter_t *playtree_iter;
struct play_tree *playtree;
struct play_tree_iter *playtree_iter;
int eof;
int play_tree_step;
stream_t *stream;
demuxer_t *demuxer;
sh_audio_t *sh_audio;
sh_video_t *sh_video;
demux_stream_t *d_audio;
demux_stream_t *d_video;
demux_stream_t *d_sub;
struct stream_st *stream;
struct demuxer_st *demuxer;
struct sh_audio *sh_audio;
struct sh_video *sh_video;
struct demux_stream *d_audio;
struct demux_stream *d_video;
struct demux_stream *d_sub;
mixer_t mixer;
struct vo *video_out;
// Frames buffered in the vo ready to flip. Currently always 0 or 1.
@ -88,11 +81,9 @@ typedef struct MPContext {
int set_of_sub_pos;
int set_of_sub_size;
int global_sub_indices[SUB_SOURCES];
#ifdef USE_ASS
// set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
// parsed by libass or NULL if format unsupported
ass_track_t* set_of_ass_tracks[MAX_SUBTITLE_FILES];
#endif
struct ass_track_s *set_of_ass_tracks[MAX_SUBTITLE_FILES];
sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
int file_format;
@ -118,7 +109,7 @@ extern int file_filter;
extern int forced_subs_only;
int build_afilter_chain(struct MPContext *mpctx, sh_audio_t *sh_audio, ao_data_t *ao_data);
int build_afilter_chain(struct MPContext *mpctx, struct sh_audio *sh_audio, struct ao_data_s *ao_data);
void uninit_player(struct MPContext *mpctx, unsigned int mask);
void reinit_audio_chain(struct MPContext *mpctx);
void init_vo_spudec(struct MPContext *mpctx);

View File

@ -54,6 +54,7 @@
#include "subreader.h"
#include "mp_osd.h"
#include "libvo/video_out.h"
#include "libvo/font_load.h"