]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/tty.c
avfilter/formats: Remove avfilter_make_format64_list()
[ffmpeg] / libavformat / tty.c
index f889121e26a3f41dcafc685e56a0479bbf1eaac0..aed5c888c38773144b88e7309a75625e9dc8bd86 100644 (file)
@@ -65,7 +65,7 @@ static int read_probe(const AVProbeData *p)
     for (int i = 8; i < p->buf_size; i++)
         cnt += !!isansicode(p->buf[i]);
 
-    return (cnt * 100LL / p->buf_size) * (cnt > 400) *
+    return (cnt * 99LL / p->buf_size) * (cnt > 400) *
         !!av_match_ext(p->filename, tty_extensions);
 }
 
@@ -156,6 +156,8 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
     pkt->size = av_get_packet(avctx->pb, pkt, n);
     if (pkt->size < 0)
         return pkt->size;
+    pkt->stream_index = 0;
+    pkt->pts = pkt->pos / s->chars_per_frame;
     pkt->flags |= AV_PKT_FLAG_KEY;
     return 0;
 }
@@ -185,4 +187,5 @@ AVInputFormat ff_tty_demuxer = {
     .read_packet    = read_packet,
     .extensions     = tty_extensions,
     .priv_class     = &tty_demuxer_class,
+    .flags          = AVFMT_GENERIC_INDEX,
 };