[FFmpeg-devel] [PATCH] O_BINARY for ffserver

Benoit Fouet benoit.fouet
Fri Jul 13 11:24:48 CEST 2007


Alex Beregszaszi wrote:
> Hi,
>
> albeit I dislike this way, it looks like this is now the preferred one
> ffmpeg.
>
> Attached patch applies O_BINARY flags in ffserver.
>
> --
> Alex
>   
> ------------------------------------------------------------------------
>
> Index: ffserver.c
> ===================================================================
> --- ffserver.c	(revision 9620)
> +++ ffserver.c	(working copy)
> @@ -2368,7 +2368,10 @@
>  
>  static int http_start_receive_data(HTTPContext *c)
>  {
> -    int fd;
> +    int fd, access = O_RDWR;
> +#ifdef O_BINARY
> +    access |= O_BINARY;
> +#endif
>  
>      if (c->stream->feed_opened)
>          return -1;
> @@ -2378,7 +2381,7 @@
>          return -1;
>  
>      /* open feed */
> -    fd = open(c->stream->feed_filename, O_RDWR);
> +    fd = open(c->stream->feed_filename, access);
>      if (fd < 0)
>          return -1;
>      c->feed_fd = fd;
> @@ -3465,7 +3468,10 @@
>  
>      /* create feed files if needed */
>      for(feed = first_feed; feed != NULL; feed = feed->next_feed) {
> -        int fd;
> +        int fd, access = O_RDONLY;
> +#ifdef O_BINARY
> +        access = O_BINARY;
> +#endif
>   

access |= O_BINARY;

>  
>          if (url_exist(feed->feed_filename)) {
>              /* See if it matches */
> @@ -3574,7 +3580,7 @@
>              url_fclose(&s->pb);
>          }
>          /* get feed size and write index */
> -        fd = open(feed->feed_filename, O_RDONLY);
> +        fd = open(feed->feed_filename, access);
>          if (fd < 0) {
>              fprintf(stderr, "Could not open output feed file '%s'\n",
>                      feed->feed_filename);

-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the ffmpeg-devel mailing list