avformat/img2dec: remove the non-negative number requirement for start_number option

industrial cameras usually mark the trigger frame as frame number 0
all frames saved before trigger frame receive a negative sequence number

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Liviu Oniciuc
2015-02-03 09:01:29 -08:00
committed by Michael Niedermayer
parent 6a0cd529a3
commit b37858eae1
2 changed files with 3 additions and 1 deletions

2
libavformat/utils.c Normal file → Executable file
View File

@@ -3827,6 +3827,8 @@ int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
if (percentd_found)
goto fail;
percentd_found = 1;
if(number < 0)
nd += 1;
snprintf(buf1, sizeof(buf1), "%0*d", nd, number);
len = strlen(buf1);
if ((q - buf + len) > buf_size - 1)