]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/tty.c
Do not try to parse empty strf tags.
[ffmpeg] / libavformat / tty.c
index ddf283d8a3c9d5ccfc83eecb5eefb82d75a18135..913ec457da09582decb248b45bb37a943eda9883 100644 (file)
@@ -95,23 +95,11 @@ static int read_header(AVFormatContext *avctx,
         av_log(avctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate);
         goto fail;
     }
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->width > 0)
-        width = ap->width;
-    if (ap->height > 0)
-        height = ap->height;
-    if (ap->time_base.num)
-        framerate = (AVRational){ap->time_base.den, ap->time_base.num};
-#endif
     st->codec->width  = width;
     st->codec->height = height;
     av_set_pts_info(st, 60, framerate.den, framerate.num);
 
     /* simulate tty display speed */
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->sample_rate)
-        s->chars_per_frame = ap->sample_rate;
-#endif
     s->chars_per_frame = FFMAX(av_q2d(st->time_base)*s->chars_per_frame, 1);
 
     if (avctx->pb->seekable) {
@@ -154,9 +142,9 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
 #define OFFSET(x) offsetof(TtyDemuxContext, x)
 #define DEC AV_OPT_FLAG_DECODING_PARAM
 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},
-    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
-    { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
+    { "chars_per_frame", "", offsetof(TtyDemuxContext, chars_per_frame), AV_OPT_TYPE_INT, {.dbl = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
+    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
+    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
     { NULL },
 };