From 7f172339fdcdeb0393c1a296da95acb6fc57d3b8 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Thu, 23 Jan 2003 10:33:16 +0000 Subject: grab device is in AVFormatParameter (at least better than global variable) Originally committed as revision 1499 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/dv1394.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libavformat/dv1394.c') diff --git a/libavformat/dv1394.c b/libavformat/dv1394.c index 8515160545..f0b5e8d5ee 100644 --- a/libavformat/dv1394.c +++ b/libavformat/dv1394.c @@ -76,6 +76,7 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap { struct dv1394_data *dv = context->priv_data; AVStream *st; + const char *video_device; st = av_new_stream(context, 0); if (!st) @@ -83,14 +84,16 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap dv->width = DV1394_WIDTH; dv->height = DV1394_HEIGHT; - dv->channel = dv1394_channel; + dv->channel = ap->channel; dv->frame_rate = 30; dv->frame_size = DV1394_NTSC_FRAME_SIZE; /* Open and initialize DV1394 device */ - + video_device = ap->device; + if (!video_device) + video_device = "/dev/dv1394/0"; dv->fd = open(video_device, O_RDONLY); if (dv->fd < 0) { perror("Failed to open DV interface"); -- cgit v1.2.3