mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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++;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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...
|
||||
@ -2690,13 +2707,7 @@ matroska_read_close (AVFormatContext *s)
|
||||
av_free(matroska->muxing_app);
|
||||
av_free(matroska->index);
|
||||
|
||||
if (matroska->packets != NULL) {
|
||||
for (n = 0; n < matroska->num_packets; n++) {
|
||||
av_free_packet(matroska->packets[n]);
|
||||
av_free(matroska->packets[n]);
|
||||
}
|
||||
av_free(matroska->packets);
|
||||
}
|
||||
matroska_clear_queue(matroska);
|
||||
|
||||
for (n = 0; n < matroska->num_tracks; n++) {
|
||||
MatroskaTrack *track = matroska->tracks[n];
|
||||
|
Loading…
Reference in New Issue
Block a user