* 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
Unified · Split
| @@ -80,12 +80,15 @@ endef · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) |
| 82 | 82 | |
| 83 | +ffplay.o: CFLAGS += $(SDL_CFLAGS) | |
| 83 | 84 | ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS) |
| 84 | 85 | ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS) |
| 85 | 86 | |
| 86 | −%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) | |
| 87 | +$(PROGS): %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) | |
| 87 | 88 | $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS) |
| 88 | 89 | |
| 90 | +alltools: $(TOOLS) | |
| 91 | + | |
| 89 | 92 | tools/%$(EXESUF): tools/%.o |
| 90 | 93 | $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS) |
| 91 | 94 | |
| @@ -95,8 +98,6 @@ tools/%.o: tools/%.c · 3 unmodified lines | ||
| 95 | 98 | -include $(wildcard tools/*.d) |
| 96 | 99 | -include $(wildcard tests/*.d) |
| 97 | 100 | |
| 98 | −ffplay.o: CFLAGS += $(SDL_CFLAGS) | |
| 99 | − | |
| 100 | 101 | VERSION_SH = $(SRC_PATH_BARE)/version.sh |
| 101 | 102 | GIT_LOG = $(SRC_PATH_BARE)/.git/logs/HEAD |
| 102 | 103 | |
| @@ -110,8 +111,6 @@ version.h .version: · 7 unmodified lines | ||
| 110 | 111 | # force version.sh to run whenever version might have changed |
| 111 | 112 | -include .version |
| 112 | 113 | |
| 113 | −alltools: $(TOOLS) | |
| 114 | − | |
| 115 | 114 | DOCS = $(addprefix doc/, developer.html faq.html general.html libavfilter.html) $(HTMLPAGES) $(MANPAGES) $(PODPAGES) |
| 116 | 115 | |
| 117 | 116 | documentation: $(DOCS) |
| @@ -134,7 +133,9 @@ doc/%.1: TAG = MAN · 16 unmodified lines | ||
| 134 | 133 | doc/%.1: doc/%.pod |
| 135 | 134 | $(M)pod2man --section=1 --center=" " --release=" " $< > $@ |
| 136 | 135 | |
| 137 | −install: $(INSTALL_TARGETS-yes) | |
| 136 | +install: install-libs install-headers $(INSTALL_TARGETS-yes) | |
| 137 | + | |
| 138 | +install-libs: install-libs-yes | |
| 138 | 139 | |
| 139 | 140 | install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes) |
| 140 | 141 | $(Q)mkdir -p "$(BINDIR)" |
| @@ -148,7 +149,7 @@ install-man: $(MANPAGES) · 7 unmodified lines | ||
| 148 | 149 | $(Q)mkdir -p "$(MANDIR)/man1" |
| 149 | 150 | $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1" |
| 150 | 151 | |
| 151 | −uninstall: uninstall-progs uninstall-data uninstall-man | |
| 152 | +uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data uninstall-man | |
| 152 | 153 | |
| 153 | 154 | uninstall-progs: |
| 154 | 155 | $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS)) |
| @@ -293,4 +294,5 @@ $(FATE): ffmpeg$(EXESUF) $(FATE_UTILS:%=tests/%$(HOSTEXESUF)) · 138 unmodified lines | ||
| 293 | 294 | fate-list: |
| 294 | 295 | @printf '%s\n' $(sort $(FATE)) |
| 295 | 296 | |
| 296 | −.PHONY: documentation *test regtest-* alltools check config | |
| 297 | +.PHONY: all alltools *clean check config documentation examples install* | |
| 298 | +.PHONY: *test testprogs uninstall* | |
| @@ -45,8 +45,6 @@ HOSTCFLAGS += $(IFLAGS) · 44 unmodified lines | ||
| 45 | 45 | %.ho: %.h |
| 46 | 46 | $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $< |
| 47 | 47 | |
| 48 | −%$(EXESUF): %.c | |
| 49 | − | |
| 50 | 48 | %.ver: %.v |
| 51 | 49 | $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@ |
| 52 | 50 | |
| @@ -56,24 +54,14 @@ HOSTCFLAGS += $(IFLAGS) · 3 unmodified lines | ||
| 56 | 54 | %.h: |
| 57 | 55 | @: |
| 58 | 56 | |
| 59 | −install: install-libs install-headers | |
| 60 | −install-libs: install-libs-yes | |
| 61 | − | |
| 62 | −uninstall: uninstall-libs uninstall-headers | |
| 63 | − | |
| 64 | −.PHONY: all depend dep *clean install* uninstall* examples testprogs | |
| 65 | − | |
| 66 | 57 | # Disable suffix rules. Most of the builtin rules are suffix rules, |
| 67 | 58 | # so this saves some time on slow systems. |
| 68 | 59 | .SUFFIXES: |
| 69 | 60 | |
| 70 | −# Do not delete intermediate files from chains of implicit rules | |
| 71 | −$(OBJS): | |
| 72 | 61 | endif |
| 73 | 62 | |
| 74 | 63 | OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes) |
| 75 | 64 | |
| 76 | −CFLAGS += $(CFLAGS-yes) | |
| 77 | 65 | OBJS += $(OBJS-yes) |
| 78 | 66 | FFLIBS := $(FFLIBS-yes) $(FFLIBS) |
| 79 | 67 | TESTPROGS += $(TESTPROGS-yes) |
| @@ -192,7 +192,6 @@ External library support: · 191 unmodified lines | ||
| 192 | 192 | --enable-zlib enable zlib [autodetect] |
| 193 | 193 | |
| 194 | 194 | Advanced options (experts only): |
| 195 | − --source-path=PATH path to source code [$source_path] | |
| 196 | 195 | --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix] |
| 197 | 196 | --enable-cross-compile assume a cross-compiler is used |
| 198 | 197 | --sysroot=PATH root of cross-build tree |
| @@ -1190,7 +1189,6 @@ CMDLINE_SET=" · 991 unmodified lines | ||
| 1190 | 1189 | nm |
| 1191 | 1190 | pkg_config |
| 1192 | 1191 | samples |
| 1193 | − source_path | |
| 1194 | 1192 | strip |
| 1195 | 1193 | sysinclude |
| 1196 | 1194 | sysroot |
| @@ -1715,13 +1713,12 @@ DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F) · 518 unmodified lines | ||
| 1715 | 1713 | DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM' |
| 1716 | 1714 | |
| 1717 | 1715 | # find source path |
| 1718 | −source_path="$(dirname "$0")" | |
| 1719 | −enable source_path_used | |
| 1720 | 1716 | if test -f configure; then |
| 1721 | 1717 | source_path="$(pwd)" |
| 1722 | 1718 | disable source_path_used |
| 1723 | 1719 | else |
| 1724 | − source_path="$(cd "$source_path"; pwd)" | |
| 1720 | + source_path=$(cd $(dirname "$0"); pwd) | |
| 1721 | + enable source_path_used | |
| 1725 | 1722 | echo "$source_path" | grep -q '[[:blank:]]' && |
| 1726 | 1723 | die "Out of tree builds are impossible with whitespace in source path." |
| 1727 | 1724 | test -e "$source_path/config.h" && |
| @@ -28,45 +28,16 @@ · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | #if HAVE_INLINE_ASM |
| 30 | 30 | |
| 31 | −#define MULH MULH | |
| 32 | −#define MUL64 MUL64 | |
| 33 | − | |
| 34 | 31 | #if HAVE_ARMV6 |
| 32 | +#define MULH MULH | |
| 35 | 33 | static inline av_const int MULH(int a, int b) |
| 36 | 34 | { |
| 37 | 35 | int r; |
| 38 | 36 | __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b)); |
| 39 | 37 | return r; |
| 40 | 38 | } |
| 41 | − | |
| 42 | −static inline av_const int64_t MUL64(int a, int b) | |
| 43 | −{ | |
| 44 | − int64_t x; | |
| 45 | − __asm__ ("smull %Q0, %R0, %1, %2" : "=r"(x) : "r"(a), "r"(b)); | |
| 46 | − return x; | |
| 47 | −} | |
| 48 | −#else | |
| 49 | −static inline av_const int MULH(int a, int b) | |
| 50 | −{ | |
| 51 | − int lo, hi; | |
| 52 | − __asm__ ("smull %0, %1, %2, %3" : "=&r"(lo), "=&r"(hi) : "r"(b), "r"(a)); | |
| 53 | − return hi; | |
| 54 | −} | |
| 55 | − | |
| 56 | −static inline av_const int64_t MUL64(int a, int b) | |
| 57 | −{ | |
| 58 | − int64_t x; | |
| 59 | − __asm__ ("smull %Q0, %R0, %1, %2" : "=&r"(x) : "r"(a), "r"(b)); | |
| 60 | − return x; | |
| 61 | −} | |
| 62 | 39 | #endif |
| 63 | 40 | |
| 64 | −static inline av_const int64_t MAC64(int64_t d, int a, int b) | |
| 65 | −{ | |
| 66 | − __asm__ ("smlal %Q0, %R0, %1, %2" : "+r"(d) : "r"(a), "r"(b)); | |
| 67 | − return d; | |
| 68 | −} | |
| 69 | −#define MAC64(d, a, b) ((d) = MAC64(d, a, b)) | |
| 70 | 41 | #define MLS64(d, a, b) MAC64(d, -(a), b) |
| 71 | 42 | |
| 72 | 43 | #if HAVE_ARMV5TE |
| @@ -107,7 +107,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data, · 106 unmodified lines | ||
| 107 | 107 | *o++ = (av_reverse[buf[6] & 0xf0] << 28) | |
| 108 | 108 | (av_reverse[buf[5]] << 20) | |
| 109 | 109 | (av_reverse[buf[4]] << 12) | |
| 110 | − (av_reverse[buf[3] & 0x0f] << 8); | |
| 110 | + (av_reverse[buf[3] & 0x0f] << 4); | |
| 111 | 111 | buf += 7; |
| 112 | 112 | } |
| 113 | 113 | *data_size = (uint8_t*) o - (uint8_t*) data; |
| @@ -130,7 +130,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data, · 16 unmodified lines | ||
| 130 | 130 | av_reverse[buf[0]]; |
| 131 | 131 | *o++ = (av_reverse[buf[4] & 0xf0] << 12) | |
| 132 | 132 | (av_reverse[buf[3]] << 4) | |
| 133 | − av_reverse[buf[2] & 0x0f]; | |
| 133 | + (av_reverse[buf[2]] >> 4); | |
| 134 | 134 | buf += 5; |
| 135 | 135 | } |
| 136 | 136 | *data_size = (uint8_t*) o - (uint8_t*) data; |
| @@ -227,8 +227,8 @@ typedef struct AVProbeData { · 226 unmodified lines | ||
| 227 | 227 | #define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer |
| 228 | 228 | |
| 229 | 229 | typedef struct AVFormatParameters { |
| 230 | − AVRational time_base; | |
| 231 | 230 | #if FF_API_FORMAT_PARAMETERS |
| 231 | + attribute_deprecated AVRational time_base; | |
| 232 | 232 | attribute_deprecated int sample_rate; |
| 233 | 233 | attribute_deprecated int channels; |
| 234 | 234 | attribute_deprecated int width; |
| @@ -440,7 +440,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) · 439 unmodified lines | ||
| 440 | 440 | |
| 441 | 441 | av_free(data); |
| 442 | 442 | |
| 443 | − return 0; | |
| 443 | + return pb->error; | |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | AVOutputFormat ff_flv_muxer = { |
| @@ -22,12 +22,17 @@ · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | #include "libavutil/intreadwrite.h" |
| 24 | 24 | #include "libavutil/avstring.h" |
| 25 | +#include "libavutil/log.h" | |
| 26 | +#include "libavutil/opt.h" | |
| 27 | +#include "libavutil/pixdesc.h" | |
| 28 | +#include "libavutil/parseutils.h" | |
| 25 | 29 | #include "avformat.h" |
| 26 | 30 | #include "avio_internal.h" |
| 27 | 31 | #include "internal.h" |
| 28 | 32 | #include <strings.h> |
| 29 | 33 | |
| 30 | 34 | typedef struct { |
| 35 | + const AVClass *class; /**< Class for private options. */ | |
| 31 | 36 | int img_first; |
| 32 | 37 | int img_last; |
| 33 | 38 | int img_number; |
| @@ -35,6 +40,9 @@ typedef struct { · 1 unmodified line | ||
| 35 | 40 | int is_pipe; |
| 36 | 41 | int split_planes; /**< use independent file for each Y, U, V plane */ |
| 37 | 42 | char path[1024]; |
| 43 | + char *pixel_format; /**< Set by a private option. */ | |
| 44 | + char *video_size; /**< Set by a private option. */ | |
| 45 | + char *framerate; /**< Set by a private option. */ | |
| 38 | 46 | } VideoData; |
| 39 | 47 | |
| 40 | 48 | typedef struct { |
| @@ -202,8 +210,11 @@ enum CodecID av_guess_image2_codec(const char *filename){ · 161 unmodified lines | ||
| 202 | 210 | static int read_header(AVFormatContext *s1, AVFormatParameters *ap) |
| 203 | 211 | { |
| 204 | 212 | VideoData *s = s1->priv_data; |
| 205 | − int first_index, last_index; | |
| 213 | + int first_index, last_index, ret = 0; | |
| 214 | + int width = 0, height = 0; | |
| 206 | 215 | AVStream *st; |
| 216 | + enum PixelFormat pix_fmt = PIX_FMT_NONE; | |
| 217 | + AVRational framerate; | |
| 207 | 218 | |
| 208 | 219 | s1->ctx_flags |= AVFMTCTX_NOHEADER; |
| 209 | 220 | |
| @@ -212,6 +223,29 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) · 2 unmodified lines | ||
| 212 | 223 | return AVERROR(ENOMEM); |
| 213 | 224 | } |
| 214 | 225 | |
| 226 | + if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == PIX_FMT_NONE) { | |
| 227 | + av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n", s->pixel_format); | |
| 228 | + return AVERROR(EINVAL); | |
| 229 | + } | |
| 230 | + if (s->video_size && (ret = av_parse_video_size(&width, &height, s->video_size)) < 0) { | |
| 231 | + av_log(s, AV_LOG_ERROR, "Could not parse video size: %s.\n", s->video_size); | |
| 232 | + return ret; | |
| 233 | + } | |
| 234 | + if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) { | |
| 235 | + av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate); | |
| 236 | + return ret; | |
| 237 | + } | |
| 238 | +#if FF_API_FORMAT_PARAMETERS | |
| 239 | + if (ap->pix_fmt != PIX_FMT_NONE) | |
| 240 | + pix_fmt = ap->pix_fmt; | |
| 241 | + if (ap->width > 0) | |
| 242 | + width = ap->width; | |
| 243 | + if (ap->height > 0) | |
| 244 | + height = ap->height; | |
| 245 | + if (ap->time_base.num) | |
| 246 | + framerate = (AVRational){ap->time_base.den, ap->time_base.num}; | |
| 247 | +#endif | |
| 248 | + | |
| 215 | 249 | av_strlcpy(s->path, s1->filename, sizeof(s->path)); |
| 216 | 250 | s->img_number = 0; |
| 217 | 251 | s->img_count = 0; |
| @@ -224,15 +258,11 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) · 6 unmodified lines | ||
| 224 | 258 | st->need_parsing = AVSTREAM_PARSE_FULL; |
| 225 | 259 | } |
| 226 | 260 | |
| 227 | − if (!ap->time_base.num) { | |
| 228 | − av_set_pts_info(st, 60, 1, 25); | |
| 229 | − } else { | |
| 230 | − av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); | |
| 231 | − } | |
| 261 | + av_set_pts_info(st, 60, framerate.den, framerate.num); | |
| 232 | 262 | |
| 233 | − if(ap->width && ap->height){ | |
| 234 | − st->codec->width = ap->width; | |
| 235 | − st->codec->height= ap->height; | |
| 263 | + if (width && height) { | |
| 264 | + st->codec->width = width; | |
| 265 | + st->codec->height = height; | |
| 236 | 266 | } |
| 237 | 267 | |
| 238 | 268 | if (!s->is_pipe) { |
| @@ -258,8 +288,8 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap) · 19 unmodified lines | ||
| 258 | 288 | st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| 259 | 289 | st->codec->codec_id = av_str2id(img_tags, s->path); |
| 260 | 290 | } |
| 261 | − if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) | |
| 262 | − st->codec->pix_fmt = ap->pix_fmt; | |
| 291 | + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pix_fmt != PIX_FMT_NONE) | |
| 292 | + st->codec->pix_fmt = pix_fmt; | |
| 263 | 293 | |
| 264 | 294 | return 0; |
| 265 | 295 | } |
| @@ -430,6 +460,22 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) · 164 unmodified lines | ||
| 430 | 460 | |
| 431 | 461 | #endif /* CONFIG_IMAGE2_MUXER || CONFIG_IMAGE2PIPE_MUXER */ |
| 432 | 462 | |
| 463 | +#define OFFSET(x) offsetof(VideoData, x) | |
| 464 | +#define DEC AV_OPT_FLAG_DECODING_PARAM | |
| 465 | +static const AVOption options[] = { | |
| 466 | + { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, | |
| 467 | + { "video_size", "", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, | |
| 468 | + { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, | |
| 469 | + { NULL }, | |
| 470 | +}; | |
| 471 | + | |
| 472 | +static const AVClass img2_class = { | |
| 473 | + .class_name = "image2 demuxer", | |
| 474 | + .item_name = av_default_item_name, | |
| 475 | + .option = options, | |
| 476 | + .version = LIBAVUTIL_VERSION_INT, | |
| 477 | +}; | |
| 478 | + | |
| 433 | 479 | /* input */ |
| 434 | 480 | #if CONFIG_IMAGE2_DEMUXER |
| 435 | 481 | AVInputFormat ff_image2_demuxer = { |
| @@ -440,6 +486,7 @@ AVInputFormat ff_image2_demuxer = { · 4 unmodified lines | ||
| 440 | 486 | .read_header = read_header, |
| 441 | 487 | .read_packet = read_packet, |
| 442 | 488 | .flags = AVFMT_NOFILE, |
| 489 | + .priv_class = &img2_class, | |
| 443 | 490 | }; |
| 444 | 491 | #endif |
| 445 | 492 | #if CONFIG_IMAGE2PIPE_DEMUXER |
| @@ -449,6 +496,7 @@ AVInputFormat ff_image2pipe_demuxer = { · 3 unmodified lines | ||
| 449 | 496 | .priv_data_size = sizeof(VideoData), |
| 450 | 497 | .read_header = read_header, |
| 451 | 498 | .read_packet = read_packet, |
| 499 | + .priv_class = &img2_class, | |
| 452 | 500 | }; |
| 453 | 501 | #endif |
| 454 | 502 | |
| @@ -37,6 +37,7 @@ typedef struct { · 36 unmodified lines | ||
| 37 | 37 | int chars_per_frame; |
| 38 | 38 | uint64_t fsize; /**< file size less metadata buffer */ |
| 39 | 39 | char *video_size;/**< A string describing video size, set by a private option. */ |
| 40 | + char *framerate; /**< Set by a private option. */ | |
| 40 | 41 | } TtyDemuxContext; |
| 41 | 42 | |
| 42 | 43 | /** |
| @@ -75,6 +76,7 @@ static int read_header(AVFormatContext *avctx, · 32 unmodified lines | ||
| 75 | 76 | TtyDemuxContext *s = avctx->priv_data; |
| 76 | 77 | int width = 0, height = 0, ret = 0; |
| 77 | 78 | AVStream *st = av_new_stream(avctx, 0); |
| 79 | + AVRational framerate; | |
| 78 | 80 | |
| 79 | 81 | if (!st) { |
| 80 | 82 | ret = AVERROR(ENOMEM); |
| @@ -88,20 +90,21 @@ static int read_header(AVFormatContext *avctx, · 7 unmodified lines | ||
| 88 | 90 | av_log (avctx, AV_LOG_ERROR, "Couldn't parse video size.\n"); |
| 89 | 91 | goto fail; |
| 90 | 92 | } |
| 93 | + if ((ret = av_parse_video_rate(&framerate, s->framerate)) < 0) { | |
| 94 | + av_log(avctx, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s->framerate); | |
| 95 | + goto fail; | |
| 96 | + } | |
| 91 | 97 | #if FF_API_FORMAT_PARAMETERS |
| 92 | 98 | if (ap->width > 0) |
| 93 | 99 | width = ap->width; |
| 94 | 100 | if (ap->height > 0) |
| 95 | 101 | height = ap->height; |
| 102 | + if (ap->time_base.num) | |
| 103 | + framerate = (AVRational){ap->time_base.den, ap->time_base.num}; | |
| 96 | 104 | #endif |
| 97 | 105 | st->codec->width = width; |
| 98 | 106 | st->codec->height = height; |
| 99 | − | |
| 100 | − if (!ap->time_base.num) { | |
| 101 | − av_set_pts_info(st, 60, 1, 25); | |
| 102 | − } else { | |
| 103 | − av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); | |
| 104 | − } | |
| 107 | + av_set_pts_info(st, 60, framerate.den, framerate.num); | |
| 105 | 108 | |
| 106 | 109 | /* simulate tty display speed */ |
| 107 | 110 | #if FF_API_FORMAT_PARAMETERS |
| @@ -152,6 +155,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt) · 44 unmodified lines | ||
| 152 | 155 | static const AVOption options[] = { |
| 153 | 156 | { "chars_per_frame", "", offsetof(TtyDemuxContext, chars_per_frame), FF_OPT_TYPE_INT, {.dbl = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM}, |
| 154 | 157 | { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, |
| 158 | + { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC }, | |
| 155 | 159 | { NULL }, |
| 156 | 160 | }; |
| 157 | 161 | |