diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-01-23 10:33:16 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-01-23 10:33:16 +0000 |
commit | 7f172339fdcdeb0393c1a296da95acb6fc57d3b8 (patch) | |
tree | ed930c7e3f091d4bd816974e8da19c548eab08f9 /libavformat/grab.c | |
parent | 79a7c2683e12398725dbf2fa8984ea371a6965ce (diff) | |
download | ffmpeg-7f172339fdcdeb0393c1a296da95acb6fc57d3b8.tar.gz |
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.c | 4 |
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); |