mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
avformat/jacosubdec: Factorize code in get_shift() a bit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6490b9aed63c06f20bbc46e0bc801e612d07e81e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
30b3f2712d
commit
d35579c12b
@ -143,16 +143,12 @@ static int get_shift(int timeres, const char *buf)
|
||||
|
||||
ret = 0;
|
||||
switch (n) {
|
||||
case 4:
|
||||
ret = sign * (((int64_t)a*3600 + (int64_t)b*60 + c) * timeres + d);
|
||||
break;
|
||||
case 3:
|
||||
ret = sign * (( (int64_t)a*60 + b) * timeres + c);
|
||||
break;
|
||||
case 2:
|
||||
ret = sign * (( (int64_t)a) * timeres + b);
|
||||
break;
|
||||
case 1: a = 0;
|
||||
case 2: c = b; b = a; a = 0;
|
||||
case 3: d = c; c = b; b = a; a = 0;
|
||||
}
|
||||
|
||||
ret = sign * (((int64_t)a*3600 + (int64_t)b*60 + c) * timeres + d);
|
||||
if ((int)ret != ret)
|
||||
ret = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user