ff-load,ff-save: use av_packet_unref instead of av_free_packet

parent 2963c2aa
......@@ -217,7 +217,7 @@ decode_audio (GeglOperation *operation,
if (av_read_frame (p->audio_fcontext, &pkt) < 0)
{
av_free_packet (&pkt);
av_packet_unref (&pkt);
return -1;
}
if (pkt.stream_index==p->audio_index && p->audio_stream)
......@@ -296,7 +296,7 @@ decode_audio (GeglOperation *operation,
p->prevapts = pkt.pts * av_q2d (p->audio_stream->time_base);
}
}
av_free_packet (&pkt);
av_packet_unref (&pkt);
}
return 0;
}
......@@ -348,10 +348,10 @@ decode_frame (GeglOperation *operation,
do
{
av_free_packet (&pkt);
av_packet_unref (&pkt);
if (av_read_frame (p->video_fcontext, &pkt) < 0)
{
av_free_packet (&pkt);
av_packet_unref (&pkt);
return -1;
}
}
......@@ -388,7 +388,7 @@ AV_TIME_BASE_Q) * 1.0 / AV_TIME_BASE ;
if (decoded_bytes != pkt.size)
fprintf (stderr, "bytes left!\n");
#endif
av_free_packet (&pkt);
av_packet_unref (&pkt);
}
while (!got_picture);
}
......
......@@ -517,7 +517,7 @@ write_audio_frame (GeglProperties *o, AVFormatContext * oc, AVStream * st)
{
pkt.stream_index = st->index;
av_interleaved_write_frame (oc, &pkt);
av_free_packet (&pkt);
av_packet_unref (&pkt);
}
av_frame_free (&frame);
......@@ -997,7 +997,7 @@ static void flush_audio (GeglProperties *o)
pkt.stream_index = p->audio_st->index;
av_packet_rescale_ts (&pkt, p->audio_st->codec->time_base, p->audio_st->time_base);
av_interleaved_write_frame (p->oc, &pkt);
av_free_packet (&pkt);
av_packet_unref (&pkt);
}
} while (got_packet);
}
......@@ -1023,7 +1023,7 @@ static void flush_video (GeglProperties *o)
pkt.dts = ts++;
av_packet_rescale_ts (&pkt, p->video_st->codec->time_base, p->video_st->time_base);
av_interleaved_write_frame (p->oc, &pkt);
av_free_packet (&pkt);
av_packet_unref (&pkt);
}
} while (got_packet);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment