From 4fea8959d8f8719fa33ea30a5cfc98338aae0af2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 15 Mar 2012 08:17:05 +0100 Subject: doc/avconv: remove entries for AVOptions. Documentation for those will be generated automatically. --- doc/avconv.texi | 188 +++++--------------------------------------------------- 1 file changed, 14 insertions(+), 174 deletions(-) (limited to 'doc') diff --git a/doc/avconv.texi b/doc/avconv.texi index 91283a4831..64892a4da3 100644 --- a/doc/avconv.texi +++ b/doc/avconv.texi @@ -330,25 +330,7 @@ numerator and denominator of the aspect ratio. For example "4:3", @item -vn (@emph{output}) Disable video recording. -@item -bt @var{tolerance} -Set video bitrate tolerance (in bits, default 4000k). -Has a minimum value of: (target_bitrate/target_framerate). -In 1-pass mode, bitrate tolerance specifies how far ratecontrol is -willing to deviate from the target average bitrate value. This is -not related to min/max bitrate. Lowering tolerance too much has -an adverse effect on quality. -@item -maxrate @var{bitrate} -Set max video bitrate (in bit/s). -Requires -bufsize to be set. -@item -minrate @var{bitrate} -Set min video bitrate (in bit/s). -Most useful in setting up a CBR encode: -@example -avconv -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v -@end example -It is of little use elsewise. -@item -bufsize @var{size} -Set video buffer verifier buffer size (in bits). + @item -vcodec @var{codec} (@emph{output}) Set the video codec. This is an alias for @code{-codec:v}. @item -same_quant @@ -392,140 +374,11 @@ Set pixel format. Use @code{-pix_fmts} to show all the supported pixel formats. @item -sws_flags @var{flags} (@emph{input/output}) Set SwScaler flags. -@item -g @var{gop_size} -Set the group of pictures size. @item -vdt @var{n} Discard threshold. -@item -qmin @var{q} -minimum video quantizer scale (VBR) -@item -qmax @var{q} -maximum video quantizer scale (VBR) -@item -qdiff @var{q} -maximum difference between the quantizer scales (VBR) -@item -qblur @var{blur} -video quantizer scale blur (VBR) (range 0.0 - 1.0) -@item -qcomp @var{compression} -video quantizer scale compression (VBR) (default 0.5). -Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0 - -@item -lmin @var{lambda} -minimum video lagrange factor (VBR) -@item -lmax @var{lambda} -max video lagrange factor (VBR) -@item -mblmin @var{lambda} -minimum macroblock quantizer scale (VBR) -@item -mblmax @var{lambda} -maximum macroblock quantizer scale (VBR) - -These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units, -but you may use the QP2LAMBDA constant to easily convert from 'q' units: -@example -avconv -i src.ext -lmax 21*QP2LAMBDA dst.ext -@end example - -@item -rc_init_cplx @var{complexity} -initial complexity for single pass encoding -@item -b_qfactor @var{factor} -qp factor between P- and B-frames -@item -i_qfactor @var{factor} -qp factor between P- and I-frames -@item -b_qoffset @var{offset} -qp offset between P- and B-frames -@item -i_qoffset @var{offset} -qp offset between P- and I-frames -@item -rc_eq @var{equation} -Set rate control equation (see section "Expression Evaluation") -(default = @code{tex^qComp}). - -When computing the rate control equation expression, besides the -standard functions defined in the section "Expression Evaluation", the -following functions are available: -@table @var -@item bits2qp(bits) -@item qp2bits(qp) -@end table - -and the following constants are available: -@table @var -@item iTex -@item pTex -@item tex -@item mv -@item fCode -@item iCount -@item mcVar -@item var -@item isI -@item isP -@item isB -@item avgQP -@item qComp -@item avgIITex -@item avgPITex -@item avgPPTex -@item avgBPTex -@item avgTex -@end table @item -rc_override[:@var{stream_specifier}] @var{override} (@emph{output,per-stream}) rate control override for specific intervals -@item -me_method @var{method} -Set motion estimation method to @var{method}. -Available methods are (from lowest to best quality): -@table @samp -@item zero -Try just the (0, 0) vector. -@item phods -@item log -@item x1 -@item hex -@item umh -@item epzs -(default method) -@item full -exhaustive search (slow and marginally better than epzs) -@end table - -@item -er @var{n} -Set error resilience to @var{n}. -@table @samp -@item 1 -FF_ER_CAREFUL (default) -@item 2 -FF_ER_COMPLIANT -@item 3 -FF_ER_AGGRESSIVE -@item 4 -FF_ER_VERY_AGGRESSIVE -@end table - -@item -ec @var{bit_mask} -Set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of -the following values: -@table @samp -@item 1 -FF_EC_GUESS_MVS (default = enabled) -@item 2 -FF_EC_DEBLOCK (default = enabled) -@end table - -@item -bf @var{frames} -Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4). -@item -mbd @var{mode} -macroblock decision -@table @samp -@item 0 -FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in avconv). -@item 1 -FF_MB_DECISION_BITS: Choose the one which needs the fewest bits. -@item 2 -FF_MB_DECISION_RD: rate distortion -@end table - -@item -bug @var{param} -Work around encoder bugs that are not auto-detected. -@item -strict @var{strictness} -How strictly to follow the standards. @item -deinterlace Deinterlace pictures. @@ -586,28 +439,6 @@ of supported sample formats. @table @option @item -atag @var{fourcc/tag} (@emph{output}) Force audio tag/fourcc. This is an alias for @code{-tag:a}. -@item -audio_service_type @var{type} -Set the type of service that the audio stream contains. -@table @option -@item ma -Main Audio Service (default) -@item ef -Effects -@item vi -Visually Impaired -@item hi -Hearing Impaired -@item di -Dialogue -@item co -Commentary -@item em -Emergency -@item vo -Voice Over -@item ka -Karaoke -@end table @end table @section Subtitle options: @@ -739,12 +570,8 @@ Exit after avconv has been running for @var{duration} seconds. Dump each input packet to stderr. @item -hex (@emph{global}) When dumping packets, also dump the payload. -@item -ps @var{size} -Set RTP payload size in bytes. @item -re (@emph{input}) Read input at native frame rate. Mainly used to simulate a grab device. -@item -threads @var{count} -Thread count. @item -vsync @var{parameter} Video sync method. @@ -1034,6 +861,19 @@ avconv -i test1.avi -i test2.avi -map 0.3 -map 0.2 -map 0.1 -map 0.0 -c copy tes The resulting output file @file{test12.avi} will contain first four streams from the input file in reverse order. +@item +To force CBR video output: +@example +avconv -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v +@end example + +@item +The four options lmin, lmax, mblmin and mblmax use 'lambda' units, +but you may use the QP2LAMBDA constant to easily convert from 'q' units: +@example +avconv -i src.ext -lmax 21*QP2LAMBDA dst.ext +@end example + @end itemize @c man end EXAMPLES -- cgit v1.2.3 From 0d0b81f941a2d5011bec754ba48e84a479306661 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 14 Mar 2012 20:08:50 +0100 Subject: Generate manpages for AV{Format,Codec}Context AVOptions. --- Makefile | 2 +- doc/Makefile | 17 ++++-- doc/avtools-common-opts.texi | 3 ++ doc/print_options.c | 123 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 doc/print_options.c (limited to 'doc') diff --git a/Makefile b/Makefile index ae9191cd10..ae9c5fa489 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ PROGS-$(CONFIG_AVSERVER) += avserver PROGS := $(PROGS-yes:%=%$(EXESUF)) OBJS = $(PROGS-yes:%=%.o) cmdutils.o TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64 -HOSTPROGS := $(TESTTOOLS:%=tests/%) +HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options TOOLS = qt-faststart trasher TOOLS-$(CONFIG_ZLIB) += cws2fws diff --git a/doc/Makefile b/doc/Makefile index 0acd9844af..5172707a4b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -17,18 +17,27 @@ documentation: $(DOCS) TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d) +doc/print_options.o: libavformat/options_table.h libavcodec/options_table.h + +GENTEXI = format codec +GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi) + +$(GENTEXI): TAG = GENTEXI +$(GENTEXI): doc/avoptions_%.texi: doc/print_options + $(M)doc/print_options $* > $@ + doc/%.html: TAG = HTML -doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init +doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI) $(Q)$(TEXIDEP) $(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $< doc/%.pod: TAG = POD -doc/%.pod: doc/%.texi +doc/%.pod: doc/%.texi $(GENTEXI) $(Q)$(TEXIDEP) $(M)$(SRC_PATH)/doc/texi2pod.pl $< $@ doc/%.1: TAG = MAN -doc/%.1: doc/%.pod +doc/%.1: doc/%.pod $(GENTEXI) $(M)pod2man --section=1 --center=" " --release=" " $< > $@ $(DOCS): | doc @@ -46,7 +55,7 @@ uninstall-man: $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES)) clean:: - $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) + $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi -include $(wildcard $(DOCS:%=%.d)) diff --git a/doc/avtools-common-opts.texi b/doc/avtools-common-opts.texi index badd35818c..0be9cf0634 100644 --- a/doc/avtools-common-opts.texi +++ b/doc/avtools-common-opts.texi @@ -156,3 +156,6 @@ use @option{-option 0}/@option{-option 1}. Note2 old undocumented way of specifying per-stream AVOptions by prepending v/a/s to the options name is now obsolete and will be removed soon. + +@include avoptions_codec.texi +@include avoptions_format.texi diff --git a/doc/print_options.c b/doc/print_options.c new file mode 100644 index 0000000000..4283e6a86d --- /dev/null +++ b/doc/print_options.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2012 Anton Khirnov + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * generate texinfo manpages for avoptions + */ + +#include +#include +#include + +#include "libavformat/avformat.h" +#include "libavcodec/avcodec.h" +#include "libavutil/opt.h" + +static void print_usage(void) +{ + fprintf(stderr, "Usage: enum_options type\n" + "type: format codec\n"); + exit(1); +} + +static void print_option(const AVOption *opts, const AVOption *o, int per_stream) +{ + printf("@item -%s%s @var{", o->name, per_stream ? "[:stream_specifier]" : ""); + switch (o->type) { + case AV_OPT_TYPE_BINARY: printf("hexadecimal string"); break; + case AV_OPT_TYPE_STRING: printf("string"); break; + case AV_OPT_TYPE_INT: + case AV_OPT_TYPE_INT64: printf("integer"); break; + case AV_OPT_TYPE_FLOAT: + case AV_OPT_TYPE_DOUBLE: printf("float"); break; + case AV_OPT_TYPE_RATIONAL: printf("rational number"); break; + case AV_OPT_TYPE_FLAGS: printf("flags"); break; + default: printf("value"); break; + } + printf("} (@emph{"); + + if (o->flags & AV_OPT_FLAG_DECODING_PARAM) { + printf("input"); + if (o->flags & AV_OPT_FLAG_ENCODING_PARAM) + printf("/"); + } + if (o->flags & AV_OPT_FLAG_ENCODING_PARAM) printf("output"); + if (o->flags & AV_OPT_FLAG_AUDIO_PARAM) printf(",audio"); + if (o->flags & AV_OPT_FLAG_VIDEO_PARAM) printf(",video"); + if (o->flags & AV_OPT_FLAG_SUBTITLE_PARAM) printf(",subtitles"); + + printf("})\n"); + if (o->help) + printf("%s\n", o->help); + + if (o->unit) { + const AVOption *u; + printf("\nPossible values:\n@table @samp\n"); + + for (u = opts; u->name; u++) { + if (u->type == AV_OPT_TYPE_CONST && u->unit && !strcmp(u->unit, o->unit)) + printf("@item %s\n%s\n", u->name, u->help ? u->help : ""); + } + printf("@end table\n"); + } +} + +static void show_opts(const AVOption *opts, int per_stream) +{ + const AVOption *o; + + printf("@table @option\n"); + for (o = opts; o->name; o++) { + if (o->type != AV_OPT_TYPE_CONST) + print_option(opts, o, per_stream); + } + printf("@end table\n"); +} + +static void show_format_opts(void) +{ +#include "libavformat/options_table.h" + + printf("@section Format AVOptions\n"); + show_opts(options, 0); +} + +static void show_codec_opts(void) +{ +#include "libavcodec/options_table.h" + + printf("@section Codec AVOptions\n"); + show_opts(options, 1); +} + +int main(int argc, char **argv) +{ + if (argc < 2) + print_usage(); + + if (!strcmp(argv[1], "format")) + show_format_opts(); + else if (!strcmp(argv[1], "codec")) + show_codec_opts(); + else + print_usage(); + + return 0; +} -- cgit v1.2.3 From ccfa8aa26f666372f47d69bc49e420a9b4239626 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 19 Mar 2012 20:40:23 +0200 Subject: rtsp: Set the default delay to 0.1 s for the RTSP/SDP/RTP demuxers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This enables reordering of UDP packets by default, unless the caller explicitly sets -max_delay 0. Signed-off-by: Martin Storsjö --- doc/protocols.texi | 6 +++--- libavformat/rtsp.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/protocols.texi b/doc/protocols.texi index 0eb4c69b49..b08233ec80 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -288,9 +288,9 @@ Accept packets only from negotiated peer address and port. @end table When receiving data over UDP, the demuxer tries to reorder received packets -(since they may arrive out of order, or packets may get lost totally). In -order for this to be enabled, a maximum delay must be specified in the -@code{max_delay} field of AVFormatContext. +(since they may arrive out of order, or packets may get lost totally). This +can be disabled by setting the maximum demuxing delay to zero (via +the @code{max_delay} field of AVFormatContext). When watching multi-bitrate Real-RTSP streams with @file{avplay}, the streams to display can be chosen with @code{-vst} @var{n} and diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 7afd106cfb..07cf80992e 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -56,6 +56,7 @@ #define MAX_TIMEOUTS READ_PACKET_TIMEOUT_S * 1000 / POLL_TIMEOUT_MS #define SDP_MAX_SIZE 16384 #define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH +#define DEFAULT_REORDERING_DELAY 100000 #define OFFSET(x) offsetof(RTSPState, x) #define DEC AV_OPT_FLAG_DECODING_PARAM @@ -1427,7 +1428,7 @@ int ff_rtsp_connect(AVFormatContext *s) return AVERROR(EIO); if (s->max_delay < 0) /* Not set by the caller */ - s->max_delay = 0; + s->max_delay = s->iformat ? DEFAULT_REORDERING_DELAY : 0; rt->control_transport = RTSP_MODE_PLAIN; if (rt->lower_transport_mask & (1 << RTSP_LOWER_TRANSPORT_HTTP)) { @@ -1870,7 +1871,7 @@ static int sdp_read_header(AVFormatContext *s) return AVERROR(EIO); if (s->max_delay < 0) /* Not set by the caller */ - s->max_delay = 0; + s->max_delay = DEFAULT_REORDERING_DELAY; /* read the whole sdp file */ /* XXX: better loading */ -- cgit v1.2.3 From 39f5a5462c07234453ad47a2a0158d390d4e42fc Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 19 Mar 2012 19:31:15 +0200 Subject: movenc: Add a min_frag_duration option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The other fragmentation options (frag_duration, frag_size and frag_keyframe) are combined with OR, cutting fragments at the first of the conditions being fulfilled. Signed-off-by: Martin Storsjö --- doc/muxers.texi | 7 +++++++ libavformat/movenc.c | 15 ++++++++++----- libavformat/movenc.h | 1 + 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/muxers.texi b/doc/muxers.texi index 82ea99a17e..4bb6d56a00 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -172,8 +172,15 @@ Allow the caller to manually choose when to cut fragments, by calling @code{av_write_frame(ctx, NULL)} to write a fragment with the packets written so far. (This is only useful with other applications integrating libavformat, not from @command{avconv}.) +@item -min_frag_duration @var{duration} +Don't create fragments that are shorter than @var{duration} microseconds long. @end table +If more than one condition is specified, fragments are cut when +one of the specified conditions is fulfilled. The exception to this is +@code{-min_frag_duration}, which has to be fulfilled for any of the other +conditions to apply. + Additionally, the way the output file is written can be adjusted through a few other options: diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 10bcedc66a..1209b7b114 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -56,6 +56,7 @@ static const AVOption options[] = { { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, { "iods_video_profile", "iods video profile atom.", offsetof(MOVMuxContext, iods_video_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, { "frag_duration", "Maximum fragment duration", offsetof(MOVMuxContext, max_fragment_duration), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, + { "min_frag_duration", "Minimum fragment duration", offsetof(MOVMuxContext, min_fragment_duration), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { "frag_size", "Maximum fragment size", offsetof(MOVMuxContext, max_fragment_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { "ism_lookahead", "Number of lookahead entries for ISM files", offsetof(MOVMuxContext, ism_lookahead), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { NULL }, @@ -2831,21 +2832,25 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) unsigned int samples_in_chunk = 0; int size= pkt->size; uint8_t *reformatted_data = NULL; + int64_t frag_duration = 0; if (!s->pb->seekable && !(mov->flags & FF_MOV_FLAG_EMPTY_MOOV)) return 0; /* Can't handle that */ if (!size) return 0; /* Discard 0 sized packets */ - if ((mov->max_fragment_duration && trk->entry && - av_rescale_q(pkt->dts - trk->cluster[0].dts, - s->streams[pkt->stream_index]->time_base, - AV_TIME_BASE_Q) >= mov->max_fragment_duration) || + if (trk->entry) + frag_duration = av_rescale_q(pkt->dts - trk->cluster[0].dts, + s->streams[pkt->stream_index]->time_base, + AV_TIME_BASE_Q); + if ((mov->max_fragment_duration && + frag_duration >= mov->max_fragment_duration) || (mov->max_fragment_size && mov->mdat_size + size >= mov->max_fragment_size) || (mov->flags & FF_MOV_FLAG_FRAG_KEYFRAME && enc->codec_type == AVMEDIA_TYPE_VIDEO && trk->entry && pkt->flags & AV_PKT_FLAG_KEY)) { - mov_flush_fragment(s); + if (frag_duration >= mov->min_fragment_duration) + mov_flush_fragment(s); } if (mov->flags & FF_MOV_FLAG_FRAGMENT) { diff --git a/libavformat/movenc.h b/libavformat/movenc.h index 350dbe04f2..3be43e0fc9 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -149,6 +149,7 @@ typedef struct MOVMuxContext { int fragments; int max_fragment_duration; + int min_fragment_duration; int max_fragment_size; int ism_lookahead; AVIOContext *mdat_buf; -- cgit v1.2.3 From b8b207e8963f35a76c6981d7a74d6c08a53abab9 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 20 Mar 2012 10:53:06 +0000 Subject: doc: texi2pod: add -I flag This allows specifying additional directories to search for @include files. Signed-off-by: Mans Rullgard --- doc/texi2pod.pl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/texi2pod.pl b/doc/texi2pod.pl index 0eb5e8d9fe..94323be340 100755 --- a/doc/texi2pod.pl +++ b/doc/texi2pod.pl @@ -36,7 +36,7 @@ $shift = ""; %defs = (); $fnno = 1; $inf = ""; -$ibase = ""; +@ibase = (); while ($_ = shift) { if (/^-D(.*)$/) { @@ -52,6 +52,8 @@ while ($_ = shift) { die "flags may only contain letters, digits, hyphens, dashes and underscores\n" unless $flag =~ /^[a-zA-Z0-9_-]+$/; $defs{$flag} = $value; + } elsif (/^-I(.*)$/) { + push @ibase, $1 ne "" ? $1 : shift; } elsif (/^-/) { usage(); } else { @@ -61,10 +63,12 @@ while ($_ = shift) { } } +push @ibase, "."; + if (defined $in) { $inf = gensym(); open($inf, "<$in") or die "opening \"$in\": $!\n"; - $ibase = $1 if $in =~ m|^(.+)/[^/]+$|; + push @ibase, $1 if $in =~ m|^(.+)/[^/]+$|; } else { $inf = \*STDIN; } @@ -74,7 +78,7 @@ if (defined $out) { } while(defined $inf) { -while(<$inf>) { +INF: while(<$inf>) { # Certain commands are discarded without further processing. /^\@(?: [a-z]+index # @*index: useful only in complete manual @@ -104,11 +108,10 @@ while(<$inf>) { push @instack, $inf; $inf = gensym(); - # Try cwd and $ibase. - open($inf, "<" . $1) - or open($inf, "<" . $ibase . "/" . $1) - or die "cannot open $1 or $ibase/$1: $!\n"; - next; + for (@ibase) { + open($inf, "<" . $_ . "/" . $1) and next INF; + } + die "cannot open $1: $!\n"; }; # Look for blocks surrounded by @c man begin SECTION ... @c man end. -- cgit v1.2.3 From 2ac3df858c3afdc1e3a8e19670483a379f7da447 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 20 Mar 2012 10:54:02 +0000 Subject: doc: pass -Idoc texi2html and texi2pod This fixes doc generation in build tree separate from source. Signed-off-by: Mans Rullgard --- doc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/Makefile b/doc/Makefile index 5172707a4b..a051f6e6d1 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -29,12 +29,12 @@ $(GENTEXI): doc/avoptions_%.texi: doc/print_options doc/%.html: TAG = HTML doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI) $(Q)$(TEXIDEP) - $(M)texi2html -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $< + $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $< doc/%.pod: TAG = POD doc/%.pod: doc/%.texi $(GENTEXI) $(Q)$(TEXIDEP) - $(M)$(SRC_PATH)/doc/texi2pod.pl $< $@ + $(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@ doc/%.1: TAG = MAN doc/%.1: doc/%.pod $(GENTEXI) -- cgit v1.2.3