Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-07 05:37:57 +0400
committerMichael Niedermayer <michaelni@gmx.at>2011-06-07 05:37:57 +0400
commit174df6affc4e2cfdc6c91c1be3c3e1a8a794cf78 (patch)
treea77673fd1d752a54bf812b187eb80d066c7cc49f /libavformat/tty.c
parent3a1aaf7b21c7bde9f4c3d5342baa64d3e940d05f (diff)
parentb9c6c7cb25932b594fd684a0cb553e439d49fe12 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: build: remove empty $(OBJS) target build: make rule for linking ff* apply only to these targets build: rearrange some lines in a more logical way s302m: fix resampling for 16 and 24bits. ARM: remove MUL64 and MAC64 inline asm build: clean up .PHONY lists build: move all (un)install* target aliases to toplevel Makefile flvenc: propagate error properly build: remove stale dependency build: do not add CFLAGS-yes to CFLAGS utils.c: fix crash with threading enabled. configure: simplify source_path setup configure: remove --source-path option lavf: deprecate AVFormatParameters.time_base. img2: add framerate private option. img2: add video_size private option. img2: add pixel_format private option. tty: add framerate private option. Conflicts: Makefile configure Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/tty.c')
-rw-r--r--libavformat/tty.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/tty.c b/libavformat/tty.c
index eddadb49bd..d0c9a08e83 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -37,6 +37,7 @@ typedef struct {
int chars_per_frame;
uint64_t fsize; /**< file size less metadata buffer */
char *video_size;/**< A string describing video size, set by a private option. */
+ char *framerate; /**< Set by a private option. */
} TtyDemuxContext;
/**
@@ -75,6 +76,7 @@ static int read_header(AVFormatContext *avctx,
TtyDemuxContext *s = avctx->priv_data;
int width = 0, height = 0, ret = 0;
AVStream *st = av_new_stream(avctx, 0);
+ AVRational framerate;
if (!st) {
ret = AVERROR(ENOMEM);
@@ -88,20 +90,21 @@ static int read_header(AVFormatContext *avctx,
av_log (avctx, AV_LOG_ERROR, "Couldn't parse video size.\n");
goto fail;
}
+ if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) {
+ 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;
-
- if (!ap->time_base.num) {
- av_set_pts_info(st, 60, 1, 25);
- } else {
- av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den);
- }
+ av_set_pts_info(st, 60, framerate.den, framerate.num);
/* simulate tty display speed */
#if FF_API_FORMAT_PARAMETERS
@@ -152,6 +155,7 @@ 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},
{ "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 },
{ NULL },
};