---
libavformat/tty.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavformat/tty.c b/libavformat/tty.c
index bc6058d..cce5b0e 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -35,6 +35,7 @@ typedef struct {
AVClass *class;
int chars_per_frame;
uint64_t fsize; /**< file size less metadata buffer */
+ int width, height;
} TtyDemuxContext;
/**
@@ -77,8 +78,11 @@ static int read_header(AVFormatContext *avctx,
st->codec->codec_tag = 0;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_ANSI;
- if (ap->width) st->codec->width = ap->width;
- if (ap->height) st->codec->height = ap->height;
+ if (ap->width) s->width = ap->width;
+ if (ap->height) s->height = ap->height;
+ st->codec->width = s->width;
+ st->codec->height = s->height;
+
if (!ap->time_base.num) {
av_set_pts_info(st, 60, 1, 25);
@@ -131,6 +135,8 @@ static int read_packet(AVFormatContext *avctx, AVPacket
*pkt)
static const AVOption options[] = {
{ "chars_per_frame", "", offsetof(TtyDemuxContext, chars_per_frame),
FF_OPT_TYPE_INT, {.dbl = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
+ { "width", "", offsetof(TtyDemuxContext, width),
FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+ { "height", "", offsetof(TtyDemuxContext, height),
FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
};
--
1.7.5.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel