Originally committed as revision 18431 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -2630,7 +2630,10 @@ typedef struct AVSubtitle {
|
| 2630 | 2630 |
|
| 2631 | 2631 |
/* packet functions */ |
| 2632 | 2632 |
|
| 2633 |
-void av_destruct_packet_nofree(AVPacket *pkt); |
|
| 2633 |
+/** |
|
| 2634 |
+ * @deprecated use NULL instead |
|
| 2635 |
+ */ |
|
| 2636 |
+attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt); |
|
| 2634 | 2637 |
|
| 2635 | 2638 |
/** |
| 2636 | 2639 |
* Default packet destructor. |
| ... | ... |
@@ -2675,8 +2678,9 @@ int av_dup_packet(AVPacket *pkt); |
| 2675 | 2675 |
*/ |
| 2676 | 2676 |
static inline void av_free_packet(AVPacket *pkt) |
| 2677 | 2677 |
{
|
| 2678 |
- if (pkt && pkt->destruct) {
|
|
| 2679 |
- pkt->destruct(pkt); |
|
| 2678 |
+ if (pkt) {
|
|
| 2679 |
+ if (pkt->destruct) pkt->destruct(pkt); |
|
| 2680 |
+ pkt->data = NULL; pkt->size = 0; |
|
| 2680 | 2681 |
} |
| 2681 | 2682 |
} |
| 2682 | 2683 |
|
| ... | ... |
@@ -923,7 +923,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) |
| 923 | 923 |
pkt->pts = st->parser->pts; |
| 924 | 924 |
pkt->dts = st->parser->dts; |
| 925 | 925 |
pkt->pos = st->parser->pos; |
| 926 |
- pkt->destruct = av_destruct_packet_nofree; |
|
| 926 |
+ pkt->destruct = NULL; |
|
| 927 | 927 |
compute_pkt_fields(s, st, st->parser, pkt); |
| 928 | 928 |
|
| 929 | 929 |
if((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & PKT_FLAG_KEY){
|