]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/ilbc.c
thp: set duration for audio stream too
[ffmpeg] / libavformat / ilbc.c
index c01eb6f7962ef998f1a533bfcf6461573ba87659..5ed8899a9e0590f88e07131f55305d3ab6138cde 100644 (file)
@@ -56,7 +56,6 @@ static int ilbc_write_header(AVFormatContext *s)
 static int ilbc_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     avio_write(s->pb, pkt->data, pkt->size);
-    avio_flush(s->pb);
     return 0;
 }
 
@@ -113,7 +112,7 @@ static int ilbc_read_packet(AVFormatContext *s,
     pkt->pos = avio_tell(s->pb);
     pkt->duration = enc->block_align == 38 ? 160 : 240;
     if ((ret = avio_read(s->pb, pkt->data, enc->block_align)) != enc->block_align) {
-        av_free_packet(pkt);
+        av_packet_unref(pkt);
         return ret < 0 ? ret : AVERROR(EIO);
     }