[FFmpeg-devel] [PATCH] options to set stream id (custom TS pid)

Baptiste Coudurier baptiste.coudurier
Sun Jun 13 02:01:24 CEST 2010


On 6/7/10 8:24 AM, Mike Scheutzow wrote:
> Thank you for your feedback.
>
> Here are updated versions of both the ffmpeg.c and mpegtsenc.c patches.
>
>> On Sun, Jun 06, 2010 at 01:48:51PM -0700, Baptiste Coudurier wrote:
>>>> +
>>>> + memset( streamid_map, 0, sizeof(streamid_map) );
>>>> }
>>> Parantheses placement.
>
> I removed the two spaces.
>
>>>> + /* maintain compatibility for apps that set st->id to AVStream
>>>> index */
>>>> + if (st->id>= 16) {
>>> This is not the reason, pid < 16 are reserved.
>
> I changed the comment. I also rearranged the range check on st->id,
> which I think makes the intent more clear.
>
> Note: the code does not error out for negative st->id value so that the
> muxer continues to behave the same way it used to for that case.
>
> [...]
>
> Index: libavformat/mpegtsenc.c
> ===================================================================
> --- libavformat/mpegtsenc.c	(revision 23373)
> +++ libavformat/mpegtsenc.c	(working copy)
>
 > [...]
 >
> @@ -419,7 +424,28 @@
>               goto fail;
>           st->priv_data = ts_st;
>           ts_st->service = service;
> -        ts_st->pid = DEFAULT_START_PID + i;
> +        /* MPEG pid values<  16 are reserved. Applications which set st->id in
> +         * this range are assigned a calculated pid. */
> +        if ( st->id<  16 ) {

Space around parentheses.

Patch ok otherwise.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list