int avformat_queue_attached_pictures(AVFormatContext *s)

{

    int i;

    for (i = 0; i < s->nb_streams; i++)

        if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&

            s->streams[i]->discard < AVDISCARD_ALL) {

            AVPacket copy = s->streams[i]->attached_pic;

            if (copy.size <= 0)

                return AVERROR(EINVAL);

            copy.buf = av_buffer_ref(copy.buf);

            if (!copy.buf)

                return AVERROR(ENOMEM);



            add_to_pktbuf(&s->raw_packet_buffer, &copy,

                          &s->raw_packet_buffer_end);

        }

    return 0;

}

int avformat_queue_attached_pictures(AVFormatContext *s)

{

    int i;

    for (i = 0; i < s->nb_streams; i++)

        if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&

            s->streams[i]->discard < AVDISCARD_ALL) {

            AVPacket copy = s->streams[i]->attached_pic;

            if (copy.size <= 0)

                return AVERROR(EINVAL);

            copy.buf = av_buffer_ref(copy.buf);

            if (!copy.buf)

                return AVERROR(ENOMEM);



            add_to_pktbuf(&s->raw_packet_buffer, &copy,

                          &s->raw_packet_buffer_end);

        }

    return 0;

}

int FUNC_0(AVFormatContext *VAR_0)

{

    int VAR_1;

    for (VAR_1 = 0; VAR_1 < VAR_0->nb_streams; VAR_1++)

        if (VAR_0->streams[VAR_1]->disposition & AV_DISPOSITION_ATTACHED_PIC &&

            VAR_0->streams[VAR_1]->discard < AVDISCARD_ALL) {

            AVPacket copy = VAR_0->streams[VAR_1]->attached_pic;

            if (copy.size <= 0)

                return AVERROR(EINVAL);

            copy.buf = av_buffer_ref(copy.buf);

            if (!copy.buf)

                return AVERROR(ENOMEM);



            add_to_pktbuf(&VAR_0->raw_packet_buffer, &copy,

                          &VAR_0->raw_packet_buffer_end);

        }

    return 0;

}

int FUNC_0(AVFormatContext *VAR_0)
{ int VAR_1; for (VAR_1 = 0; VAR_1 < VAR_0->nb_streams; VAR_1++) if (VAR_0->streams[VAR_1]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
VAR_0->streams[VAR_1]->discard < AVDISCARD_ALL) { AVPacket copy = VAR_0->streams[VAR_1]->attached_pic; if (copy.size <= 0)
return AVERROR(EINVAL); copy.buf = av_buffer_ref(copy.buf); if (!copy.buf)
return AVERROR(ENOMEM); add_to_pktbuf(&VAR_0->raw_packet_buffer, &copy,
&VAR_0->raw_packet_buffer_end); } return 0; }