[FFmpeg-devel] Realmedia patch

Ronald S. Bultje rsbultje
Mon Sep 1 16:07:55 CEST 2008


Hi Luca,

On Mon, Sep 1, 2008 at 7:41 AM, Luca Abeni <lucabe72 at email.it> wrote:
> Ronald S. Bultje wrote:
> [...]
>      RTSPHeader reply1, *reply = &reply1;
> -    char cmd[2048];
> +    char cmd[2048], trans_pref[16];
> +
> +    if (rt->server_type == RTSP_SERVER_RDT)
> +        strcpy(trans_pref, "x-pn-tng");
> +    else
> +        strcpy(trans_pref, "RTP/AVP");
>
> I realize now that you could use
>      const char *trans_pref;
>
>      if (rt->server_type == RTSP_SERVER_RDT)
>          trans_pref = "x-pn-tng";
>      else
>          trans_pref = "RTP/AVP";
> saving some memory and a call to strcpy().
>
> [...]
> +        if (rt->server_type == RTSP_SERVER_RDT) {
> +            char tmp[256], real_res[41], real_csum[9];
> +            ff_rdt_calc_response_and_checksum(real_res, real_csum,
> +                                              real_challenge);
> +            snprintf(tmp, sizeof(tmp),
> +                     "If-Match: %s\r\n"
> +                     "RealChallenge2: %s, sd=%s\r\n",
> +                     rt->session_id, real_res, real_csum);
> +            av_strlcat(cmd, tmp, sizeof(cmd));
>
> Cannot you use av_strlcatf() here?

Ah, yes, I think I made a second patch where I moved it to
av_strlcatf(), that's what happens if you have too many patches... New
patch attached with suggested modifications.

Ronald
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rtsp-setup.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080901/5c0c3df7/attachment.txt>



More information about the ffmpeg-devel mailing list