X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fthp.c;h=5569027dba22b40013948da3fefdedea1076a0ad;hb=d3d4bc4784d911236b232e56e4ae476c484381c8;hp=727fb5095c09924a99a3224c782e9a643c3d937a;hpb=1dd5f3340e002bf923fbfd4774afe3fafc6ad713;p=ffmpeg diff --git a/libavformat/thp.c b/libavformat/thp.c index 727fb5095c0..5569027dba2 100644 --- a/libavformat/thp.c +++ b/libavformat/thp.c @@ -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); }