Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
[ffmpeg.git] / libavdevice / alsa_dec.c
index b8e957a..71a6ef4 100644 (file)
@@ -111,14 +111,14 @@ static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
 
     while ((res = snd_pcm_readi(s->h, pkt->data, s->period_size)) < 0) {
         if (res == -EAGAIN) {
-            av_free_packet(pkt);
+            av_packet_unref(pkt);
 
             return AVERROR(EAGAIN);
         }
         if (ff_alsa_xrun_recover(s1, res) < 0) {
             av_log(s1, AV_LOG_ERROR, "ALSA read error: %s\n",
                    snd_strerror(res));
-            av_free_packet(pkt);
+            av_packet_unref(pkt);
 
             return AVERROR(EIO);
         }