Hi,

On Wed, Aug 31, 2011 at 1:24 AM, Mark Kenna
<[email protected]> wrote:
> Hi
>
> I am using the "av_new_stream" function to manually add a set of streams to
> a FormatContext, my question is how to "properly" remove some (but not all)
> of them
>
> For example I want to:
>
> //create 10 streams
> for (int i = 0; i < 10; i++)
> {
>     AVStream *st = av_new_stream(_formatContext, 0);
>     ...
>     ...
> }
>
> //close the first stream
> AVStream *firstStream = _formatContext.streams[0];
> av_free_stream(firstStream, _formatContext); //anything like this?
>
> //at this point I would expect _formatContext.nb_streams = 9
>
> Of course I could manually free the stream and decrement nb_streams right?

Right. There is no wrapper function for this.

I wonder if this may cause issues for those demuxers that have private
contexts for each stream. Changing the layout of streams[] would make
that private context data invalid...

Ronald
_______________________________________________
libav-api mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-api

Reply via email to