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`.
This commit is contained in:
Luca Barbato
2015-10-23 11:11:31 +02:00
parent a5d4204309
commit ce70f28a17
80 changed files with 174 additions and 158 deletions

View File

@@ -206,7 +206,7 @@ static void audio_encode_example(const char *filename)
}
if (got_output) {
fwrite(pkt.data, 1, pkt.size, f);
av_free_packet(&pkt);
av_packet_unref(&pkt);
}
}
fclose(f);
@@ -403,7 +403,7 @@ static void video_encode_example(const char *filename)
if (got_output) {
printf("encoding frame %3d (size=%5d)\n", i, pkt.size);
fwrite(pkt.data, 1, pkt.size, f);
av_free_packet(&pkt);
av_packet_unref(&pkt);
}
}
@@ -420,7 +420,7 @@ static void video_encode_example(const char *filename)
if (got_output) {
printf("encoding frame %3d (size=%5d)\n", i, pkt.size);
fwrite(pkt.data, 1, pkt.size, f);
av_free_packet(&pkt);
av_packet_unref(&pkt);
}
}