[FFmpeg-devel] [PATCH] remove transport concatenation dead code

Ronald S. Bultje rsbultje
Mon Sep 1 01:48:45 CEST 2008


Hi,

at some point (long ago), transports were flags and it was apparently
planned to ask rtsp servers for multiple transports and just use
whatever worked for them. That code never did what it was supposed to
and nowadays, we don't use the flags anymore (see
make_setup_request()). However, the code for transport concatenation
is still there, it looks like this:

for(..) {
  char transport[];
  transport[0]=0;

  if (transport_type == UDP){
    if(transport[0]!=0)...
    snprintf(transport+strlen(transport), ...);
  } else if (transport_type == TCP){
    if(transport[0]!=0)...
    snprintf(transport+strlen(transport), ...);
  } else ... etc.
}

All code assuming the transport is already filled in is useless
because only one of the conditions is true at any given time, not more
(hence the if/else if/else if, not if/if/if). Attached patch removes
the dead code.

Ronald
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rtsp-remove-protocolcat.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080831/43e3d99a/attachment.asc>



More information about the ffmpeg-devel mailing list