[FFmpeg-devel] [PATCH] ffserver: cleanup

Reinhard Tartler siretart
Mon Mar 23 00:02:11 CET 2009


Baptiste Coudurier <baptiste.coudurier at gmail.com> writes:

> Hi,
>
> On 3/22/2009 11:08 AM, Reinhard Tartler wrote:
>> From: Reinhard Tartler <siretart at tauware.de>
>> Date: Sun, 22 Mar 2009 19:03:56 +0100
>> Subject: [PATCH] ffserver: cleanup
>> 
>> remove the trivial function do_switch_stream as it doesn't help to make
>> the code easier to understand.
>> ---
>>  ffserver.c |   17 ++---------------
>>  1 files changed, 2 insertions(+), 15 deletions(-)
>> 
>> diff --git a/ffserver.c b/ffserver.c
>> index 61ecf20..350a421 100644
>> --- a/ffserver.c
>> +++ b/ffserver.c
>> @@ -1150,19 +1150,6 @@ static int modify_current_stream(HTTPContext *c, char *rates)
>>      return action_required;
>>  }
>>  
>> -
>> -static void do_switch_stream(HTTPContext *c, int i)
>> -{
>> -    if (c->switch_feed_streams[i] >= 0) {
>> -#ifdef PHILIP
>> -        c->feed_streams[i] = c->switch_feed_streams[i];
>> -#endif
>> -
>> -        /* Now update the stream */
>> -    }
>> -    c->switch_feed_streams[i] = -1;
>> -}
>> -
>
> Did you try to figure out what was this function for ?

This function was introduced in r602/r630:

------------------------------------------------------------------------
r630 | philipjsg | 2002-05-30 04:49:07 +0200 (Do, 30. Mai 2002) | 20 lines

* New stuff and bug fixes:
* Change to dynamically allocated buffers. Should reduce memory footprint significantly
  as well as eliminate a call to av_abort!
* Better version of WMP rate switching infrastructure. Currently turned off till
  the PTS fixes are in.
* Added a Redirect type feature. This allows URLs served by ffserver to just
  redirect to somewhere else. You might want to do this. Really this needs to
  be enhanced -- say to handle all 404 pages.
* Add mechanism to automatically fire up ffmpeg on ffserver start. This is turned
  on by adding the Launch keyword to the <feed> definition.
* Add logic to take care of non-wmp user agents requesting .asf files. They now get
  a [reference] file with an appropriate mime type. This fixes the mplayer problem.
* Make sure that we have a large buffer for the stats page.
* Add a FaviconURL keyword to the status stream definition. If set, then it
  generates the appropriate HTML so that IE and Mozilla will display the favicon
  as appropriate. OK -- this is a pretty random feature.
* If the ffmpeg is running as a child of ffserver, then report it's CPU usage
  on the status page. [This is linux only -- maybe somebody could do the work for
  another OS. The tricky thing is getting the 'ps' command right.]

------------------------------------------------------------------------
r602 | philipjsg | 2002-05-26 05:36:34 +0200 (So, 26. Mai 2002) | 9 lines

* Add first cut of code to handle Windows Media Player rate switching
  requests. The current state is that at startup, WMP will get the
  best stream that it can handle. However, subsequent rate switching
  only puts a message in the log saying what the new stream ought to
  be. Solving this will be tricky. I guess that we would have to wait for
  key frames to appear in the new stream, and then switch over to it.
  Some care would be needed to deal with the PTS of the new stream
  versus the old stream.


But further than that, no. It just looked strange to me when reading
ffserver.c.

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4




More information about the ffmpeg-devel mailing list