aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-02-25 21:42:02 +0100
committerPaul B Mahol <onemda@gmail.com>2021-02-25 23:10:14 +0100
commit34c805c0fe5ce8ce2ab8530192e103e471c5f0fe (patch)
tree184b55d534edf16a5055eeba717e66c66c41ae1b /libavformat
parentab8d2d97a10ab9be0c708c4f963ff98757594975 (diff)
downloadffmpeg-34c805c0fe5ce8ce2ab8530192e103e471c5f0fe.tar.gz
avcodec/imx: use ff_reget_buffer()
Also flush internal stuff upon seeking. This codec is not intra only.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/imx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/imx.c b/libavformat/imx.c
index 1c7f5be0a4..c7778a91ab 100644
--- a/libavformat/imx.c
+++ b/libavformat/imx.c
@@ -31,6 +31,7 @@
typedef struct SimbiosisIMXDemuxContext {
uint8_t pal[AVPALETTE_SIZE];
int pal_changed;
+ int64_t first_video_packet_pos;
} SimbiosisIMXDemuxContext;
static int simbiosis_imx_probe(const AVProbeData *p)
@@ -107,6 +108,8 @@ retry:
break;
case 0xAA97:
idx = 0;
+ if (!imx->first_video_packet_pos)
+ imx->first_video_packet_pos = pos;
break;
case 0xAA98:
for (int i = 0; i < chunk_size / 3; i++) {
@@ -137,6 +140,9 @@ retry:
return AVERROR(ENOMEM);
memcpy(pal, imx->pal, AVPALETTE_SIZE);
imx->pal_changed = 0;
+ if (pos <= imx->first_video_packet_pos)
+ pkt->flags |= AV_PKT_FLAG_KEY;
+ } else if (idx == 1) {
pkt->flags |= AV_PKT_FLAG_KEY;
}