[FFmpeg-cvslog] libavdevice: use avpriv_open()

Rémi Denis-Courmont git at videolan.org
Thu Aug 8 11:46:55 CEST 2013


ffmpeg | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug  6 21:19:27 2013 +0300| [71bf6b41d974229a06921806c333ce98566a5d8a] | committer: Anton Khirnov

libavdevice: use avpriv_open()

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=71bf6b41d974229a06921806c333ce98566a5d8a
---

 libavdevice/bktr.c      |    3 ++-
 libavdevice/dv1394.c    |    3 ++-
 libavdevice/fbdev.c     |    3 ++-
 libavdevice/oss_audio.c |    5 +++--
 libavdevice/v4l2.c      |    2 +-
 5 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index a147d38..725d90f 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -26,6 +26,7 @@
 
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
+#include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
@@ -136,7 +137,7 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
     act.sa_handler = catchsignal;
     sigaction(SIGUSR1, &act, &old);
 
-    *tuner_fd = open("/dev/tuner0", O_RDONLY);
+    *tuner_fd = avpriv_open("/dev/tuner0", O_RDONLY);
     if (*tuner_fd < 0)
         av_log(NULL, AV_LOG_ERROR, "Warning. Tuner not opened, continuing: %s\n", strerror(errno));
 
diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c
index ce8efa6..d259e1a 100644
--- a/libavdevice/dv1394.c
+++ b/libavdevice/dv1394.c
@@ -27,6 +27,7 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "libavformat/avformat.h"
@@ -88,7 +89,7 @@ static int dv1394_read_header(AVFormatContext * context)
         goto failed;
 
     /* Open and initialize DV1394 device */
-    dv->fd = open(context->filename, O_RDONLY);
+    dv->fd = avpriv_open(context->filename, O_RDONLY);
     if (dv->fd < 0) {
         av_log(context, AV_LOG_ERROR, "Failed to open DV interface: %s\n", strerror(errno));
         goto failed;
diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index b820a4a..22c53a3 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -34,6 +34,7 @@
 #include <time.h>
 #include <linux/fb.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
@@ -114,7 +115,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
     if (avctx->flags & AVFMT_FLAG_NONBLOCK)
         flags |= O_NONBLOCK;
 
-    if ((fbdev->fd = open(avctx->filename, flags)) == -1) {
+    if ((fbdev->fd = avpriv_open(avctx->filename, flags)) == -1) {
         ret = AVERROR(errno);
         av_log(avctx, AV_LOG_ERROR,
                "Could not open framebuffer device '%s': %s\n",
diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c
index e3b9d67..f1cc91f 100644
--- a/libavdevice/oss_audio.c
+++ b/libavdevice/oss_audio.c
@@ -34,6 +34,7 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 
+#include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "libavutil/time.h"
@@ -63,9 +64,9 @@ static int audio_open(AVFormatContext *s1, int is_output, const char *audio_devi
     char *flip = getenv("AUDIO_FLIP_LEFT");
 
     if (is_output)
-        audio_fd = open(audio_device, O_WRONLY);
+        audio_fd = avpriv_open(audio_device, O_WRONLY);
     else
-        audio_fd = open(audio_device, O_RDONLY);
+        audio_fd = avpriv_open(audio_device, O_RDONLY);
     if (audio_fd < 0) {
         av_log(s1, AV_LOG_ERROR, "%s: %s\n", audio_device, strerror(errno));
         return AVERROR(EIO);
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 23d58ab..adb289d 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -124,7 +124,7 @@ static int device_open(AVFormatContext *ctx)
         flags |= O_NONBLOCK;
     }
 
-    fd = open(ctx->filename, flags, 0);
+    fd = avpriv_open(ctx->filename, flags);
     if (fd < 0) {
         err = errno;
 



More information about the ffmpeg-cvslog mailing list