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

Mike Scheutzow scheutzow
Wed Jun 16 22:22:21 CEST 2010


Stefano Sabatini wrote:
>> Index: ffmpeg.c
> [...]  
>> +/* arg format is "output-stream-index:streamid-value". */
>> +static void opt_streamid(const char *opt, const char *arg)
>> +{
>> +    int idx;
>> +    char *p;
>> +
>> +    idx = strtol(arg, &p, 0);
>> +    if (*p != ':' || idx < 0 || idx >= MAX_STREAMS) {
>> +        fprintf(stderr, "Invalid %s '%s'\n", opt, arg);
>> +        av_exit(1);
>> +    }
> 
> I'm still a bit unstatisfied about this, this will accept invalid
> string, maybe you could pre-parse the string before. Anyway please use
> a explicative message, for example:
> "Invalid value '%s' for option '%s', not a number or not in the range %d - %d".

Implemented the pre-parsing in ffmpeg_set_streamid_v5.patch, and retested.

> Rest of the patch looks fine to me.


Mike Scheutzow
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffmpeg_set_streamid_v5.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100616/e9737813/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mpegts_custom_pids_v6.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100616/e9737813/attachment.asc>



More information about the ffmpeg-devel mailing list