1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/crypto.c: remove unnecessary code

Because the newpos variable is set value before use it.
The newpos variable declared at the head partition of crypto_seek.
Make the code clean.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2020-07-14 14:18:25 +08:00
parent c4b6ee55c0
commit 2c1cc326e9

View File

@ -252,21 +252,17 @@ static int64_t crypto_seek(URLContext *h, int64_t pos, int whence)
case SEEK_CUR: case SEEK_CUR:
pos = pos + c->position; pos = pos + c->position;
break; break;
case SEEK_END: { case SEEK_END:
int64_t newpos = ffurl_seek( c->hd, pos, AVSEEK_SIZE ); newpos = ffurl_seek( c->hd, pos, AVSEEK_SIZE );
if (newpos < 0) { if (newpos < 0) {
av_log(h, AV_LOG_ERROR, av_log(h, AV_LOG_ERROR,
"Crypto: seek_end - can't get file size (pos=%lld)\r\n", (long long int)pos); "Crypto: seek_end - can't get file size (pos=%lld)\r\n", (long long int)pos);
return newpos; return newpos;
} }
pos = newpos - pos; pos = newpos - pos;
}
break;
case AVSEEK_SIZE: {
int64_t newpos = ffurl_seek( c->hd, pos, AVSEEK_SIZE );
return newpos;
}
break; break;
case AVSEEK_SIZE:
return ffurl_seek( c->hd, pos, AVSEEK_SIZE );
default: default:
av_log(h, AV_LOG_ERROR, av_log(h, AV_LOG_ERROR,
"Crypto: no support for seek where 'whence' is %d\r\n", whence); "Crypto: no support for seek where 'whence' is %d\r\n", whence);