mirror of https://git.ffmpeg.org/ffmpeg.git
move internal queue freeing code in its own function
Originally committed as revision 11350 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
b3d8c2c436
commit
34c9c1baf4
|
@ -846,6 +846,23 @@ matroska_queue_packet (MatroskaDemuxContext *matroska,
|
||||||
matroska->num_packets++;
|
matroska->num_packets++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Free all packets in our internal queue.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
matroska_clear_queue (MatroskaDemuxContext *matroska)
|
||||||
|
{
|
||||||
|
if (matroska->packets) {
|
||||||
|
int n;
|
||||||
|
for (n = 0; n < matroska->num_packets; n++) {
|
||||||
|
av_free_packet(matroska->packets[n]);
|
||||||
|
av_free(matroska->packets[n]);
|
||||||
|
}
|
||||||
|
av_free(matroska->packets);
|
||||||
|
matroska->packets = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Autodetecting...
|
* Autodetecting...
|
||||||
|
@ -2690,13 +2707,7 @@ matroska_read_close (AVFormatContext *s)
|
||||||
av_free(matroska->muxing_app);
|
av_free(matroska->muxing_app);
|
||||||
av_free(matroska->index);
|
av_free(matroska->index);
|
||||||
|
|
||||||
if (matroska->packets != NULL) {
|
matroska_clear_queue(matroska);
|
||||||
for (n = 0; n < matroska->num_packets; n++) {
|
|
||||||
av_free_packet(matroska->packets[n]);
|
|
||||||
av_free(matroska->packets[n]);
|
|
||||||
}
|
|
||||||
av_free(matroska->packets);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (n = 0; n < matroska->num_tracks; n++) {
|
for (n = 0; n < matroska->num_tracks; n++) {
|
||||||
MatroskaTrack *track = matroska->tracks[n];
|
MatroskaTrack *track = matroska->tracks[n];
|
||||||
|
|
Loading…
Reference in New Issue