[FFmpeg-devel] [patch] allow wordexp globs in image2 file sequence import

Brian Olson icic
Sat Jan 1 22:27:22 CET 2011

> On Fri, Dec 31, 2010 at 18:11, Brian Olson wrote:
>> It seemed cumbersome to me to have to symlink/rename my image sequence files to fit
>> ffmpeg -i prefix%05d.jpg
>> so I hacked libavformat/img2.c to use <wordexp.h> file globbing, and now I can
>> ffmpeg -i '*.jpg'
>> (and other shell-expnsion patterns like ? * [] {})
>> This is my first attempt at submitting to ffmpeg. I hope you like it. Feedback welcome. Hopefully I didn't break the conventions too much.
> I think you should check for wordexp() availability in configure, and
> guard your code with HAVE_WORDEXP.
> grep the code for strtok_r/HAVE_STRTOK_R, as an example.
> Also, you should update the documentation.

Here's an expanded patch with documentation, a change to configure (and I'd like to note that this configure script is a lot nicer than autoconf), and #if HAVE_WORDEXP inserted around my work in libavformat/img2.c

Carl Eugen had a comment about indention and line wraps. I wrapped one long line to <80 chars. I found in doc/developer the guideline that long blocks (>5 lines) included in new if(){} blocks should have a separate indention-fixup patch. I have two changes right on the limit of those 5 lines, and I'd hope it's ultimately simpler to commit this all as one change.

Brian Olson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: img2_wordexp_20110101.diff
Type: application/octet-stream
Size: 5590 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110101/d4beb03b/attachment.obj>

More information about the ffmpeg-devel mailing list