]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/vfwcap.c
lavdevice: Add AudioToolbox output device.
[ffmpeg] / libavdevice / vfwcap.c
index f03d38ac2629c31e5a5a35c9a26ed7f7730c4c81..e2ab276c2e42f1ebc978604046bb10942c277204 100644 (file)
@@ -256,7 +256,7 @@ static int vfw_read_header(AVFormatContext *s)
     int ret;
     AVRational framerate_q;
 
-    if (!strcmp(s->filename, "list")) {
+    if (!strcmp(s->url, "list")) {
         for (devnum = 0; devnum <= 9; devnum++) {
             char driver_name[256];
             char driver_ver[256];
@@ -279,7 +279,7 @@ static int vfw_read_header(AVFormatContext *s)
     }
 
     /* If atoi fails, devnum==0 and the default device is used */
-    devnum = atoi(s->filename);
+    devnum = atoi(s->url);
 
     ret = SendMessage(ctx->hwnd, WM_CAP_DRIVER_CONNECT, devnum, 0);
     if(!ret) {
@@ -328,11 +328,14 @@ static int vfw_read_header(AVFormatContext *s)
     }
 
     if (ctx->video_size) {
-        ret = av_parse_video_size(&bi->bmiHeader.biWidth, &bi->bmiHeader.biHeight, ctx->video_size);
+        int w, h;
+        ret = av_parse_video_size(&w, &h, ctx->video_size);
         if (ret < 0) {
             av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
             goto fail;
         }
+        bi->bmiHeader.biWidth  = w;
+        bi->bmiHeader.biHeight = h;
     }
 
     if (0) {