[FFmpeg-devel] [PATCH] Add an RTSP muxer

Diego Biurrun diego
Mon Jan 4 16:35:33 CET 2010


On Mon, Jan 04, 2010 at 05:11:13PM +0200, Martin Storsj? wrote:
> 
> 
> From bcc2219ea1d544807aab24668086973a1de00625 Mon Sep 17 00:00:00 2001
> From: Martin Storsjo <martin at martin.st>
> Date: Mon, 4 Jan 2010 16:07:04 +0200
> Subject: [PATCH 19/24] Create RTPMuxContext objects as private transport for output RTSP sessions
> 
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -682,11 +683,15 @@ static void rtsp_close_streams(RTSPState *rt)
>          rtsp_st = rt->rtsp_streams[i];
>          if (rtsp_st) {
>              if (rtsp_st->transport_priv) {
> +                if (rt->is_output) {
> +                    ff_rtp_write_close(rtsp_st->transport_priv);
> +                } else {
>                  if (rt->transport == RTSP_TRANSPORT_RDT)
>                      ff_rdt_parse_close(rtsp_st->transport_priv);
>                  else
>                      rtp_parse_close(rtsp_st->transport_priv);
>              }
> +            }
>              if (rtsp_st->rtp_pb)
>                  url_fclose(rtsp_st->rtp_pb);
>              else if (rtsp_st->rtp_handle)

The indentation of the closing brace is off.  Also I think this would
be more readable if you merged the else and the if line.

> From 20f92d556b98b5f9a51932c10a1e97a8351a56e3 Mon Sep 17 00:00:00 2001
> From: Martin Storsjo <martin at martin.st>
> Date: Mon, 4 Jan 2010 16:42:17 +0200
> Subject: [PATCH 24/24] Add an RTSP muxer
> 
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -44,7 +44,7 @@
>  
> -#if CONFIG_RTSP_DEMUXER
> +#if CONFIG_RTSP_DEMUXER || CONFIG_RTSP_MUXER
>  static int tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
>                             uint8_t *buf, int buf_size);
>  static int rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,

All those #ifdefs make me think that it's time to split this file.

Diego



More information about the ffmpeg-devel mailing list