[FFmpeg-devel] [PATCH] ffserver: factorize code setting ReadOnlyFile/File options

Clément Bœsch u at pkh.me
Thu Nov 28 22:17:25 CET 2013


On Thu, Nov 28, 2013 at 09:07:20PM +0100, Stefano Sabatini wrote:
> ---
>  ffserver.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/ffserver.c b/ffserver.c
> index 342c5fa..a927a07 100644
> --- a/ffserver.c
> +++ b/ffserver.c
> @@ -4209,18 +4209,13 @@ static int parse_ffconfig(const char *filename)
>                      goto end;
>                  }
>              }
> -        } else if (!av_strcasecmp(cmd, "ReadOnlyFile")) {
> +        } else if (!av_strcasecmp(cmd, "File") || !av_strcasecmp(cmd, "ReadOnlyFile")) {
>              if (feed) {
>                  get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
> -                feed->readonly = 1;
> +                feed->readonly = !av_strcasecmp(cmd, "ReadOnlyFile");

nit++: !av_strncasecmp(cmd, "ReadOnly", 8)

>              } else if (stream) {
>                  get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
>              }
> -        } else if (!av_strcasecmp(cmd, "File")) {
> -            if (feed) {
> -                get_arg(feed->feed_filename, sizeof(feed->feed_filename), &p);
> -            } else if (stream)
> -                get_arg(stream->feed_filename, sizeof(stream->feed_filename), &p);
>          } else if (!av_strcasecmp(cmd, "Truncate")) {
>              if (feed) {
>                  get_arg(arg, sizeof(arg), &p);

LGTM

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131128/6236da7a/attachment.asc>


More information about the ffmpeg-devel mailing list