summaryrefslogtreecommitdiff
path: root/libavformat/grab.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-01-23 10:33:16 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-01-23 10:33:16 +0000
commit7f172339fdcdeb0393c1a296da95acb6fc57d3b8 (patch)
treeed930c7e3f091d4bd816974e8da19c548eab08f9 /libavformat/grab.c
parent79a7c2683e12398725dbf2fa8984ea371a6965ce (diff)
grab device is in AVFormatParameter (at least better than global variable)
Originally committed as revision 1499 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/grab.c')
-rw-r--r--libavformat/grab.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/grab.c b/libavformat/grab.c
index 263c2946b9..1c6eafb6c4 100644
--- a/libavformat/grab.c
+++ b/libavformat/grab.c
@@ -62,6 +62,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
int ret, frame_rate;
int desired_palette;
struct video_audio audio;
+ const char *video_device;
if (!ap || ap->width <= 0 || ap->height <= 0 || ap->frame_rate <= 0)
return -1;
@@ -78,6 +79,9 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
s->height = height;
s->frame_rate = frame_rate;
+ video_device = ap->device;
+ if (!video_device)
+ video_device = "/dev/video";
video_fd = open(video_device, O_RDWR);
if (video_fd < 0) {
perror(video_device);