!339 fix dirty data makes read err

Merge pull request !339 from 孙钰杰1/master
This commit is contained in:
openharmony_ci 2024-11-22 11:26:01 +00:00 committed by Gitee
commit 4393abf9b1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -3549,6 +3549,9 @@ static int mpegts_resync(AVFormatContext *s, int seekback, const uint8_t *curren
if (avio_feof(pb)) if (avio_feof(pb))
return AVERROR_EOF; return AVERROR_EOF;
if (c == 0x47) { if (c == 0x47) {
#ifdef OHOS_OPT_COMPAT
avio_seek(pb, -1, SEEK_CUR);
#else
int new_packet_size, ret; int new_packet_size, ret;
avio_seek(pb, -1, SEEK_CUR); avio_seek(pb, -1, SEEK_CUR);
pos = avio_tell(pb); pos = avio_tell(pb);
@ -3561,6 +3564,7 @@ static int mpegts_resync(AVFormatContext *s, int seekback, const uint8_t *curren
ts->raw_packet_size = new_packet_size; ts->raw_packet_size = new_packet_size;
} }
avio_seek(pb, pos, SEEK_SET); avio_seek(pb, pos, SEEK_SET);
#endif
return 0; return 0;
} }
} }