Fix type mismatch 84/281284/4
authorjiyong.min <jiyong.min@samsung.com>
Thu, 15 Sep 2022 06:53:03 +0000 (15:53 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Fri, 16 Sep 2022 00:39:27 +0000 (09:39 +0900)
Change-Id: Ifcb49ce2401bd399c510f27288b69950ab410839

include/mm_file.h
tests/mm_file_test.c

index 76009cf..f4ba486 100755 (executable)
@@ -639,7 +639,7 @@ int mm_file_get_synclyrics_info(MMHandleType tag_attrs, int index, unsigned long
  * @remarks @a frame must be released with @c free() by you
  *
  * @param [in] path The file path
- * @param [in] timestamp The timestamp in milliseconds
+ * @param [in] timestamp The timestamp in microseconds
  * @param [in] is_accurate @a true, user can get an accurated frame for given the timestamp.\n
  * @a false, user can only get the nearest i-frame of video rapidly.
  * @param [out] frame raw frame data in RGB888
index f808383..c9716cb 100755 (executable)
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include <mm_file.h>
 #include "mm_file_debug.h"
@@ -39,13 +40,13 @@ static struct timeval start, finish;
                } while(0)
 #define MM_TIME_CHECK_FINISH(title) do { \
                        gettimeofday(&finish, NULL); \
-                       double end_time = (finish.tv_sec + 1e-6*finish.tv_usec); \
-                       double start_time = (start.tv_sec + 1e-6*start.tv_usec); \
+                       int64_t end_time = (finish.tv_sec * 1000 + finish.tv_usec / 1000); \
+                       int64_t start_time = (start.tv_sec * 1000 + start.tv_usec / 1000); \
                        if (msg_tmp_fp != NULL) { \
                                fprintf(msg_tmp_fp, "%s\n", title); \
-                               fprintf(msg_tmp_fp, " - start_time:   %3.5lf sec\n", start_time); \
-                               fprintf(msg_tmp_fp, " - finish_time:  %3.5lf sec\n", end_time); \
-                               fprintf(msg_tmp_fp, " - elapsed time: %3.5lf sec\n", end_time - start_time); \
+                               fprintf(msg_tmp_fp, " - start_time:   %"PRId64" msec\n", start_time); \
+                               fprintf(msg_tmp_fp, " - finish_time:  %"PRId64" msec\n", end_time); \
+                               fprintf(msg_tmp_fp, " - elapsed time: %"PRId64" msec\n", end_time - start_time); \
                                fflush(msg_tmp_fp); fclose(msg_tmp_fp); \
                        } \
                } while(0)
@@ -603,12 +604,12 @@ static void __get_video_frame(const char *path, const char *accurate, bool file_
        int width = 0;
        int height = 0;
        bool is_accurate = false;
-       unsigned long long time_stamp = 5 * 1000 * 1000;                //5sec
+       double time_stamp = 5. * 1000 * 1000;           //5sec
 
        if (accurate && accurate[0] == '1')
                is_accurate = true;
 
-       printf("Extracting video frame for [%s] [%llu] accurate [%d]\n", path, time_stamp, is_accurate);
+       printf("Extracting video frame for [%s] [%f] accurate [%d]\n", path, time_stamp, is_accurate);
 
        if (file_test)
                ret = mm_file_get_video_frame(path, time_stamp, is_accurate, &_frame, &_frame_size, &width, &height);