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

parent 2963c2aa
...@@ -217,7 +217,7 @@ decode_audio (GeglOperation *operation, ...@@ -217,7 +217,7 @@ decode_audio (GeglOperation *operation,
if (av_read_frame (p->audio_fcontext, &pkt) < 0) if (av_read_frame (p->audio_fcontext, &pkt) < 0)
{ {
av_free_packet (&pkt); av_packet_unref (&pkt);
return -1; return -1;
} }
if (pkt.stream_index==p->audio_index && p->audio_stream) if (pkt.stream_index==p->audio_index && p->audio_stream)
...@@ -296,7 +296,7 @@ decode_audio (GeglOperation *operation, ...@@ -296,7 +296,7 @@ decode_audio (GeglOperation *operation,
p->prevapts = pkt.pts * av_q2d (p->audio_stream->time_base); p->prevapts = pkt.pts * av_q2d (p->audio_stream->time_base);
} }
} }
av_free_packet (&pkt); av_packet_unref (&pkt);
} }
return 0; return 0;
} }
...@@ -348,10 +348,10 @@ decode_frame (GeglOperation *operation, ...@@ -348,10 +348,10 @@ decode_frame (GeglOperation *operation,
do do
{ {
av_free_packet (&pkt); av_packet_unref (&pkt);
if (av_read_frame (p->video_fcontext, &pkt) < 0) if (av_read_frame (p->video_fcontext, &pkt) < 0)
{ {
av_free_packet (&pkt); av_packet_unref (&pkt);
return -1; return -1;
} }
} }
...@@ -388,7 +388,7 @@ AV_TIME_BASE_Q) * 1.0 / AV_TIME_BASE ; ...@@ -388,7 +388,7 @@ AV_TIME_BASE_Q) * 1.0 / AV_TIME_BASE ;
if (decoded_bytes != pkt.size) if (decoded_bytes != pkt.size)
fprintf (stderr, "bytes left!\n"); fprintf (stderr, "bytes left!\n");
#endif #endif
av_free_packet (&pkt); av_packet_unref (&pkt);
} }
while (!got_picture); while (!got_picture);
} }
......
...@@ -517,7 +517,7 @@ write_audio_frame (GeglProperties *o, AVFormatContext * oc, AVStream * st) ...@@ -517,7 +517,7 @@ write_audio_frame (GeglProperties *o, AVFormatContext * oc, AVStream * st)
{ {
pkt.stream_index = st->index; pkt.stream_index = st->index;
av_interleaved_write_frame (oc, &pkt); av_interleaved_write_frame (oc, &pkt);
av_free_packet (&pkt); av_packet_unref (&pkt);
} }
av_frame_free (&frame); av_frame_free (&frame);
...@@ -997,7 +997,7 @@ static void flush_audio (GeglProperties *o) ...@@ -997,7 +997,7 @@ static void flush_audio (GeglProperties *o)
pkt.stream_index = p->audio_st->index; pkt.stream_index = p->audio_st->index;
av_packet_rescale_ts (&pkt, p->audio_st->codec->time_base, p->audio_st->time_base); av_packet_rescale_ts (&pkt, p->audio_st->codec->time_base, p->audio_st->time_base);
av_interleaved_write_frame (p->oc, &pkt); av_interleaved_write_frame (p->oc, &pkt);
av_free_packet (&pkt); av_packet_unref (&pkt);
} }
} while (got_packet); } while (got_packet);
} }
...@@ -1023,7 +1023,7 @@ static void flush_video (GeglProperties *o) ...@@ -1023,7 +1023,7 @@ static void flush_video (GeglProperties *o)
pkt.dts = ts++; pkt.dts = ts++;
av_packet_rescale_ts (&pkt, p->video_st->codec->time_base, p->video_st->time_base); av_packet_rescale_ts (&pkt, p->video_st->codec->time_base, p->video_st->time_base);
av_interleaved_write_frame (p->oc, &pkt); av_interleaved_write_frame (p->oc, &pkt);
av_free_packet (&pkt); av_packet_unref (&pkt);
} }
} while (got_packet); } 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