Re: [FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-14 Thread Marton Balint


On Sun, 14 Feb 2016, Timothy Gu wrote:


On Sun, Feb 14, 2016 at 02:54:29AM +0100, Marton Balint wrote:


I have applied the series except the last one patching ffmpeg_opt.


This set seems to cause some issues in some FATE stations:

http://fatebeta.ffmpeg.org/report/armel5tej-qemu-debian-gcc4.4/20160214170733#failed_tests
http://fatebeta.ffmpeg.org/report/mips-ubuntu-qemu-gcc-4.4/20160214183331#failed_tests
http://fatebeta.ffmpeg.org/report/sh4-debian-qemu-gcc-4.7/20160214132808#failed_tests
http://fatebeta.ffmpeg.org/report/x86_32-linux-gnu-gcc-4.4.5/20160214082234#failed_tests
http://fatebeta.ffmpeg.org/report/x86_64-netbsd-gcc46/20160214193410#failed_tests



Yes I forgot about 32 bit time capabilities, now I have pushed the fix I 
earlier sent to the ML.


Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-14 Thread Timothy Gu
On Sun, Feb 14, 2016 at 02:54:29AM +0100, Marton Balint wrote:
> 
> I have applied the series except the last one patching ffmpeg_opt.

This set seems to cause some issues in some FATE stations:

http://fatebeta.ffmpeg.org/report/armel5tej-qemu-debian-gcc4.4/20160214170733#failed_tests
http://fatebeta.ffmpeg.org/report/mips-ubuntu-qemu-gcc-4.4/20160214183331#failed_tests
http://fatebeta.ffmpeg.org/report/sh4-debian-qemu-gcc-4.7/20160214132808#failed_tests
http://fatebeta.ffmpeg.org/report/x86_32-linux-gnu-gcc-4.4.5/20160214082234#failed_tests
http://fatebeta.ffmpeg.org/report/x86_64-netbsd-gcc46/20160214193410#failed_tests

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-13 Thread Marton Balint


On Wed, 10 Feb 2016, Marton Balint wrote:



On Sun, 7 Feb 2016, Marton Balint wrote:



On Sun, 7 Feb 2016, Michael Niedermayer wrote:


On Sat, Feb 06, 2016 at 08:13:12PM +0100, Marton Balint wrote:

Use av_gettime() instead of time(0) for querying current time.

Signed-off-by: Marton Balint 
---
 libavutil/parseutils.c| 12 +++-
 tests/ref/fate/parseutils |  4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)


after this (whole) patchset
./ffmpeg  -i lena.pnm -timestamp "2016-01-01 01:01:01" test.mp4
exiftool test.mp4
results in
Create Date : 1904:01:01 00:00:00
Modify Date : 1904:01:01 00:00:00



Hmm, apparently I missed the fact iso 8601 time specs can have timezone 
specifiers as well, even if they were not parsed but silently ignored by 
the existing function.


I will rework the second patch to fix that.


Anybody against this series? With the issues fixed pointed out by Michael, 
I believe it is pretty safe to apply, the one patch which may need 
consideration is the last one patching ffmpeg_opt.c and removing hardcoded 
"now" support in creation_time metadata because it may cause writing the 
actual string "now" as creation time for formats which do not parse 
creation_time metadata but write all metadata to the output blindly as a 
string.


I have applied the series except the last one patching ffmpeg_opt.

Regards
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-10 Thread Marton Balint


On Sun, 7 Feb 2016, Marton Balint wrote:



On Sun, 7 Feb 2016, Michael Niedermayer wrote:


On Sat, Feb 06, 2016 at 08:13:12PM +0100, Marton Balint wrote:

Use av_gettime() instead of time(0) for querying current time.

Signed-off-by: Marton Balint 
---
 libavutil/parseutils.c| 12 +++-
 tests/ref/fate/parseutils |  4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)


after this (whole) patchset
./ffmpeg  -i lena.pnm -timestamp "2016-01-01 01:01:01" test.mp4
exiftool test.mp4
results in
Create Date : 1904:01:01 00:00:00
Modify Date : 1904:01:01 00:00:00



Hmm, apparently I missed the fact iso 8601 time specs can have timezone 
specifiers as well, even if they were not parsed but silently ignored by 
the existing function.


I will rework the second patch to fix that.


Anybody against this series? With the issues fixed pointed out by Michael, 
I believe it is pretty safe to apply, the one patch which may need 
consideration is the last one patching ffmpeg_opt.c and removing hardcoded 
"now" support in creation_time metadata because it may cause writing the 
actual string "now" as creation time for formats which do not parse 
creation_time metadata but write all metadata to the output blindly as a 
string.


Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-06 Thread Marton Balint
Use av_gettime() instead of time(0) for querying current time.

