avformat/jacosubdec: Factorize code in get_shift() a bit

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-09-30 19:34:29 +02:00
parent 9132a0fbe2
commit 6490b9aed6
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 5 additions and 9 deletions

View File

@ -143,16 +143,12 @@ static int get_shift(int timeres, const char *buf)
ret = 0; ret = 0;
switch (n) { switch (n) {
case 4: case 1: a = 0;
ret = sign * (((int64_t)a*3600 + (int64_t)b*60 + c) * timeres + d); case 2: c = b; b = a; a = 0;
break; case 3: d = c; c = b; b = a; a = 0;
case 3:
ret = sign * (( (int64_t)a*60 + b) * timeres + c);
break;
case 2:
ret = sign * (( (int64_t)a) * timeres + b);
break;
} }
ret = sign * (((int64_t)a*3600 + (int64_t)b*60 + c) * timeres + d);
if ((int)ret != ret) if ((int)ret != ret)
ret = 0; ret = 0;