X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmpeg.c;h=fb1d54e52f70bf1bc20d3104023fbe2329237d32;hb=f4df5039a791a56de85c64e6b9e4448a221b5c40;hp=33c039806065df08e671db0f27911704a1f75538;hpb=a39536caee6607f481e9075bfb11937f46a47489;p=ffmpeg diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 33c03980606..fb1d54e52f7 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -99,7 +99,7 @@ static int mpegps_probe(const AVProbeData *p) if (sys > invalid && sys * 9 <= pspack * 10) return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2 - : AVPROBE_SCORE_EXTENSION / 2 + 1; // 1 more than mp3 + : AVPROBE_SCORE_EXTENSION / 2 + (audio + vid + pspack > 1); // 1 more than mp3 if (pspack > invalid && (priv1 + vid + audio) * 10 >= pspack * 9) return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg @@ -147,9 +147,12 @@ static int mpegps_read_header(AVFormatContext *s) static int64_t get_pts(AVIOContext *pb, int c) { uint8_t buf[5]; + int ret; buf[0] = c < 0 ? avio_r8(pb) : c; - avio_read(pb, buf + 1, 4); + ret = avio_read(pb, buf + 1, 4); + if (ret < 4) + return AV_NOPTS_VALUE; return ff_parse_pes_pts(buf); } @@ -619,7 +622,7 @@ skip: st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; st->codecpar->sample_rate = 8000; } - st->request_probe = request_probe; + st->internal->request_probe = request_probe; st->need_parsing = AVSTREAM_PARSE_FULL; found: @@ -678,7 +681,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index, return dts; } -AVInputFormat ff_mpegps_demuxer = { +const AVInputFormat ff_mpegps_demuxer = { .name = "mpeg", .long_name = NULL_IF_CONFIG_SMALL("MPEG-PS (MPEG-2 Program Stream)"), .priv_data_size = sizeof(MpegDemuxContext), @@ -729,6 +732,7 @@ static int vobsub_read_header(AVFormatContext *s) { int i, ret = 0, header_parsed = 0, langidx = 0; VobSubDemuxContext *vobsub = s->priv_data; + const AVInputFormat *iformat; size_t fname_len; AVBPrint header; int64_t delay = 0; @@ -736,7 +740,6 @@ static int vobsub_read_header(AVFormatContext *s) int stream_id = -1; char id[64] = {0}; char alt[MAX_LINE_SIZE] = {0}; - ff_const59 AVInputFormat *iformat; if (!vobsub->sub_name) { char *ext; @@ -931,7 +934,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt) if (tmpq->current_sub_idx >= tmpq->nb_subs) continue; - ts = tmpq->subs[tmpq->current_sub_idx].pts; + ts = tmpq->subs[tmpq->current_sub_idx]->pts; if (ts < min_ts) { min_ts = ts; sid = i; @@ -947,7 +950,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt) /* compute maximum packet size using the next packet position. This is * useful when the len in the header is non-sense */ if (q->current_sub_idx < q->nb_subs) { - psize = q->subs[q->current_sub_idx].pos - pkt->pos; + psize = q->subs[q->current_sub_idx]->pos - pkt->pos; } else { int64_t fsize = avio_size(pb); psize = fsize < 0 ? 0xffff : fsize - pkt->pos; @@ -1037,7 +1040,7 @@ static const AVClass vobsub_demuxer_class = { .version = LIBAVUTIL_VERSION_INT, }; -AVInputFormat ff_vobsub_demuxer = { +const AVInputFormat ff_vobsub_demuxer = { .name = "vobsub", .long_name = NULL_IF_CONFIG_SMALL("VobSub subtitle format"), .priv_data_size = sizeof(VobSubDemuxContext),