mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-04 09:44:28 +00:00
Merge commit '4f03a77e52596cbe9ec179666ddb3e0345a8133a'
* commit '4f03a77e52596cbe9ec179666ddb3e0345a8133a': oma: refactor seek function Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
bc672a016f
@ -449,24 +449,26 @@ static int oma_read_seek(struct AVFormatContext *s,
|
|||||||
int stream_index, int64_t timestamp, int flags)
|
int stream_index, int64_t timestamp, int flags)
|
||||||
{
|
{
|
||||||
OMAContext *oc = s->priv_data;
|
OMAContext *oc = s->priv_data;
|
||||||
|
int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);
|
||||||
|
|
||||||
ff_pcm_read_seek(s, stream_index, timestamp, flags);
|
if (!oc->encrypted)
|
||||||
|
return err;
|
||||||
|
|
||||||
if (oc->encrypted) {
|
/* readjust IV for CBC */
|
||||||
/* readjust IV for CBC */
|
if (err || avio_tell(s->pb) < oc->content_start)
|
||||||
int64_t pos = avio_tell(s->pb);
|
goto wipe;
|
||||||
if (pos < oc->content_start)
|
if ((err = avio_seek(s->pb, -8, SEEK_CUR)) < 0)
|
||||||
memset(oc->iv, 0, 8);
|
goto wipe;
|
||||||
else {
|
if ((err = avio_read(s->pb, oc->iv, 8)) < 8) {
|
||||||
if (avio_seek(s->pb, -8, SEEK_CUR) < 0 ||
|
if (err >= 0)
|
||||||
avio_read(s->pb, oc->iv, 8) < 8) {
|
err = AVERROR_EOF;
|
||||||
memset(oc->iv, 0, 8);
|
goto wipe;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
wipe:
|
||||||
|
memset(oc->iv, 0, 8);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVInputFormat ff_oma_demuxer = {
|
AVInputFormat ff_oma_demuxer = {
|
||||||
|
Loading…
Reference in New Issue
Block a user