]> rtime.felk.cvut.cz Git - frescor/demo.git/blobdiff - src/recorder/ffmpeg.c
Progress in O_DIRECT handling - not completed
[frescor/demo.git] / src / recorder / ffmpeg.c
index 6e33dbe9cdc8546f11de73c41012896d2d68ff43..f6252571bd8e1b5dcd76a569a6428e95fdff9619 100644 (file)
@@ -22,7 +22,7 @@
 /* needed for usleep() */
 #define _XOPEN_SOURCE 600
 
-#include "config.h"
+#include <ffmpeg-config.h>
 #include <ctype.h>
 #include <string.h>
 #include <math.h>
@@ -1586,9 +1586,10 @@ timespec_subtract (struct timespec *result,
   return x->tv_sec < y->tv_sec;
 }
 
+#ifdef CONFIG_FFMPEG_WITH_FRSH
 frsh_vres_id_t disk_vres;
 frsh_contract_t disk_contract;
-
+#endif
 
 static void
 print_timing(void)
@@ -1610,8 +1611,10 @@ print_timing(void)
        printf("%5d: interframe interval = 1/%5.2lf s  avg=1/%.2f  stddev=1/%3.2f\n",
               f, 1/ifi, 1/ifi_avg, 1/sqrt(ifi_var));
 
+#ifdef CONFIG_FFMPEG_WITH_FRSH
        if (renegotiate == f)
                frsh_contract_renegotiate_sync(&disk_contract, disk_vres);
+#endif
 out:
        start = end;
 }
@@ -3502,10 +3505,22 @@ static void opt_output_file(const char *filename)
         }
 
         /* open the file */
-        if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
+        if (url_fopen(&oc->pb, filename, URL_WRONLY|URL_DIRECT) < 0) {
             fprintf(stderr, "Could not open '%s'\n", filename);
             av_exit(1);
         }
+
+       if (0) {
+               int i;
+               for (i=0; i<0x81; i++) {
+                       put_le32(oc->pb, i);
+                       if (i==0x42)
+                               put_flush_packet(oc->pb);
+               }
+               url_close_buf(oc->pb);
+               url_fclose(oc->pb);
+               exit(0);
+       }
     }
 
     memset(ap, 0, sizeof(*ap));