return 0;
return ret;
int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,                    int size){    AVStream *st;    INT64 pts_mask;    int ret;    st = s->streams[stream_index];    pts_mask = (1LL << s->pts_wrap_bits) - 1;    ret = s->oformat->write_packet(s, stream_index, (uint8_t *)buf, size,                                    st->pts.val & pts_mask);    if (ret < 0)        return ret;    /* update pts */    switch (st->codec.codec_type) {    case CODEC_TYPE_AUDIO:        av_frac_add(&st->pts,                     (INT64)s->pts_den * st->codec.frame_size);        break;    case CODEC_TYPE_VIDEO:        av_frac_add(&st->pts,                     (INT64)s->pts_den * FRAME_RATE_BASE);        break;    default:        break;    }    return 0;}