X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fapetag.c;h=6f82fbe20262a8b24912018fcbbf63e7f10698bd;hb=337f777f378cfcc0d6f0d01fb7125905e8b0da55;hp=454c6c688bd2b0c7fde6eead30cd7799d1705a0c;hpb=c1e439d7e9abab3cebdc937636393b1656e095d9;p=ffmpeg diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 454c6c688bd..6f82fbe2026 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -79,22 +79,12 @@ static int ape_tag_read_field(AVFormatContext *s) av_dict_set(&st->metadata, key, filename, 0); if ((id = ff_guess_image2_codec(filename)) != AV_CODEC_ID_NONE) { - AVPacket pkt; - int ret; - - ret = av_get_packet(s->pb, &pkt, size); + int ret = ff_add_attached_pic(s, st, s->pb, NULL, size); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Error reading cover art.\n"); return ret; } - - st->disposition |= AV_DISPOSITION_ATTACHED_PIC; - st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; st->codecpar->codec_id = id; - - st->attached_pic = pkt; - st->attached_pic.stream_index = st->index; - st->attached_pic.flags |= AV_PKT_FLAG_KEY; } else { if ((ret = ff_get_extradata(s, st->codecpar, s->pb, size)) < 0) return ret;