Signed-off-by: Marton Balint 
---
 libavutil/parseutils.c| 12 +++-
 tests/ref/fate/parseutils |  4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index 9fb8d0a..fd8cf2b 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -31,13 +31,14 @@
 #include "random_seed.h"
 #include "time_internal.h"
 #include "parseutils.h"
+#include "time.h"
 
 #ifdef TEST
 
 #define av_get_random_seed av_get_random_seed_deterministic
 static uint32_t av_get_random_seed_deterministic(void);
 
-#define time(t) 1331972053
+#define av_gettime() 133197205320
 
 #endif
 
@@ -558,7 +559,7 @@ time_t av_timegm(struct tm *tm)
 int av_parse_time(int64_t *timeval, const char *timestr, int duration)
 {
 const char *p, *q;
-int64_t t;
+int64_t t, now64;
 time_t now;
 struct tm dt = { 0 }, tmbuf;
 int today = 0, negative = 0, microseconds = 0;
@@ -576,10 +577,11 @@ int av_parse_time(int64_t *timeval, const char *timestr, 
int duration)
 q = NULL;
 *timeval = INT64_MIN;
 if (!duration) {
-now = time(0);
+now64 = av_gettime();
+now = now64 / 100;
 
 if (!av_strcasecmp(timestr, "now")) {
-*timeval = (int64_t) now * 100;
+*timeval = now64;
 return 0;
 }
 
@@ -870,7 +872,7 @@ int main(void)
 
 av_log_set_level(AV_LOG_DEBUG);
 putenv(tzstr);
-printf("(now is 2012-03-17 09:14:13 +0100, local time is UTC+1)\n");
+printf("(now is 2012-03-17 09:14:13.2 +0100, local time is UTC+1)\n");
 for (i = 0;  i < FF_ARRAY_ELEMS(time_string); i++) {
 printf("%-24s -> ", time_string[i]);
 if (av_parse_time(, time_string[i], 0)) {
diff --git a/tests/ref/fate/parseutils b/tests/ref/fate/parseutils
index 1482452..176140c 100644
--- a/tests/ref/fate/parseutils
+++ b/tests/ref/fate/parseutils
@@ -70,8 +70,8 @@ fmt:'%Y-%m-%d %H:%M:%S' spec:'2012-12-21 20:12:21' -> 
2012-12-21 20:12:21
 fmt:'  %Y - %m - %d %H : %M : %S' spec:'   2012 - 12 -  21   20 : 12 : 21' -> 
2012-12-21 20:12:21
 
 Testing av_parse_time()
-(now is 2012-03-17 09:14:13 +0100, local time is UTC+1)
-now  -> 1331972053.00 = 2012-03-17T08:14:13Z
+(now is 2012-03-17 09:14:13.2 +0100, local time is UTC+1)
+now  -> 1331972053.20 = 2012-03-17T08:14:13Z
 12:35:46 -> 1331984146.00 = 2012-03-17T11:35:46Z
 2000-12-20 0:02:47.5z->  977270567.50 = 2000-12-20T00:02:47Z
 2000-12-20T010247.6  ->  977270567.60 = 2000-12-20T00:02:47Z
-- 
2.6.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-06 Thread Michael Niedermayer
On Sat, Feb 06, 2016 at 08:13:12PM +0100, Marton Balint wrote:
> Use av_gettime() instead of time(0) for querying current time.
> 
> Signed-off-by: Marton Balint 
> ---
>  libavutil/parseutils.c| 12 +++-
>  tests/ref/fate/parseutils |  4 ++--
>  2 files changed, 9 insertions(+), 7 deletions(-)

after this (whole) patchset
./ffmpeg  -i lena.pnm -timestamp "2016-01-01 01:01:01" test.mp4
exiftool test.mp4
results in
Create Date : 1904:01:01 00:00:00
Modify Date : 1904:01:01 00:00:00

before it does:

Create Date : 2016:01:01 00:01:01
Modify Date : 2016:01:01 00:01:01

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-06 Thread Marton Balint


On Sun, 7 Feb 2016, Michael Niedermayer wrote:


On Sat, Feb 06, 2016 at 08:13:12PM +0100, Marton Balint wrote:

Use av_gettime() instead of time(0) for querying current time.

Signed-off-by: Marton Balint 
---
 libavutil/parseutils.c| 12 +++-
 tests/ref/fate/parseutils |  4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)


after this (whole) patchset
./ffmpeg  -i lena.pnm -timestamp "2016-01-01 01:01:01" test.mp4
exiftool test.mp4
results in
Create Date : 1904:01:01 00:00:00
Modify Date : 1904:01:01 00:00:00



Hmm, apparently I missed the fact iso 8601 time specs can have timezone 
specifiers as well, even if they were not parsed but silently ignored by 
the existing function.


I will rework the second patch to fix that.

Thanks,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel