diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2015-10-23 12:11:31 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-10-26 20:00:55 +0300 |
commit | ce70f28a1732c74a9cd7fec2d56178750bd6e457 (patch) | |
tree | 4e23c0b8181685ce4901250c8ee8468955bc362a /avconv.c | |
parent | a5d42043093a39636a1f4021a37dd9c612479f6f (diff) |
avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.
Deprecate `av_free_packet`.
Diffstat (limited to 'avconv.c')
-rw-r--r-- | avconv.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -270,7 +270,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) */ if (!(avctx->codec_type == AVMEDIA_TYPE_VIDEO && avctx->codec)) { if (ost->frame_number >= ost->max_frames) { - av_free_packet(pkt); + av_packet_unref(pkt); return; } ost->frame_number++; @@ -288,7 +288,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) pkt->data, pkt->size, pkt->flags & AV_PKT_FLAG_KEY); if (a > 0) { - av_free_packet(pkt); + av_packet_unref(pkt); new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size, av_buffer_default_free, NULL, 0); if (!new_pkt.buf) @@ -2158,7 +2158,7 @@ static void free_input_threads(void) pthread_mutex_lock(&f->fifo_lock); while (av_fifo_size(f->fifo)) { av_fifo_generic_read(f->fifo, &pkt, sizeof(pkt), NULL); - av_free_packet(&pkt); + av_packet_unref(&pkt); } pthread_cond_signal(&f->fifo_cond); pthread_mutex_unlock(&f->fifo_lock); @@ -2168,7 +2168,7 @@ static void free_input_threads(void) while (av_fifo_size(f->fifo)) { av_fifo_generic_read(f->fifo, &pkt, sizeof(pkt), NULL); - av_free_packet(&pkt); + av_packet_unref(&pkt); } av_fifo_free(f->fifo); } @@ -2483,7 +2483,7 @@ static int process_input(void) process_input_packet(ist, &pkt, 0); discard_packet: - av_free_packet(&pkt); + av_packet_unref(&pkt); return 0; } |