Mercurial > mplayer.hg
changeset 30582:85aaf16401b5
Move up demux_ogg_sub_id, demux_ogg_sub_reverse_id; avoids forward declarations.
author | diego |
---|---|
date | Wed, 17 Feb 2010 23:25:02 +0000 |
parents | fef54a0e6ec2 |
children | c8b12c3fc5a5 |
files | libmpdemux/demux_ogg.c |
diffstat | 1 files changed, 25 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c Wed Feb 17 23:10:56 2010 +0000 +++ b/libmpdemux/demux_ogg.c Wed Feb 17 23:25:02 2010 +0000 @@ -367,7 +367,31 @@ return 0; } -static int demux_ogg_sub_reverse_id(demuxer_t *demuxer, int id); +/** \brief Change the current subtitle stream and return its ID. + + \param demuxer The demuxer whose subtitle stream will be changed. + \param new_num The number of the new subtitle track. The number must be + between 0 and ogg_d->n_text - 1. + + \returns The Ogg stream number ( = page serial number) of the newly selected + track. +*/ +int demux_ogg_sub_id(demuxer_t *demuxer, int index) { + ogg_demuxer_t *ogg_d = demuxer->priv; + return (index < 0) ? index : (index >= ogg_d->n_text) ? -1 : ogg_d->text_ids[index]; +} + +/** \brief Translate the ogg track number into the subtitle number. + * \param demuxer The demuxer about whose subtitles we are inquiring. + * \param id The ogg track number of the subtitle track. + */ +static int demux_ogg_sub_reverse_id(demuxer_t *demuxer, int id) { + ogg_demuxer_t *ogg_d = demuxer->priv; + int i; + for (i = 0; i < ogg_d->n_text; i++) + if (ogg_d->text_ids[i] == id) return i; + return -1; +} /// Try to print out comments and also check for LANGUAGE= tag static void demux_ogg_check_comments(demuxer_t *d, ogg_stream_t *os, int id, vorbis_comment *vc) @@ -641,34 +665,6 @@ void print_wave_header(WAVEFORMATEX *h, int verbose_level); void print_video_header(BITMAPINFOHEADER *h, int verbose_level); -/** \brief Change the current subtitle stream and return its ID. - - \param demuxer The demuxer whose subtitle stream will be changed. - \param new_num The number of the new subtitle track. The number must be - between 0 and ogg_d->n_text - 1. - - \returns The Ogg stream number ( = page serial number) of the newly selected - track. -*/ -int demux_ogg_sub_id(demuxer_t *demuxer, int index) { - ogg_demuxer_t *ogg_d = demuxer->priv; - return (index < 0) ? index : (index >= ogg_d->n_text) ? -1 : ogg_d->text_ids[index]; -} - -/** \brief Translate the ogg track number into the subtitle number. - * \param demuxer The demuxer about whose subtitles we are inquiring. - * \param id The ogg track number of the subtitle track. - */ -static int demux_ogg_sub_reverse_id(demuxer_t *demuxer, int id) { - ogg_demuxer_t *ogg_d = demuxer->priv; - int i; - for (i = 0; i < ogg_d->n_text; i++) - if (ogg_d->text_ids[i] == id) return i; - return -1; -} - -static void demux_close_ogg(demuxer_t* demuxer); - static void fixup_vorbis_wf(sh_audio_t *sh, ogg_demuxer_t *od) { int i, offset;