Opened 6 years ago

Closed 5 years ago

#992 closed enhancement (fixed)

avoid strptime() dependancy, it seems unavailable on windows

Reported by: MattE Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: strptime
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Because strptime isn't available natively for windows one cannot set the creation time of a file in ffmpeg (see the HAVE_STRPTIME flag in libavformat\utils.c line 4091).

I want to request that it be added for windows as well. There's a GPL implementation of strptime here http://plibc.sourceforge.net/doxygen/strptime_8c-source.html which adds Windows support for strptime. It'd be great if that could be added to ffmpeg.

Change History (5)

comment:1 follow-up: Changed 6 years ago by cehoyos

GPL is not good in a function used in libavformat/utils.c...

comment:2 in reply to: ↑ 1 Changed 6 years ago by MattE

Replying to cehoyos:

GPL is not good in a function used in libavformat/utils.c...

True, but it's better than nothing? It could be placed under a GPL guard so if you compile as gpl it's available, otherwise it's not, like at present.

The original is actually available as LGPL (http://sourceware.org/git/?p=glibc.git;a=blob_plain;f=time/strptime_l.c;hb=HEAD).

comment:3 Changed 6 years ago by cehoyos

Perhaps you should make your request (with above link) to the mingw developers?

comment:4 Changed 5 years ago by michael

  • Summary changed from strptime on windows to avoid strptime() dependancy, it seems unavailable on windows

comment:5 in reply to: ↑ description Changed 5 years ago by saste

  • Analyzed by developer set
  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from new to closed

Replying to MattE:

Because strptime isn't available natively for windows one cannot set the creation time of a file in ffmpeg (see the HAVE_STRPTIME flag in libavformat\utils.c line 4091).

I want to request that it be added for windows as well. There's a GPL implementation of strptime here http://plibc.sourceforge.net/doxygen/strptime_8c-source.html which adds Windows support for strptime. It'd be great if that could be added to ffmpeg.

Should be fixed in:

commit 29e972f67c914d35417bc7368493d2617abdd26e
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Sat Sep 1 13:32:43 2012 +0200

    lavu/parseutils: add av_small_strptime()
    
    Make internal small_strptime() function public, and use it in place of
    strptime().
    This allows to avoid a dependency on strptime() on systems which do not
    support it.
    
    In particular, fix trac ticket #992.
Note: See TracTickets for help on using tickets.