mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-13 21:26:33 +02:00
avformat/mov: split off MOVStreamContext freeing into its own function
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
78a7927df7
commit
0042cf8980
@ -8587,22 +8587,17 @@ static void mov_free_encryption_index(MOVEncryptionIndex **index) {
|
|||||||
av_freep(index);
|
av_freep(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mov_read_close(AVFormatContext *s)
|
static void mov_free_stream_context(AVFormatContext *s, AVStream *st)
|
||||||
{
|
{
|
||||||
MOVContext *mov = s->priv_data;
|
|
||||||
int i, j;
|
|
||||||
|
|
||||||
for (i = 0; i < s->nb_streams; i++) {
|
|
||||||
AVStream *st = s->streams[i];
|
|
||||||
MOVStreamContext *sc = st->priv_data;
|
MOVStreamContext *sc = st->priv_data;
|
||||||
|
|
||||||
if (!sc)
|
if (!sc)
|
||||||
continue;
|
return;
|
||||||
|
|
||||||
av_freep(&sc->ctts_data);
|
av_freep(&sc->ctts_data);
|
||||||
for (j = 0; j < sc->drefs_count; j++) {
|
for (int i = 0; i < sc->drefs_count; i++) {
|
||||||
av_freep(&sc->drefs[j].path);
|
av_freep(&sc->drefs[i].path);
|
||||||
av_freep(&sc->drefs[j].dir);
|
av_freep(&sc->drefs[i].dir);
|
||||||
}
|
}
|
||||||
av_freep(&sc->drefs);
|
av_freep(&sc->drefs);
|
||||||
|
|
||||||
@ -8629,8 +8624,8 @@ static int mov_read_close(AVFormatContext *s)
|
|||||||
av_freep(&sc->index_ranges);
|
av_freep(&sc->index_ranges);
|
||||||
|
|
||||||
if (sc->extradata)
|
if (sc->extradata)
|
||||||
for (j = 0; j < sc->stsd_count; j++)
|
for (int i = 0; i < sc->stsd_count; i++)
|
||||||
av_free(sc->extradata[j]);
|
av_free(sc->extradata[i]);
|
||||||
av_freep(&sc->extradata);
|
av_freep(&sc->extradata);
|
||||||
av_freep(&sc->extradata_size);
|
av_freep(&sc->extradata_size);
|
||||||
|
|
||||||
@ -8644,6 +8639,17 @@ static int mov_read_close(AVFormatContext *s)
|
|||||||
av_freep(&sc->coll);
|
av_freep(&sc->coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mov_read_close(AVFormatContext *s)
|
||||||
|
{
|
||||||
|
MOVContext *mov = s->priv_data;
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
for (i = 0; i < s->nb_streams; i++) {
|
||||||
|
AVStream *st = s->streams[i];
|
||||||
|
|
||||||
|
mov_free_stream_context(s, st);
|
||||||
|
}
|
||||||
|
|
||||||
av_freep(&mov->dv_demux);
|
av_freep(&mov->dv_demux);
|
||||||
avformat_free_context(mov->dv_fctx);
|
avformat_free_context(mov->dv_fctx);
|
||||||
mov->dv_fctx = NULL;
|
mov->dv_fctx = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user