[FFmpeg-devel] [PATCH] reformat rtsp.c

Ronald S. Bultje rsbultje
Thu Jan 7 00:27:23 CET 2010


Hi,

On Tue, Jan 5, 2010 at 5:49 AM, Diego Biurrun <diego at biurrun.de> wrote:
> Have you given uncrustify a shot?

No, but will do.

> On Mon, Jan 04, 2010 at 07:12:17PM -0500, Ronald S. Bultje wrote:
>> -/* parse the rtpmap description: <codec_name>/<clock_rate>[/<other
>> - ? params>] */
>> +/** parse the rtpmap description: <codec_name>/<clock_rate>[/<other
>> + * params>] */
>
> The doxygen conversion looks unrelated. ?There is more below.

OK, removed all of them.

>> - ? ? ? ?/* We are in a standard case ( from http://www.iana.org/assignments/rtp-parameters) */
>> + ? ? ? ?/* We are in a standard case
>> + ? ? ? ? * ( from http://www.iana.org/assignments/rtp-parameters). */
>
> (from

Done.

>> ? ? ? ? ?c_name = c->name;
>> ? ? ?else
>> - ? ? ? ?c_name = (char *)NULL;
>> + ? ? ? ?c_name = NULL;
>
> That looks unrelated as well.

Fixed (and added space between).

>> ? ? ? ? ? ? ?rtsp_st = st->priv_data;
>> - ? ? ? ? ? ?sdp_parse_rtpmap(st->codec, rtsp_st, payload_type, p);
>> + ? ? ? ? ? ?sdp_parse_rtpmap(s, st->codec, rtsp_st, payload_type, p);
>
> Why did you insert 's' in there?

Log context, but removed in this iteration (will do separately).

>> - ? ? ? ? ? ? ? ? ? ?if(rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->parse_sdp_a_line) {
>> - ? ? ? ? ? ? ? ? ? ? ? ?if(!rtsp_st->dynamic_handler->parse_sdp_a_line(s, i, rtsp_st->dynamic_protocol_context, buf)) {
>> - ? ? ? ? ? ? ? ? ? ? ? ? ? ?sdp_parse_fmtp(st, p);
>> - ? ? ? ? ? ? ? ? ? ? ? ?}
>> - ? ? ? ? ? ? ? ? ? ?} else {
>> + ? ? ? ? ? ? ? ? ? ?if (!(rtsp_st->dynamic_handler &&
>> + ? ? ? ? ? ? ? ? ? ? ? ? ?rtsp_st->dynamic_handler->parse_sdp_a_line &&
>> + ? ? ? ? ? ? ? ? ? ? ? ? ?rtsp_st->dynamic_handler->parse_sdp_a_line(s,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?i, rtsp_st->dynamic_protocol_context, buf)))
>
> That does not look like reformatting and is probably one of the cases
> where long lines keep things more readable.

I'm not sure. I can revert to the old syntax but it was about as
unreadable in a 80-char terminal as anything you've ever seen.

>> ? ? ? ? ? ? ?/* first try in specified port range */
>> ? ? ? ? ? ? ?if (RTSP_RTP_PORT_MIN != 0) {
>> ? ? ? ? ? ? ? ? ?while(j <= RTSP_RTP_PORT_MAX) {
>
> while (

Done.

>> -/* ? ? ? ? ? ?then try on any port
>> -** ? ? ? ? ? ?if (url_open(&rtsp_st->rtp_handle, "rtp://", URL_RDONLY) < 0) {
>> -** ? ? ? ? ? ? ? ?err = AVERROR_INVALIDDATA;
>> -** ? ? ? ? ? ? ? ?goto fail;
>> -** ? ? ? ? ? ?}
>> -*/
>> +#if 0
>> + ? ? ? ? ? ?/* then try on any port */
>> + ? ? ? ? ? ?if (url_open(&rtsp_st->rtp_handle, "rtp://", URL_RDONLY) < 0) {
>> + ? ? ? ? ? ? ? ?err = AVERROR_INVALIDDATA;
>> + ? ? ? ? ? ? ? ?goto fail;
>> + ? ? ? ? ? ?}
>> +#endif
>
> Maybe just remove such cruft?

Maybe, yes. Luca? (Let's do that separately, independent from this patch.)

Ronald



More information about the ffmpeg-devel mailing list