[Ffmpeg-devel] [PATCH] MPTS support in mpegts.c
Michael Niedermayer
michaelni
Thu Mar 30 16:05:51 CEST 2006
Hi
On Tue, Mar 14, 2006 at 09:22:52AM -0500, Andy Brown wrote:
> This patch allows selection of which service to use if the mpegts file contains
> more than one. The original file searched for all the services but then only
> configured the streams for the first one. Now it allows chosing which service
> to configure streams for based on the channel member of the AVFormatParameters
> structure (if not specified or set to 0 it behaves as it originally did).
>
> In order to obtain a list of services (ids and names) that the
> mpegts_read_header() function discovers, I had to add another function
> (get_channels) to the AVInputFormat structure as well as a new AVChannel
> structure (both in avformat.h).
>
> While the ideal solution would provide a way to determine services without
> having to call functions twice, this was a good compromise with minimal
> changes. I'm successfully using this change with the following series of calls
> in my application:
>
> av_open_input_file(frmt, NULL);
> if(frmt->iformat->get_channels) {
> count = frmt->iformat->get_channels(frmt, chan);
> if (count > 1 && chan) {
> av_close_input_file(frmt);
> /* add code here to select desired service -> sid */
> param.channel = sid;
> av_open_input_file(frmt, ¶m);
> }
> if (chan) av_free(chan);
> }
iam strongly against this change, a demuxer demuxes all chanels which dont
have discard set and the application then can do anything it likes with
the result
[...]
--
Michael
More information about the ffmpeg-devel
mailing list