[FFmpeg-devel] [PATCH] Rename find_program_from_stream to av_find_program_from_stream and make it public

Michael Niedermayer michaelni
Sat Feb 19 21:44:19 CET 2011


On Sat, Feb 19, 2011 at 05:02:58PM +0000, M?ns Rullg?rd wrote:
> Marton Balint <cus at passwd.hu> writes:
> 
> > Hi,
> >
> > The find_program_from_stream is a useful funcion that should not be
> > static. For example, if you want to implement program switching in
> > ffplay, it might come very handy...
> >
> > Regards,
> >   Marton
> >
> > commit a4cce8c55fc159efd2d6f61b51c7650710e5d6ea
> > Author: Marton Balint <cus at passwd.hu>
> > Date:   Fri Feb 18 21:40:03 2011 +0100
> >
> >     Rename find_program_from_stream to av_find_program_from_stream and add it to avformat.h
> > ---
> >  libavformat/avformat.h |    9 +++++++++
> >  libavformat/utils.c    |    4 ++--
> >  2 files changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> > index 63cac8f..644a36f 100644
> > --- a/libavformat/avformat.h
> > +++ b/libavformat/avformat.h
> > @@ -1119,6 +1119,15 @@ AVFormatContext *avformat_alloc_context(void);
> >  int av_find_stream_info(AVFormatContext *ic);
> >
> >  /**
> > + * Find the program which belongs to a given stream.
> > + *
> > + * @param ic                media file handle
> > + * @param s                 stream index
> > + * @return  the program which belongs to s, NULL if no program is found.
> > + */
> > +AVProgram *av_find_program_from_stream(AVFormatContext *ic, int s);
> 
> A stream may belong to multiple programs.  What is the proper thing to
> when that is the case?  We should decide on this before making the
> function public.

enumerate all programs or return/fill an array.

one possibility:
AVProgram *av_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int s);

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110219/7c2a2e9d/attachment.pgp>



More information about the ffmpeg-devel mailing list