[SCM] ffmpeg2theora/master: Imported Upstream version 0.29~git+20140316
tiago at users.alioth.debian.org
tiago at users.alioth.debian.org
Sun Mar 16 17:40:57 UTC 2014
The following commit has been merged in the master branch:
commit 1cdf8ce62281f3b1ab11bd8ca318b9ab4743dffd
Author: Tiago Bortoletto Vaz <tiago at debian.org>
Date: Sun Mar 16 13:40:17 2014 -0400
Imported Upstream version 0.29~git+20140316
diff --git a/Makefile b/Makefile
index d895ce3..11dc819 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,5 @@ install:
scons install $(PREFIX)
dist:
- svn export . ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
- tar cjf ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`.tar.bz2 ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
- rm -r ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
+ git archive --format=tar --prefix=ffmpeg2theora-`./version.sh`/ master | bzip2 >ffmpeg2theora-`./version.sh`.tar.bz2
+ ls -lah ffmpeg2theora-`./version.sh`.tar.bz2
diff --git a/SConstruct b/SConstruct
index fc7822f..8569104 100644
--- a/SConstruct
+++ b/SConstruct
@@ -6,12 +6,13 @@ import os
import SCons
def version():
+ #return "0.29"
f = os.popen("./version.sh")
version = f.read().strip()
f.close()
return version
-pkg_version="0.29"
+pkg_version=version()
pkg_name="ffmpeg2theora"
@@ -151,7 +152,6 @@ if not env.GetOption('clean'):
"libavcodec >= 52.30.0",
"libpostproc",
"libswscale",
- "libswresample",
"libavutil",
]
if os.path.exists("./ffmpeg"):
@@ -161,6 +161,19 @@ if not env.GetOption('clean'):
env.Append(CCFLAGS=[
'-Iffmpeg'
])
+ for lib in FFMPEG_LIBS:
+ lib = lib.split(' ')[0]
+ env.Append(LINKFLAGS=[
+ '-Lffmpeg/' + lib
+ ])
+
+ if conf.CheckPKG('libavresample'):
+ FFMPEG_LIBS.append('libavresample')
+ else:
+ FFMPEG_LIBS.append('libswresample')
+ env.Append(CCFLAGS=[
+ '-DUSE_SWRESAMPLE'
+ ])
if not conf.CheckPKG(' '.join(FFMPEG_LIBS)):
print """
diff --git a/build_ffmpeg.sh b/build_ffmpeg.sh
index 6403e52..22c8090 100755
--- a/build_ffmpeg.sh
+++ b/build_ffmpeg.sh
@@ -21,5 +21,5 @@ options="$common --enable-pthreads $extra"
uname | grep MINGW && options="$common --enable-memalign-hack --enable-mingw32 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib $extra"
#configure and build ffmpeg
-cd $FFMPEG_CO_DIR && ./configure $options && make
+cd $FFMPEG_CO_DIR && ./configure $options && make -j8
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 1197311..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,120 +0,0 @@
-ffmpeg2theora (0.29-2) unstable; urgency=low
-
- * Pushing 0.29 to unstable fixes FTBFS. (Closes: #713716)
- * Remove obsolete DM-Upload-Allowed field.
- * Replace uncanonical URI from VCS-* fields.
- * Update Standards-Version.
-
- -- Tiago Bortoletto Vaz <tiago at debian.org> Sat, 22 Jun 2013 11:37:44 -0400
-
-ffmpeg2theora (0.29-1) experimental; urgency=low
-
- * Migrate source to pkg-multimedia git repository tree.
- * Add pkg-multimedia as maintainer
- * New upstream version. (Closes: #692914, #652705)
-
- -- Tiago Bortoletto Vaz <tiago at debian.org> Thu, 15 Nov 2012 15:05:50 -0500
-
-ffmpeg2theora (0.27-2) unstable; urgency=low
-
- * Switch to dpkg-source 3.0 (quilt) format
- * Add ubuntu patch to build against libav/0.7. Last upstream version (0.28)
- fails to build so let's use this patch for now. (Closes: #638245)
- * Now we have 0.27 in unstable, so close "New version 0.25 out" whishlist.
- (Closes: #549967)
-
- -- Tiago Bortoletto Vaz <tiago at debian.org> Thu, 29 Sep 2011 00:41:10 -0300
-
-ffmpeg2theora (0.27-1) experimental; urgency=low
-
- * New upstream version
- * debian/control:
- - add myself as uploader
- - Standards-Version 3.8.4
-
- -- Tiago Bortoletto Vaz <tiago at debian.org> Tue, 22 Jun 2010 21:14:40 -0300
-
-ffmpeg2theora (0.24-2) unstable; urgency=low
-
- * debian/control: section changed (graphics -> video)
- * debian/control: fix Vcs-* fields
-
- -- RISKO Gergely <risko at debian.org> Fri, 20 Mar 2009 02:01:52 +0200
-
-ffmpeg2theora (0.24-1) unstable; urgency=low
-
- * New Upstream Version
- Closes: #510826, #404646, #418701, #420232, #461421, #517470
- * debian/rules:
- - removed simple-patchsys
- - removed autotools support
- - added scons support (with debian/cdbs/scons* files)
- * debian/control:
- - updated build-dependencies
- - Standards-Version 3.8.1
- - added Vcs-* fields
- * ffmpeg2theora.1:
- - adapting changes from Kapil, thanks
-
- -- RISKO Gergely <risko at debian.org> Fri, 20 Mar 2009 02:01:52 +0200
-
-ffmpeg2theora (0.21-0.1) unstable; urgency=low
-
- * Non-maintainer upload to fix RC bugs.
- * New upstream release (0.21).
- Closes: #484813, #482218, #487911.
- * debian/control:
- - added libavutil-dev, libavdevice-dev, libfaad-dev, libx11-dev,
- libxext-dev to dependencies.
- - added Homepage field
- - Standards-Version 3.8.0
- * debian/rules:
- - added cdbs simple-patchsys include.
- - added "as-needed" and "no-undefined" flags for linker
- to reduce dependencies.
- * debian/patches/01-fix_includes.patch: point the include
- directives in ffmpeg2theora.c to the correct directories.
- * debian/patches/02-fix_hyphen-used-as-minus_in_manpage.patch:
- replaced incorrect uses of hyphen as minus in ffmpeg2theora.1.
-
- -- Kapil Hari Paranjape <kapil at debian.org> Thu, 26 Jun 2008 06:47:53 +0530
-
-ffmpeg2theora (0.19-1) unstable; urgency=low
-
- * New upstream release (closes: #429937, #368588)
- * removed now unneeded libdc1394-dev dependecy (closes: #413663)
- * new build with new version of libavformat0d (closes: #430037)
- * added libswscale-dev new dependency
-
- -- RISKO Gergely <risko at debian.org> Sat, 28 Jul 2007 19:14:08 +0200
-
-ffmpeg2theora (0.16-2) unstable; urgency=low
-
- * added libgsm-dev and libdc1394-dev to build-depends (closes: #366025)
-
- -- RISKO Gergely <risko at debian.org> Tue, 30 May 2006 16:43:46 +0200
-
-ffmpeg2theora (0.16-1) unstable; urgency=low
-
- * New upstream release
- - fixes segfault when permission denied on output (closes: #352272)
- - fixes misleading error message for wrong input format (closes: #338872)
- * ftbfs fixed, i was silly when added -lgsm -ldc1394_control the day
- before yesterday (closes: #352547)
-
- -- RISKO Gergely <risko at debian.org> Mon, 13 Feb 2006 01:16:25 +0100
-
-ffmpeg2theora (0.15-1) unstable; urgency=low
-
- * New upstream release (closes: #335854)
- * '-ldc1394_control -lgsm' added to LDFLAGS in rules (closes: #333636)
- * changed FSF's postal address (thanks lintian!)
-
- -- RISKO Gergely <risko at debian.org> Sat, 11 Feb 2006 14:20:15 +0100
-
-ffmpeg2theora (0.13+svn20050704-1) unstable; urgency=low
-
- * initial upload (closes: #279503)
-
- -- RISKO Gergely <risko at debian.org> Mon, 4 Jul 2005 23:10:00 +0200
-
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7ed6ff8..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 59c9c30..0000000
--- a/debian/control
+++ /dev/null
@@ -1,20 +0,0 @@
-Source: ffmpeg2theora
-Section: video
-Priority: optional
-Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers at lists.alioth.debian.org>
-Uploaders: Tiago Bortoletto Vaz <tiago at debian.org>, RISKO Gergely <risko at debian.org>
-Vcs-Browser: http://anonscm.debian.org/git/pkg-multimedia/ffmpeg2theora.git
-Vcs-Git: git://anonscm.debian.org/git/pkg-multimedia/ffmpeg2theora.git
-Build-Depends: quilt, debhelper (>= 7.0.50~), libavcodec-dev (>= 4:0.6), libavutil-dev, libpostproc-dev (>= 4:0.6),
- libswscale-dev (>= 4:0.6), libavformat-dev (>= 4:0.6), libavdevice-dev (>= 4:0.6), libogg-dev, libvorbis-dev,
- libtheora-dev, scons, pkg-config, libkate-dev, liboggkate-dev, libavfilter-dev
-Homepage: http://v2v.cc/~j/ffmpeg2theora/
-Standards-Version: 3.9.4
-
-Package: ffmpeg2theora
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Theora video encoder using ffmpeg
- This package provides a command-line tool to encode/recode various
- video formats (basically everything that ffmpeg can read) into Theora,
- the free video codec.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 59957ac..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,31 +0,0 @@
-This package was debianized by RISKO Gergely <risko at debian.org> on
-Thu, 09 Jun 2005 15:55:02 +0200.
-
-It was downloaded from http://www.v2v.cc/~j/ffmpeg2theora/index.html
-
-Upstream Author: jan gerber <j at v2v.cc>
-
-Copyright as mentioned in ffmpeg2theora.c source file:
-/* -*- tab-width:4;c-file-style:"cc-mode"; -*- */
-/*
- * ffmpeg2theora.c -- Convert ffmpeg supported a/v files to Ogg Theora
- * Copyright (C) 2003-2004 <j at v2v.cc>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-You can find the mentioned GNU General Public License (GPL) (on a
-Debian system) in the file /usr/share/common-licenses/GPL.
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index 724e084..0000000
--- a/debian/docs
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-TODO
diff --git a/debian/patches/001-build-with-libav-0.7.patch b/debian/patches/001-build-with-libav-0.7.patch
deleted file mode 100644
index 8d2ab3b..0000000
--- a/debian/patches/001-build-with-libav-0.7.patch
+++ /dev/null
@@ -1,240 +0,0 @@
-diff -pruN 0.27-1.1/src/avinfo.c 0.27-1.1ubuntu1/src/avinfo.c
---- 0.27-1.1/src/avinfo.c 2010-06-23 01:07:49.000000000 +0100
-+++ 0.27-1.1ubuntu1/src/avinfo.c 2011-07-14 09:06:37.000000000 +0100
-@@ -196,7 +196,7 @@ void json_codec_info(FILE *output, AVCod
- }
-
- switch(enc->codec_type) {
-- case CODEC_TYPE_VIDEO:
-+ case AVMEDIA_TYPE_VIDEO:
- codec_name = fix_codec_name(codec_name);
- json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent);
- if (enc->pix_fmt != PIX_FMT_NONE) {
-@@ -224,7 +224,7 @@ void json_codec_info(FILE *output, AVCod
- json_add_key_value(output, "bitrate", &t, JSON_FLOAT, 0, indent);
- }
- break;
-- case CODEC_TYPE_AUDIO:
-+ case AVMEDIA_TYPE_AUDIO:
- codec_name = fix_codec_name(codec_name);
- json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent);
- if (enc->sample_rate) {
-@@ -277,15 +277,15 @@ void json_codec_info(FILE *output, AVCod
- }
- break;
- /*
-- case CODEC_TYPE_DATA:
-+ case AVMEDIA_TYPE_DATA:
- fprintf(output, "datacodec: %s\n", codec_name);
- bitrate = enc->bit_rate;
- break;
-- case CODEC_TYPE_SUBTITLE:
-+ case AVMEDIA_TYPE_SUBTITLE:
- fprintf(output, "subtitle: %s\n", codec_name);
- bitrate = enc->bit_rate;
- break;
-- case CODEC_TYPE_ATTACHMENT:
-+ case AVMEDIA_TYPE_ATTACHMENT:
- fprintf(output, "attachment: : %s\n", codec_name);
- bitrate = enc->bit_rate;
- break;
-@@ -330,7 +330,7 @@ static void json_stream_format(FILE *out
- display_aspect_ratio.num, display_aspect_ratio.den);
- json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent + 1);
- }
-- if(st->codec->codec_type == CODEC_TYPE_VIDEO){
-+ if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
- if (st->time_base.den && st->time_base.num && av_q2d(st->time_base) > 0.001) {
- snprintf(buf1, sizeof(buf1), "%d:%d",
- st->time_base.den, st->time_base.num);
-@@ -340,6 +340,20 @@ static void json_stream_format(FILE *out
- st->r_frame_rate.num, st->r_frame_rate.den);
- json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1);
- }
-+ if (st->sample_aspect_ratio.num && // default
-+ av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) {
-+ AVRational display_aspect_ratio;
-+ av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
-+ st->codec->width*st->sample_aspect_ratio.num,
-+ st->codec->height*st->sample_aspect_ratio.den,
-+ 1024*1024);
-+ snprintf(buf1, sizeof(buf1), "%d:%d",
-+ st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
-+ json_add_key_value(output, "pixel_aspect_ratio", buf1, JSON_STRING, 0, indent+1);
-+ snprintf(buf1, sizeof(buf1), "%d:%d",
-+ display_aspect_ratio.num, display_aspect_ratio.den);
-+ json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent+1);
-+ }
- }
- json_add_key_value(output, "id", &i, JSON_INT, 1, indent + 1);
- do_indent(output, indent-1);
-@@ -484,11 +498,11 @@ void json_format_info(FILE* output, AVFo
- int j, k;
- for(j=0; j<ic->nb_programs; j++) {
- for(k=0; k<ic->programs[j]->nb_stream_indexes; k++)
-- json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_VIDEO);
-+ json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_VIDEO);
- }
- } else {
- for(i=0;i<ic->nb_streams;i++) {
-- json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_VIDEO);
-+ json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_VIDEO);
- }
- }
- fprintf(output, "],\n");
-@@ -499,11 +513,11 @@ void json_format_info(FILE* output, AVFo
- int j, k;
- for(j=0; j<ic->nb_programs; j++) {
- for(k=0; k<ic->programs[j]->nb_stream_indexes; k++)
-- json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_AUDIO);
-+ json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_AUDIO);
- }
- } else {
- for(i=0;i<ic->nb_streams;i++) {
-- json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_AUDIO);
-+ json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_AUDIO);
- }
- }
- fprintf(output, "],\n");
-diff -pruN 0.27-1.1/src/ffmpeg2theora.c 0.27-1.1ubuntu1/src/ffmpeg2theora.c
---- 0.27-1.1/src/ffmpeg2theora.c 2010-06-23 01:07:49.000000000 +0100
-+++ 0.27-1.1ubuntu1/src/ffmpeg2theora.c 2011-07-14 09:06:37.000000000 +0100
-@@ -341,7 +341,7 @@ static void prepare_ycbcr_buffer(ff2theo
- static const char *find_category_for_subtitle_stream (ff2theora this, int idx, int included_subtitles)
- {
- AVCodecContext *enc = this->context->streams[idx]->codec;
-- if (enc->codec_type != CODEC_TYPE_SUBTITLE) return 0;
-+ if (enc->codec_type != AVMEDIA_TYPE_SUBTITLE) return 0;
- switch (enc->codec_id) {
- case CODEC_ID_TEXT:
- case CODEC_ID_SSA:
-@@ -500,9 +500,11 @@ static void extra_info_from_ssa(AVPacket
-
- static const char *find_language_for_subtitle_stream(const AVStream *s)
- {
-- const char *lang=find_iso639_1(s->language);
-+ AVMetadataTag *language = av_metadata_get(s->metadata, "language", NULL, 0);
-+ const char *lang=find_iso639_1(language->value);
- if (!lang) {
-- fprintf(stderr,"WARNING - unrecognized ISO 639-2 language code: %s\n",s->language);
-+ fprintf(stderr, "WARNING - unrecognized ISO 639-2 language code: %s\n",
-+ language->value);
- }
- return lang;
- }
-@@ -516,8 +518,8 @@ void ff2theora_output(ff2theora this) {
- AVStream *vstream = NULL;
- AVCodec *acodec = NULL;
- AVCodec *vcodec = NULL;
-- pp_mode_t *ppMode = NULL;
-- pp_context_t *ppContext = NULL;
-+ pp_mode *ppMode = NULL;
-+ pp_context *ppContext = NULL;
- int sws_flags;
- float frame_aspect = 0;
- double fps = 0.0;
-@@ -530,7 +532,7 @@ void ff2theora_output(ff2theora this) {
-
- if (this->audiostream >= 0 && this->context->nb_streams > this->audiostream) {
- AVCodecContext *enc = this->context->streams[this->audiostream]->codec;
-- if (enc->codec_type == CODEC_TYPE_AUDIO) {
-+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
- this->audio_index = this->audiostream;
- fprintf(stderr, " Using stream #0.%d as audio input\n",this->audio_index);
- }
-@@ -540,7 +542,7 @@ void ff2theora_output(ff2theora this) {
- }
- if (this->videostream >= 0 && this->context->nb_streams > this->videostream) {
- AVCodecContext *enc = this->context->streams[this->videostream]->codec;
-- if (enc->codec_type == CODEC_TYPE_VIDEO) {
-+ if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
- this->video_index = this->videostream;
- fprintf(stderr, " Using stream #0.%d as video input\n",this->video_index);
- }
-@@ -552,11 +554,11 @@ void ff2theora_output(ff2theora this) {
- for (i = 0; i < this->context->nb_streams; i++) {
- AVCodecContext *enc = this->context->streams[i]->codec;
- switch (enc->codec_type) {
-- case CODEC_TYPE_VIDEO:
-+ case AVMEDIA_TYPE_VIDEO:
- if (this->video_index < 0 && !this->disable_video)
- this->video_index = i;
- break;
-- case CODEC_TYPE_AUDIO:
-+ case AVMEDIA_TYPE_AUDIO:
- if (this->audio_index < 0 && !this->disable_audio)
- this->audio_index = i;
- break;
-@@ -980,7 +982,7 @@ void ff2theora_output(ff2theora this) {
- AVStream *stream = this->context->streams[i];
- AVCodecContext *enc = stream->codec;
- const char *category;
-- if (enc->codec_type == CODEC_TYPE_SUBTITLE) {
-+ if (enc->codec_type == AVMEDIA_TYPE_SUBTITLE) {
- AVCodec *codec = avcodec_find_decoder (enc->codec_id);
- if (codec && avcodec_open (enc, codec) >= 0) {
- subtitles_opened[i] = 1;
-@@ -1451,9 +1453,11 @@ void ff2theora_output(ff2theora this) {
- }
- if (this->sws_scale_ctx) {
- sws_scale(this->sws_scale_ctx,
-- output_cropped->data, output_cropped->linesize, 0,
-- display_height - (this->frame_topBand + this->frame_bottomBand),
-- output_resized->data, output_resized->linesize);
-+ output_cropped->data,
-+ output_cropped->linesize, 0,
-+ display_height - (this->frame_topBand + this->frame_bottomBand),
-+ output_resized->data,
-+ output_resized->linesize);
- }
- else{
- output_resized = output_cropped;
-@@ -1512,7 +1516,7 @@ void ff2theora_output(ff2theora this) {
- int samples=0;
- int samples_out=0;
- int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE;
-- int bytes_per_sample = av_get_bits_per_sample_format(aenc->sample_fmt)/8;
-+ int bytes_per_sample = av_get_bits_per_sample_fmt(aenc->sample_fmt)/8;
-
- if (avpkt.size > 0) {
- len1 = avcodec_decode_audio3(astream->codec, audio_buf, &data_size, &avpkt);
-@@ -2726,8 +2730,7 @@ int main(int argc, char **argv) {
-
- for(info.passno=(info.twopass==3?1:info.twopass);info.passno<=(info.twopass==3?2:info.twopass);info.passno++){
- //detect image sequences and set framerate if provided
-- if (av_guess_image2_codec(inputfile_name) != CODEC_ID_NONE || \
-- (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0)) {
-+ if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) {
- formatParams = ¶ms;
- memset(formatParams, 0, sizeof(*formatParams));
- if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) {
-@@ -2748,7 +2751,6 @@ int main(int argc, char **argv) {
- formatParams->time_base.den = convert->framerate_new.num;
- formatParams->time_base.num = convert->framerate_new.den;
- }
-- formatParams->video_codec_id = av_guess_image2_codec(inputfile_name);
- }
- if (av_open_input_file(&convert->context, inputfile_name, input_fmt, 0, formatParams) >= 0) {
- if (av_find_stream_info(convert->context) >= 0) {
-@@ -2760,9 +2762,9 @@ int main(int argc, char **argv) {
- for (i = 0; i < convert->context->nb_streams; i++) {
- AVCodecContext *enc = convert->context->streams[i]->codec;
- switch (enc->codec_type) {
-- case CODEC_TYPE_VIDEO: has_video = 1; break;
-- case CODEC_TYPE_AUDIO: has_audio = 1; break;
-- case CODEC_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break;
-+ case AVMEDIA_TYPE_VIDEO: has_video = 1; break;
-+ case AVMEDIA_TYPE_AUDIO: has_audio = 1; break;
-+ case AVMEDIA_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break;
- default: break;
- }
- }
-@@ -2828,7 +2830,7 @@ int main(int argc, char **argv) {
-
- if (!info.frontend) {
- if (info.twopass!=3 || info.passno==1) {
-- dump_format(convert->context, 0,inputfile_name, 0);
-+ av_dump_format(convert->context, 0,inputfile_name, 0);
- }
- }
- if (convert->disable_audio) {
diff --git a/debian/patches/002-Makefile.patch b/debian/patches/002-Makefile.patch
deleted file mode 100644
index cbcdbbf..0000000
--- a/debian/patches/002-Makefile.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ffmpeg2theora-0.27.orig/Makefile
-+++ ffmpeg2theora-0.27/Makefile
-@@ -5,7 +5,7 @@ clean:
- scons -c
-
- install:
-- scons install $(PREFIX)
-+ scons install destdir=$(CURDIR)/debian/ffmpeg2theora prefix=/usr mandir=$(CURDIR)/debian/ffmpeg2theora/usr/share/man
-
- dist:
- svn export . ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2`
diff --git a/debian/patches/003-libswresample.patch b/debian/patches/003-libswresample.patch
deleted file mode 100644
index 5bc6087..0000000
--- a/debian/patches/003-libswresample.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/SConstruct
-+++ b/SConstruct
-@@ -151,7 +151,6 @@
- "libavcodec >= 52.30.0",
- "libpostproc",
- "libswscale",
-- "libswresample",
- "libavutil",
- ]
- if os.path.exists("./ffmpeg"):
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index b0f0ba0..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,3 +0,0 @@
-#001-build-with-libav-0.7.patch
-002-Makefile.patch
-003-libswresample.patch
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index c3702b7..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/make -f
-
-#DEB_SCONS_OPTIONS := prefix=/usr destdir=$(DEB_DESTDIR) mandir=PREFIX/share/man
-
-#PREFIX="prefix=$(CURDIR)/debian/ffmpeg2theora/usr destdir=$(CURDIR)/debian/ffmpeg2theora mandir=$(CURDIR)/debian/usr/share/man"
-
-%:
- dh $@ --with quilt
-
-#override_dh_auto_build:
-# scons
-#
-#override_dh_auto_install:
-# PREFIX="destdir=$(CURDIR)/debian/ffmpeg2theora prefix=/usr mandir=$(CURDIR)/debian/usr/share/man"; make install
-
-override_dh_auto_clean:
- dh_auto_clean
- rm -rf .sconf_temp/ .sconsign.dblite config.log
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/source/local-options b/debian/source/local-options
deleted file mode 100644
index 4aceb10..0000000
--- a/debian/source/local-options
+++ /dev/null
@@ -1 +0,0 @@
-unapply-patches
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 414b3a5..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-# watch control file for uscan
-version=2
-http://www.v2v.cc/~j/ffmpeg2theora/download.html ffmpeg2theora-([\d\.]*)\.tar\.bz2
diff --git a/ffmpeg2theora.pmdoc/01ffmpeg.xml b/ffmpeg2theora.pmdoc/01ffmpeg.xml
index 15265b0..5d702c0 100644
--- a/ffmpeg2theora.pmdoc/01ffmpeg.xml
+++ b/ffmpeg2theora.pmdoc/01ffmpeg.xml
@@ -1 +1 @@
-<pkgref spec="1.12" uuid="01291888-CCA4-41A5-AAB3-BC2E3CFE6477"><config><identifier>cc.v2v.ffmpeg2theora</identifier><version>0.28</version><description/><post-install type="none"/><requireAuthorization/><installFrom mod="true">/tmp/ffmpeg2theora/</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>installTo.isRelativeType</mod><mod>installTo</mod><mod>installTo.isAbsoluteType</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod></config><contents><file-list>01ffmpeg-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass</filter></contents></pkgref>
\ No newline at end of file
+<pkgref spec="1.12" uuid="01291888-CCA4-41A5-AAB3-BC2E3CFE6477"><config><identifier>cc.v2v.ffmpeg2theora</identifier><version>0.29</version><description></description><post-install type="none"/><requireAuthorization/><installFrom mod="true">/tmp/ffmpeg2theora/</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.isRelativeType</mod><mod>installTo</mod><mod>installFrom.path</mod><mod>installTo.isAbsoluteType</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod></config><contents><file-list>01ffmpeg-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass</filter></contents></pkgref>
\ No newline at end of file
diff --git a/ffmpeg2theora.pmdoc/index.xml b/ffmpeg2theora.pmdoc/index.xml
index 998a144..678d095 100644
--- a/ffmpeg2theora.pmdoc/index.xml
+++ b/ffmpeg2theora.pmdoc/index.xml
@@ -1 +1 @@
-<pkmkdoc spec="1.12"><properties><title>ffmpeg2theora</title><build>/Users/build/ffmpeg2theora-0.28.pkg</build><organization>org.xiph</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Commandline tool to encode video in Ogg Theora</description><contents><choice title="ffmpeg2theora" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="cc.v2v.ffmpeg2theora"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01ffmpeg.xml</item></pkmkdoc>
+<pkmkdoc spec="1.12"><properties><title>ffmpeg2theora</title><build>/Users/build/ffmpeg2theora-0.29.pkg</build><organization>org.xiph</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Commandline tool to encode video in Ogg Theora</description><contents><choice title="ffmpeg2theora" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="cc.v2v.ffmpeg2theora"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01ffmpeg.xml</item></pkmkdoc>
diff --git a/src/avinfo.c b/src/avinfo.c
index c950d96..aa74f07 100644
--- a/src/avinfo.c
+++ b/src/avinfo.c
@@ -462,6 +462,8 @@ void json_oshash(FILE *output, char const *filename, int indent) {
char hash[32];
#ifdef WIN32
sprintf(hash,"%016I64x", gen_oshash(filename));
+#elif defined (__SVR4) && defined (__sun)
+ sprintf(hash,"%016llx", gen_oshash(filename));
#else
sprintf(hash,"%016qx", gen_oshash(filename));
#endif
diff --git a/src/ffmpeg2theora.c b/src/ffmpeg2theora.c
index 63836bc..9e7ffe2 100644
--- a/src/ffmpeg2theora.c
+++ b/src/ffmpeg2theora.c
@@ -33,6 +33,11 @@
#include "libswscale/swscale.h"
#include "libpostproc/postprocess.h"
+#include "libavutil/opt.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/samplefmt.h"
+#include "libswresample_compat.h"
+
#include "theora/theoraenc.h"
#include "vorbis/codec.h"
#include "vorbis/vorbisenc.h"
@@ -47,6 +52,9 @@
#include "ffmpeg2theora.h"
#include "avinfo.h"
+#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
+
+
#define LENGTH(x) (sizeof(x) / sizeof(*x))
enum {
@@ -534,6 +542,11 @@ void ff2theora_output(ff2theora this) {
int synced = this->start_time == 0.0;
AVRational display_aspect_ratio, sample_aspect_ratio;
+ struct SwrContext *swr_ctx;
+ uint8_t **dst_audio_data = NULL;
+ int dst_linesize;
+ int src_nb_samples = 1024, dst_nb_samples, max_dst_nb_samples;
+
if (this->audiostream >= 0 && this->context->nb_streams > this->audiostream) {
AVCodecContext *enc = this->context->streams[this->audiostream]->codec;
if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
@@ -595,6 +608,7 @@ void ff2theora_output(ff2theora this) {
}
this->fps = fps = av_q2d(vstream_fps);
+ venc->thread_count = 1;
if (vcodec == NULL || avcodec_open2 (venc, vcodec, NULL) < 0) {
this->video_index = -1;
}
@@ -954,26 +968,47 @@ void ff2theora_output(ff2theora this) {
if (this->channels > aenc->channels)
this->channels = aenc->channels;
}
-
+ aenc->thread_count = 1;
if (acodec != NULL && avcodec_open2 (aenc, acodec, NULL) >= 0) {
if (this->sample_rate != sample_rate
|| this->channels != aenc->channels
- || aenc->sample_fmt != AV_SAMPLE_FMT_S16) {
- // values take from libavcodec/resample.c
- this->audio_resample_ctx = av_audio_resample_init(this->channels, aenc->channels,
- this->sample_rate, sample_rate,
- AV_SAMPLE_FMT_S16, aenc->sample_fmt,
- 16, 10, 0, 0.8);
- if (!this->audio_resample_ctx) {
- this->channels = aenc->channels;
+ || aenc->sample_fmt != AV_SAMPLE_FMT_FLTP) {
+ swr_ctx = swr_alloc();
+ /* set options */
+ if (aenc->channel_layout) {
+ av_opt_set_int(swr_ctx, "in_channel_layout", aenc->channel_layout, 0);
+ } else {
+ av_opt_set_int(swr_ctx, "in_channel_layout", av_get_default_channel_layout(aenc->channels), 0);
+ }
+ av_opt_set_int(swr_ctx, "in_sample_rate", aenc->sample_rate, 0);
+ av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", aenc->sample_fmt, 0);
+
+ av_opt_set_int(swr_ctx, "out_channel_layout", av_get_default_channel_layout(this->channels), 0);
+ av_opt_set_int(swr_ctx, "out_sample_rate", this->sample_rate, 0);
+ av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
+
+ /* initialize the resampling context */
+ if (swr_init(swr_ctx) < 0) {
+ fprintf(stderr, "Failed to initialize the resampling context\n");
+ exit(1);
+ }
+
+ max_dst_nb_samples = dst_nb_samples =
+ av_rescale_rnd(src_nb_samples, this->sample_rate, sample_rate, AV_ROUND_UP);
+
+ if (av_samples_alloc_array_and_samples(&dst_audio_data, &dst_linesize, this->channels,
+ dst_nb_samples, AV_SAMPLE_FMT_FLTP, 0) < 0) {
+ fprintf(stderr, "Could not allocate destination samples\n");
+ exit(1);
}
+
if (!info.frontend && this->sample_rate!=sample_rate)
fprintf(stderr, " Resample: %dHz => %dHz\n", sample_rate,this->sample_rate);
if (!info.frontend && this->channels!=aenc->channels)
fprintf(stderr, " Channels: %d => %d\n",aenc->channels,this->channels);
}
else{
- this->audio_resample_ctx=NULL;
+ swr_ctx = NULL;
}
}
else{
@@ -1064,13 +1099,12 @@ void ff2theora_output(ff2theora this) {
AVPacket pkt;
AVPacket avpkt;
int len1;
- int got_picture;
+ int got_frame;
int first = 1;
int audio_eos = 0, video_eos = 0, audio_done = 0, video_done = 0;
int ret;
- int16_t *audio_buf=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
- int16_t *resampled=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
- int16_t *audio_p=NULL;
+ AVFrame *audio_frame = NULL;
+ uint8_t **audio_p = NULL;
int no_frames;
int no_samples;
@@ -1366,7 +1400,7 @@ void ff2theora_output(ff2theora this) {
first frame decodec in case its not a keyframe
*/
if (pkt.stream_index == this->video_index) {
- avcodec_decode_video2(venc, frame, &got_picture, &pkt);
+ avcodec_decode_video2(venc, frame, &got_frame, &pkt);
}
av_free_packet (&pkt);
continue;
@@ -1385,9 +1419,9 @@ void ff2theora_output(ff2theora this) {
while(video_eos || avpkt.size > 0) {
int dups = 0;
static th_ycbcr_buffer ycbcr;
- len1 = avcodec_decode_video2(venc, frame, &got_picture, &avpkt);
+ len1 = avcodec_decode_video2(venc, frame, &got_frame, &avpkt);
if (len1>=0) {
- if (got_picture) {
+ if (got_frame) {
// this is disabled by default since it does not work
// for all input formats the way it should.
if (this->sync == 1 && pkt.dts != AV_NOPTS_VALUE) {
@@ -1424,7 +1458,7 @@ void ff2theora_output(ff2theora this) {
if (venc_pix_fmt != this->pix_fmt) {
sws_scale(this->sws_colorspace_ctx,
- frame->data, frame->linesize, 0, display_height,
+ (const uint8_t * const*)frame->data, frame->linesize, 0, display_height,
output_tmp->data, output_tmp->linesize);
}
else{
@@ -1468,7 +1502,7 @@ void ff2theora_output(ff2theora this) {
}
if (this->sws_scale_ctx) {
sws_scale(this->sws_scale_ctx,
- output_cropped->data,
+ (const uint8_t * const*)output_cropped->data,
output_cropped->linesize, 0,
display_height - (this->frame_topBand + this->frame_bottomBand),
output_resized->data,
@@ -1496,7 +1530,7 @@ void ff2theora_output(ff2theora this) {
//now output_resized
if (!first) {
- if (got_picture || video_eos) {
+ if (got_frame || video_eos) {
prepare_ycbcr_buffer(this, ycbcr, output_buffered);
if(dups>0) {
//this only works if dups < keyint,
@@ -1516,11 +1550,11 @@ void ff2theora_output(ff2theora this) {
info.videotime = this->frame_count / av_q2d(this->framerate);
}
}
- if (got_picture) {
+ if (got_frame) {
first=0;
av_picture_copy((AVPicture *)output_buffered, (AVPicture *)output_padded, this->pix_fmt, this->frame_width, this->frame_height);
}
- if (!got_picture) {
+ if (!got_frame) {
break;
}
}
@@ -1528,42 +1562,62 @@ void ff2theora_output(ff2theora this) {
if (info.passno!=1)
if ((audio_eos && !audio_done) || (ret >= 0 && pkt.stream_index == this->audio_index)) {
while((audio_eos && !audio_done) || avpkt.size > 0 ) {
- int samples=0;
- int samples_out=0;
- int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE;
int bytes_per_sample = av_get_bytes_per_sample(aenc->sample_fmt);
if (avpkt.size > 0) {
- len1 = avcodec_decode_audio3(astream->codec, audio_buf, &data_size, &avpkt);
+ if (!audio_frame && !(audio_frame = avcodec_alloc_frame())) {
+ fprintf(stderr, "Failed to allocate memory\n");
+ exit(1);
+ }
+ len1 = avcodec_decode_audio4(astream->codec, audio_frame, &got_frame, &avpkt);
if (len1 < 0) {
/* if error, we skip the frame */
break;
}
- avpkt.size -= len1;
- avpkt.data += len1;
- if (data_size >0) {
- samples = data_size / (aenc->channels * bytes_per_sample);
- samples_out = samples;
- if (this->audio_resample_ctx) {
- samples_out = audio_resample(this->audio_resample_ctx, resampled, audio_buf, samples);
- audio_p = resampled;
+ /* Some audio decoders decode only part of the packet, and have to be
+ * called again with the remainder of the packet data.
+ * Sample: http://fate-suite.libav.org/lossless-audio/luckynight-partial.shn
+ * Also, some decoders might over-read the packet. */
+ len1 = FFMIN(len1, avpkt.size);
+ if (got_frame) {
+ dst_nb_samples = audio_frame->nb_samples;
+ if (swr_ctx) {
+ dst_nb_samples = av_rescale_rnd(audio_frame->nb_samples,
+ this->sample_rate, aenc->sample_rate, AV_ROUND_UP);
+ if (dst_nb_samples > max_dst_nb_samples) {
+ av_free(dst_audio_data[0]);
+ if (av_samples_alloc(dst_audio_data, &dst_linesize, this->channels,
+ dst_nb_samples, AV_SAMPLE_FMT_FLTP, 1) < 0) {
+ fprintf(stderr, "Error while converting audio\n");
+ exit(1);
+ }
+ max_dst_nb_samples = dst_nb_samples;
+ }
+ if (swr_convert(swr_ctx, dst_audio_data, dst_nb_samples,
+ (const uint8_t**)audio_frame->extended_data, audio_frame->nb_samples) < 0) {
+ fprintf(stderr, "Error while converting audio\n");
+ exit(1);
+ }
+ audio_p = dst_audio_data;
+ } else {
+ audio_p = audio_frame->extended_data;
}
- else
- audio_p = audio_buf;
}
+ avpkt.size -= len1;
+ avpkt.data += len1;
}
-
- if (no_samples > 0 && this->sample_count + samples_out > no_samples) {
- audio_eos = 1;
- samples_out = no_samples - this->sample_count;
- if (samples_out <= 0) {
- break;
+ if(got_frame || audio_eos) {
+ if (no_samples > 0 && this->sample_count + dst_nb_samples > no_samples) {
+ audio_eos = 1;
+ dst_nb_samples = no_samples - this->sample_count;
+ if (dst_nb_samples <= 0) {
+ break;
+ }
}
+ oggmux_add_audio(&info, audio_p, dst_nb_samples, audio_eos);
+ avcodec_free_frame(&audio_frame);
+ this->sample_count += dst_nb_samples;
}
-
- oggmux_add_audio(&info, audio_p,
- samples_out * (this->channels), samples_out, audio_eos);
- this->sample_count += samples_out;
if(audio_eos) {
audio_done = 1;
}
@@ -1748,8 +1802,8 @@ void ff2theora_output(ff2theora this) {
avcodec_close(venc);
}
if (this->audio_index >= 0) {
- if (this->audio_resample_ctx)
- audio_resample_close(this->audio_resample_ctx);
+ if (swr_ctx)
+ swr_free(&swr_ctx);
avcodec_close(aenc);
}
@@ -1770,8 +1824,12 @@ void ff2theora_output(ff2theora this) {
frame_dealloc(output_cropped_p);
frame_dealloc(output_padded_p);
}
- av_free(audio_buf);
- av_free(resampled);
+ if (dst_audio_data)
+ av_freep(&dst_audio_data[0]);
+ av_freep(&dst_audio_data);
+ if(swr_ctx) {
+ swr_close(swr_ctx);
+ }
}
else{
fprintf(stderr, "No video or audio stream found.\n");
@@ -2769,6 +2827,9 @@ int main(int argc, char **argv) {
outputfile_set=1;
}
optind++;
+ } else {
+ fprintf(stderr, "ERROR: no input specified\n");
+ exit(1);
}
if(optind<argc) {
fprintf(stderr, "WARNING: Only one input file supported, others will be ignored\n");
diff --git a/src/ffmpeg2theora.h b/src/ffmpeg2theora.h
index ddb3c56..82c75ae 100644
--- a/src/ffmpeg2theora.h
+++ b/src/ffmpeg2theora.h
@@ -62,7 +62,6 @@ typedef struct ff2theora{
double fps;
struct SwsContext *sws_colorspace_ctx; /* for image resampling/resizing */
struct SwsContext *sws_scale_ctx; /* for image resampling/resizing */
- ReSampleContext *audio_resample_ctx;
ogg_int32_t aspect_numerator;
ogg_int32_t aspect_denominator;
int colorspace;
diff --git a/src/libswresample_compat.h b/src/libswresample_compat.h
new file mode 100644
index 0000000..fe23292
--- /dev/null
+++ b/src/libswresample_compat.h
@@ -0,0 +1,23 @@
+// This header serves to smooth out the differences in FFmpeg and LibAV.
+
+#ifdef USE_SWRESAMPLE
+
+ #include <libswresample/swresample.h>
+
+ //swr does not have the equivalent so this does nothing
+ void swr_close(SwrContext *ctx) {};
+
+#else
+
+ #include <libavresample/avresample.h>
+
+ #define SwrContext AVAudioResampleContext
+ #define swr_init(ctx) avresample_open(ctx)
+ #define swr_close(ctx) avresample_close(ctx)
+ #define swr_free(ctx) avresample_free(ctx)
+ #define swr_alloc() avresample_alloc_context()
+ #define swr_get_delay(ctx, ...) avresample_get_delay(ctx)
+ #define swr_convert(ctx, out, out_count, in, in_count) \
+ avresample_convert(ctx, out, 0, out_count, (uint8_t **)in, 0, in_count)
+
+#endif
diff --git a/src/theorautils.c b/src/theorautils.c
index 1307704..52995bd 100644
--- a/src/theorautils.c
+++ b/src/theorautils.c
@@ -1219,17 +1219,16 @@ vorbis_time(vorbis_dsp_state * dsp, ogg_int64_t granulepos) {
/**
* adds audio samples to encoding sink
* @param buffer pointer to buffer
- * @param bytes bytes in buffer
* @param samples samples in buffer
* @param e_o_s 1 indicates end of stream.
*/
-void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int samples, int e_o_s) {
+void oggmux_add_audio (oggmux_info *info, uint8_t **buffer, int samples, int e_o_s) {
ogg_packet op;
int i, j, k, count = 0;
float **vorbis_buffer;
- if (bytes <= 0 && samples <= 0) {
+ if (samples <= 0) {
/* end of audio stream */
if (e_o_s)
vorbis_analysis_wrote (&info->vd, 0);
@@ -1252,7 +1251,7 @@ void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int sampl
default: k = j;
}
}
- vorbis_buffer[k][i] = buffer[count++] / 32768.f;
+ vorbis_buffer[k][i] = ((const float *)buffer[j])[i];
}
}
vorbis_analysis_wrote (&info->vd, samples);
@@ -1291,8 +1290,8 @@ void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int sampl
if (op.packetno != 4) {
/* We only expect negative start granule in the first content
packet, not any of the others... */
- fprintf(stderr, "WARNING: vorbis packet %lld has calculated start"
- " granule of %lld, but it should be non-negative!",
+ fprintf(stderr, "WARNING: vorbis packet %" PRId64 " has calculated start"
+ " granule of %" PRId64 ", but it should be non-negative!",
op.packetno, start_granule);
}
start_granule = 0;
@@ -1302,7 +1301,7 @@ void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int sampl
allowed by the specification in the last packet only, and the
trailing samples should be discarded and not played/indexed. */
if (!op.e_o_s) {
- fprintf(stderr, "WARNING: vorbis packet %lld (granulepos %lld) starts before"
+ fprintf(stderr, "WARNING: vorbis packet %" PRId64 " (granulepos %" PRId64 ") starts before"
" the end of the preceeding packet!", op.packetno, op.granulepos);
}
start_granule = info->vorbis_granulepos;
diff --git a/src/theorautils.h b/src/theorautils.h
index 04b6675..12fb9d2 100644
--- a/src/theorautils.h
+++ b/src/theorautils.h
@@ -168,7 +168,7 @@ void init_info(oggmux_info *info);
extern void oggmux_setup_kate_streams(oggmux_info *info, int n_kate_streams);
extern void oggmux_init (oggmux_info *info);
extern void oggmux_add_video (oggmux_info *info, th_ycbcr_buffer ycbcr, int e_o_s);
-extern void oggmux_add_audio (oggmux_info *info, int16_t * readbuffer, int bytesread, int samplesread,int e_o_s);
+extern void oggmux_add_audio (oggmux_info *info, uint8_t **buffer, int samples,int e_o_s);
#ifdef HAVE_KATE
extern void oggmux_add_kate_text (oggmux_info *info, int idx, double t0, double t1, const char *text, size_t len, int x1, int x2, int y1, int y2);
extern void oggmux_add_kate_image (oggmux_info *info, int idx, double t0, double t1, const kate_region *kr, const kate_palette *kp, const kate_bitmap *kb);
diff --git a/version.sh b/version.sh
index a236bee..c972c6f 100755
--- a/version.sh
+++ b/version.sh
@@ -1,11 +1,8 @@
#!/bin/bash
cd `dirname $0`
version='0.29'
-test -e .svn && svnversion=`which svnversion`
-echo -n $version
-if [ "x$svnversion" != "x" ]; then
- echo -n "+svn"
- svnversion
-else
- echo
+test -e .git && git=`which git`
+if [ "x$git" != "x" ]; then
+ version=$(cd "$1" && git describe --tags 2> /dev/null)
fi
+echo $version
--
ffmpeg2theora packaging
More information about the pkg-multimedia-commits
mailing list