]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/thp.c
Merge commit '5b70fb8fee4af3b13f29a2dc7222fd3c9782f79b'
[ffmpeg] / libavformat / thp.c
index 727fb5095c09924a99a3224c782e9a643c3d937a..5569027dba22b40013948da3fefdedea1076a0ad 100644 (file)
@@ -135,6 +135,7 @@ static int thp_read_header(AVFormatContext *s)
             st->codec->codec_tag = 0;  /* no fourcc */
             st->codec->channels    = avio_rb32(pb); /* numChannels.  */
             st->codec->sample_rate = avio_rb32(pb); /* Frequency.  */
+            st->duration           = avio_rb32(pb);
 
             avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
 
@@ -179,7 +180,7 @@ static int thp_read_packet(AVFormatContext *s,
         if (ret < 0)
             return ret;
         if (ret != size) {
-            av_free_packet(pkt);
+            av_packet_unref(pkt);
             return AVERROR(EIO);
         }
 
@@ -189,7 +190,7 @@ static int thp_read_packet(AVFormatContext *s,
         if (ret < 0)
             return ret;
         if (ret != thp->audiosize) {
-            av_free_packet(pkt);
+            av_packet_unref(pkt);
             return AVERROR(EIO);
         }