[FFmpeg-devel] [PATCH 2/2] avformat/tty: add seeking support

Paul B Mahol onemda at gmail.com
Sun Feb 2 15:04:28 EET 2020


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavformat/tty.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/tty.c b/libavformat/tty.c
index 61e9f3e95c..2065fc0a53 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -150,6 +150,8 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
             n = s->fsize - p;
     }
 
+    pkt->stream_index = 0;
+    pkt->pts = pkt->pos / n;
     pkt->size = av_get_packet(avctx->pb, pkt, n);
     if (pkt->size < 0)
         return pkt->size;
@@ -182,4 +184,5 @@ AVInputFormat ff_tty_demuxer = {
     .read_packet    = read_packet,
     .extensions     = tty_extensions,
     .priv_class     = &tty_demuxer_class,
+    .flags          = AVFMT_GENERIC_INDEX,
 };
-- 
2.17.1



More information about the ffmpeg-devel mailing list