[FFmpeg-devel] avformat/utils: refine av_get_frame_filename2 function

Submitted by Steven Liu on Aug. 28, 2017, 12:03 p.m.

Details

Message ID 20170828120336.23684-1-lq@chinaffmpeg.org
State New
Headers show

Commit Message

Steven Liu Aug. 28, 2017, 12:03 p.m.
support parse the l for the %lld or %ld

Signed-off-by: Steven Liu <lq@onvideo.cn>
---
 libavformat/utils.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Michael Niedermayer Aug. 31, 2017, 12:29 a.m.
On Mon, Aug 28, 2017 at 08:03:36PM +0800, Steven Liu wrote:
> support parse the l for the %lld or %ld
> 
> Signed-off-by: Steven Liu <lq@onvideo.cn>
> ---
>  libavformat/utils.c | 4 ++++
>  1 file changed, 4 insertions(+)

LGTM

please add a fate test for this.

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 23865c88c4..c76a6cc5f8 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4570,6 +4570,7 @@  int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number
         if (c == '\0')
             break;
         if (c == '%') {
+ignoredl:
             do {
                 nd = 0;
                 while (av_isdigit(*p))
@@ -4593,6 +4594,9 @@  int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number
                 memcpy(q, buf1, len);
                 q += len;
                 break;
+            case 'l':
+                goto ignoredl;
+
             default:
                 goto fail;
             }