Re: [FFmpeg-cvslog] Merge commit '76729970049fe95659346503f7401a5d869f9959'

2016-07-20 Thread Robert Krüger
On Wed, Jul 13, 2016 at 4:55 PM, Matthieu Bouron  wrote:

> ffmpeg | branch: master | Matthieu Bouron 
> | Wed Jul 13 16:34:39 2016 +0200|
> [3c058f570128dcfa3a68f0860e2be7f098e8d6e1] | committer: Matthieu Bouron
>
> Merge commit '76729970049fe95659346503f7401a5d869f9959'
>
> * commit '76729970049fe95659346503f7401a5d869f9959':
>   mov: Implement support for multiple sample description tables
>
> Notes:
>   * The sc->stsc_data[index].id checks have been moved from the
> mov_read_stsc
>   to mov_read_packet before the value is used in mov_change_extradata to
>   not break playback of samples with broken stsc entries (see sample of
>   ticket #1918).
>
>   * sc->stsc_index is now checked against sc->stsc_count - 1 before it
>   is incremented so it remains lesser than sc->stsc_count. Fixes a crash
>   with:
>
>   ./ffmpeg -i matrixbench_mpeg2.mpg -t 1 -frag_duration 200k test.mov
>   ./ffprobe -show_packets test.mov
>
> Merged-by: Matthieu Bouron 
>
> >
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c058f570128dcfa3a68f0860e2be7f098e8d6e1
> ---
>
>  libavformat/isom.h |8 
>  libavformat/mov.c  |  123
> +---
>  2 files changed, 125 insertions(+), 6 deletions(-)
>
> diff --git a/libavformat/isom.h b/libavformat/isom.h
> index 726f350..df6c15a 100644
> --- a/libavformat/isom.h
> +++ b/libavformat/isom.h
> @@ -128,6 +128,8 @@ typedef struct MOVStreamContext {
>  MOVStts *ctts_data;
>  unsigned int stsc_count;
>  MOVStsc *stsc_data;
> +int stsc_index;
> +int stsc_sample;
>  unsigned int stps_count;
>  unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
>  MOVElst *elst_data;
> @@ -169,6 +171,12 @@ typedef struct MOVStreamContext {
>  int nb_frames_for_fps;
>  int64_t duration_for_fps;
>
> +/** extradata array (and size) for multiple stsd */
> +uint8_t **extradata;
> +int *extradata_size;
> +int last_stsd_index;
> +int stsd_count;
> +
>  int32_t *display_matrix;
>  uint32_t format;
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 485bb0b..756d0e8 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -2215,8 +2215,7 @@ static int mov_skip_multiple_stsd(MOVContext *c,
> AVIOContext *pb,
>  avio_skip(pb, size);
>  return 1;
>  }
> -if ( codec_tag == AV_RL32("avc1") ||
> - codec_tag == AV_RL32("hvc1") ||
> +if ( codec_tag == AV_RL32("hvc1") ||
>   codec_tag == AV_RL32("hev1")
>  )
>  av_log(c->fc, AV_LOG_WARNING, "Concatenated H.264 or H.265 might
> not play correctly.\n");
> @@ -2294,6 +2293,19 @@ int ff_mov_read_stsd_entries(MOVContext *c,
> AVIOContext *pb, int entries)
>  return ret;
>  } else if (a.size > 0)
>  avio_skip(pb, a.size);
> +
> +if (sc->extradata) {
> +int extra_size = st->codecpar->extradata_size;
> +
> +/* Move the current stream extradata to the stream context
> one. */
> +sc->extradata_size[pseudo_stream_id] = extra_size;
> +sc->extradata[pseudo_stream_id] = av_malloc(extra_size +
> AV_INPUT_BUFFER_PADDING_SIZE);
> +if (!sc->extradata[pseudo_stream_id])
> +return AVERROR(ENOMEM);
> +memcpy(sc->extradata[pseudo_stream_id],
> st->codecpar->extradata, extra_size);
> +av_freep(&st->codecpar->extradata);
> +st->codecpar->extradata_size = 0;
> +}
>  }
>
>  if (pb->eof_reached)
> @@ -2304,13 +2316,41 @@ int ff_mov_read_stsd_entries(MOVContext *c,
> AVIOContext *pb, int entries)
>
>  static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>  {
> -int entries;
> +AVStream *st;
> +MOVStreamContext *sc;
> +int ret;
> +
> +if (c->fc->nb_streams < 1)
> +return 0;
> +st = c->fc->streams[c->fc->nb_streams - 1];
> +sc = st->priv_data;
>
>  avio_r8(pb); /* version */
>  avio_rb24(pb); /* flags */
> -entries = avio_rb32(pb);
> +sc->stsd_count = avio_rb32(pb); /* entries */
> +
> +/* Prepare space for hosting multiple extradata. */
> +sc->extradata = av_mallocz_array(sc->stsd_count,
> sizeof(*sc->extradata));
> +if (!sc->extradata)
> +return AVERROR(ENOMEM);
> +
> +sc->extradata_size = av_mallocz_array(sc->stsd_count,
> sizeof(sc->extradata_size));
> +if (!sc->extradata_size)
> +return AVERROR(ENOMEM);
> +
> +ret = ff_mov_read_stsd_entries(c, pb, sc->stsd_count);
> +if (ret < 0)
> +return ret;
> +
> +/* Restore back the primary extradata. */
> +av_free(st->codecpar->extradata);
> +st->codecpar->extradata_size = sc->extradata_size[0];
> +st->codecpar->extradata = av_mallocz(sc->extradata_size[0] +
> AV_INPUT_BUFFER_PADDING_SIZE);
> +if (!st->codecpar->extradata)
> +return AVERROR(ENOMEM);
> +memcpy(st->codecpar->extradata, sc->extradata[0],
> sc->extradata_size[0]);
>
> -

[FFmpeg-cvslog] ffmpeg_opt: Delete duplicate “hwaccel_output_format” option.

2016-07-20 Thread Jun Zhao
ffmpeg | branch: master | Jun Zhao  | Fri Jun 24 15:06:08 
2016 +0800| [a06acfff76caf1eabc5e4fc6595905cdb5cb7045] | committer: Michael 
Niedermayer

ffmpeg_opt: Delete duplicate “hwaccel_output_format” option.

Delete duplicate “hwaccel_output_format” option.

Signed-off-by: Jun Zhao 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a06acfff76caf1eabc5e4fc6595905cdb5cb7045
---

 ffmpeg_opt.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 7785a30..68bd090 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -3384,9 +3384,6 @@ const OptionDef options[] = {
 { "hwaccel_output_format", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
   OPT_SPEC | OPT_INPUT,
  { .off = OFFSET(hwaccel_output_formats) },
 "select output format used with HW accelerated decoding", "format" },
-{ "hwaccel_output_format", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
-  OPT_SPEC | OPT_INPUT,
  { .off = OFFSET(hwaccel_output_formats) },
-"select output format used with HW accelerated decoding", "format" },
 #if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
 { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { 
&videotoolbox_pixfmt}, "" },
 #endif

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libavcodec/dnxhd: add dnxhr profiles

2016-07-20 Thread Mark Reid
ffmpeg | branch: master | Mark Reid  | Sat Jul 16 19:37:37 
2016 -0700| [41d7642a7be5ad778788042e5f3769868da09d31] | committer: Michael 
Niedermayer

libavcodec/dnxhd: add dnxhr profiles

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41d7642a7be5ad778788042e5f3769868da09d31
---

 libavcodec/avcodec.h|7 +++
 libavcodec/codec_desc.c |1 +
 libavcodec/dnxhddec.c   |   22 ++
 libavcodec/dnxhdenc.c   |2 ++
 libavcodec/profiles.c   |   10 ++
 libavcodec/profiles.h   |1 +
 6 files changed, 43 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index e52b2f8..ca8dba8 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3173,6 +3173,13 @@ typedef struct AVCodecContext {
 #define FF_PROFILE_MPEG2_AAC_LOW 128
 #define FF_PROFILE_MPEG2_AAC_HE  131
 
+#define FF_PROFILE_DNXHD 0
+#define FF_PROFILE_DNXHR_LB  1
+#define FF_PROFILE_DNXHR_SQ  2
+#define FF_PROFILE_DNXHR_HQ  3
+#define FF_PROFILE_DNXHR_HQX 4
+#define FF_PROFILE_DNXHR_444 5
+
 #define FF_PROFILE_DTS 20
 #define FF_PROFILE_DTS_ES  30
 #define FF_PROFILE_DTS_96_24   40
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 7a2230f..dea17c9 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -665,6 +665,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .name  = "dnxhd",
 .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+.profiles  = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
 },
 {
 .id= AV_CODEC_ID_THP,
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 5b60326..627bc3b 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -33,6 +33,7 @@
 #include "dnxhddata.h"
 #include "idctdsp.h"
 #include "internal.h"
+#include "profiles.h"
 #include "thread.h"
 
 typedef struct RowContext {
@@ -159,6 +160,23 @@ static av_cold int 
dnxhd_decode_init_thread_copy(AVCodecContext *avctx)
 return 0;
 }
 
+static int dnxhd_get_profile(int cid)
+{
+switch(cid) {
+case 1270:
+return FF_PROFILE_DNXHR_444;
+case 1271:
+return FF_PROFILE_DNXHR_HQX;
+case 1272:
+return FF_PROFILE_DNXHR_HQ;
+case 1273:
+return FF_PROFILE_DNXHR_SQ;
+case 1274:
+return FF_PROFILE_DNXHR_LB;
+}
+return FF_PROFILE_DNXHD;
+}
+
 static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
const uint8_t *buf, int buf_size,
int first_field)
@@ -204,6 +222,9 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 }
 
 cid = AV_RB32(buf + 0x28);
+
+ctx->avctx->profile = dnxhd_get_profile(cid);
+
 if ((ret = dnxhd_init_vlc(ctx, cid, bitdepth)) < 0)
 return ret;
 if (ctx->mbaff && ctx->cid_table->cid != 1260)
@@ -692,4 +713,5 @@ AVCodec ff_dnxhd_decoder = {
 .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS |
   AV_CODEC_CAP_SLICE_THREADS,
 .init_thread_copy = ONLY_IF_THREADS_ENABLED(dnxhd_decode_init_thread_copy),
+.profiles   = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
 };
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index aee4323..1362514 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -34,6 +34,7 @@
 #include "internal.h"
 #include "mpegvideo.h"
 #include "pixblockdsp.h"
+#include "profiles.h"
 #include "dnxhdenc.h"
 
 // The largest value that will not lead to overflow for 10-bit samples.
@@ -1170,4 +1171,5 @@ AVCodec ff_dnxhd_encoder = {
 },
 .priv_class = &dnxhd_class,
 .defaults   = dnxhd_defaults,
+.profiles   = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
 };
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index 0984704..30498ef 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -46,6 +46,16 @@ const AVProfile ff_dca_profiles[] = {
 { FF_PROFILE_UNKNOWN },
 };
 
+const AVProfile ff_dnxhd_profiles[] = {
+  { FF_PROFILE_DNXHD,  "DNXHD"},
+  { FF_PROFILE_DNXHR_LB,   "DNXHR LB"},
+  { FF_PROFILE_DNXHR_SQ,   "DNXHR SQ"},
+  { FF_PROFILE_DNXHR_HQ,   "DNXHR HQ" },
+  { FF_PROFILE_DNXHR_HQX,  "DNXHR HQX"},
+  { FF_PROFILE_DNXHR_444,  "DNXHR 444"},
+  { FF_PROFILE_UNKNOWN },
+};
+
 const AVProfile ff_h264_profiles[] = {
 { FF_PROFILE_H264_BASELINE, "Baseline"  },
 { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline"  },
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index c86c683..eb18b40 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -23,6 +23,7 @@
 
 extern const AVProfile ff_aac_profiles[];
 extern const AVProfile ff_dca_profiles[];
+extern const AVProfile ff_dnxhd_profiles[];
 extern const AVProfile ff_h264_profiles[];
 extern const AVProfile ff_hevc_profiles[];

[FFmpeg-cvslog] x86/diracdsp: make ff_put_signed_rect_clamped_10_sse4 work on x86_32

2016-07-20 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Jul 19 22:37:04 
2016 -0300| [7a15cf42ee17955b22c9b13d83acdc70eb8983ab] | committer: James Almer

x86/diracdsp: make ff_put_signed_rect_clamped_10_sse4 work on x86_32

Reviewed-by: Rostislav Pehlivanov 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a15cf42ee17955b22c9b13d83acdc70eb8983ab
---

 libavcodec/x86/diracdsp.asm|   37 -
 libavcodec/x86/diracdsp_init.c |4 
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
index d86b543..6b3f780 100644
--- a/libavcodec/x86/diracdsp.asm
+++ b/libavcodec/x86/diracdsp.asm
@@ -303,24 +303,30 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, stride, 
qf, qs, tot_v, tot_h
 
 RET
 
-%if ARCH_X86_64 == 1
+INIT_XMM sse4
 ; void put_signed_rect_clamped_10(uint8_t *dst, int dst_stride, const uint8_t 
*src, int src_stride, int width, int height)
-cglobal put_signed_rect_clamped_10, 6, 9, 6, dst, dst_stride, src, src_stride, 
w, h
-mov  r6, srcq
-mov  r7, dstq
-mov  r8, wq
+%if ARCH_X86_64
+cglobal put_signed_rect_clamped_10, 6, 8, 5, dst, dst_stride, src, src_stride, 
w, h, t1, t2
+%else
+cglobal put_signed_rect_clamped_10, 5, 7, 5, dst, dst_stride, src, src_stride, 
w, t1, t2
+%define  hd  r5mp
+%endif
+shl  wd, 2
+addsrcq, wq
+neg  wq
+mov t2q, dstq
+mov t1q, wq
 pxor m2, m2
 mova m3, [clip_10bit]
 mova m4, [convert_to_unsigned_10bit]
 
 .loop_h:
-mov  srcq, r6
-mov  dstq, r7
-mov  wq,   r8
+movdstq, t2q
+mov  wq, t1q
 
 .loop_w:
-movu m0, [srcq+0*mmsize]
-movu m1, [srcq+1*mmsize]
+movu m0, [srcq+wq+0*mmsize]
+movu m1, [srcq+wq+1*mmsize]
 
 padddm0, m4
 padddm1, m4
@@ -329,16 +335,13 @@ cglobal put_signed_rect_clamped_10, 6, 9, 6, dst, 
dst_stride, src, src_stride, w
 
 movu [dstq], m0
 
-add  srcq, 2*mmsize
 add  dstq, 1*mmsize
-sub  wd, 8
-jg   .loop_w
+add  wq,   2*mmsize
+jl   .loop_w
 
-add  r6, src_strideq
-add  r7, dst_strideq
+addsrcq, src_strideq
+add t2q, dst_strideq
 sub  hd, 1
 jg   .loop_h
 
 RET
-
-%endif
diff --git a/libavcodec/x86/diracdsp_init.c b/libavcodec/x86/diracdsp_init.c
index d7c7cd1..b195113 100644
--- a/libavcodec/x86/diracdsp_init.c
+++ b/libavcodec/x86/diracdsp_init.c
@@ -45,9 +45,7 @@ void ff_put_rect_clamped_mmx(uint8_t *dst, int dst_stride, 
const int16_t *src, i
 void ff_put_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t 
*src, int src_stride, int width, int height);
 void ff_put_signed_rect_clamped_mmx(uint8_t *dst, int dst_stride, const 
int16_t *src, int src_stride, int width, int height);
 void ff_put_signed_rect_clamped_sse2(uint8_t *dst, int dst_stride, const 
int16_t *src, int src_stride, int width, int height);
-#if ARCH_X86_64
 void ff_put_signed_rect_clamped_10_sse4(uint8_t *dst, int dst_stride, const 
uint8_t *src, int src_stride, int width, int height);
-#endif
 
 void ff_dequant_subband_32_sse4(uint8_t *src, uint8_t *dst, ptrdiff_t stride, 
const int qf, const int qs, int tot_v, int tot_h);
 
@@ -192,8 +190,6 @@ void ff_diracdsp_init_x86(DiracDSPContext* c)
 
 if (EXTERNAL_SSE4(mm_flags)) {
 c->dequant_subband[1] = ff_dequant_subband_32_sse4;
-#if ARCH_X86_64
 c->put_signed_rect_clamped[1] = ff_put_signed_rect_clamped_10_sse4;
-#endif
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] fate: add test for earwax filter

2016-07-20 Thread Petru Rares Sincraian
ffmpeg | branch: master | Petru Rares Sincraian  | Wed 
Jul 20 18:41:58 2016 +0200| [3fd2ef922eab70e8b35b88f05f84b04332ee4ced] | 
committer: Michael Niedermayer

fate: add test for earwax filter

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3fd2ef922eab70e8b35b88f05f84b04332ee4ced
---

 tests/fate/filter-audio.mak  |5 +
 tests/ref/fate/filter-earwax |   25 +
 2 files changed, 30 insertions(+)

diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 67340c1..bdf6720 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -104,6 +104,11 @@ fate-filter-dcshift: tests/data/asynth-44100-2.wav
 fate-filter-dcshift: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
 fate-filter-dcshift: CMD = framecrc -i $(SRC) -aframes 20 -af 
dcshift=shift=0.25:limitergain=0.05
 
+FATE_AFILTER-$(call FILTERDEMDECENCMUX, EARWAX, WAV, PCM_S16LE, PCM_S16LE, 
WAV) += fate-filter-earwax
+fate-filter-earwax: tests/data/asynth-44100-2.wav
+fate-filter-earwax: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
+fate-filter-earwax: CMD = framecrc -i $(SRC) -aframes 20 -af earwax
+
 tests/data/hls-list.m3u8: TAG = GEN
 tests/data/hls-list.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
diff --git a/tests/ref/fate/filter-earwax b/tests/ref/fate/filter-earwax
new file mode 100644
index 000..8d4eaa8
--- /dev/null
+++ b/tests/ref/fate/filter-earwax
@@ -0,0 +1,25 @@
+#tb 0: 1/44100
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 44100
+#channel_layout 0: 3
+0,  0,  0, 1024, 4096, 0x900af751
+0,   1024,   1024, 1024, 4096, 0xad570065
+0,   2048,   2048, 1024, 4096, 0x93d5f494
+0,   3072,   3072, 1024, 4096, 0x2c65ef7d
+0,   4096,   4096, 1024, 4096, 0xdc8af6d2
+0,   5120,   5120, 1024, 4096, 0x7ae00249
+0,   6144,   6144, 1024, 4096, 0xaab5fdd0
+0,   7168,   7168, 1024, 4096, 0x4373ef39
+0,   8192,   8192, 1024, 4096, 0x0756eb43
+0,   9216,   9216, 1024, 4096, 0x494d06e0
+0,  10240,  10240, 1024, 4096, 0x4393ffae
+0,  11264,  11264, 1024, 4096, 0x6972f97e
+0,  12288,  12288, 1024, 4096, 0xb834ea05
+0,  13312,  13312, 1024, 4096, 0x39b8f871
+0,  14336,  14336, 1024, 4096, 0xf032fccd
+0,  15360,  15360, 1024, 4096, 0xefcd0709
+0,  16384,  16384, 1024, 4096, 0x0590ebc0
+0,  17408,  17408, 1024, 4096, 0x2e75f264
+0,  18432,  18432, 1024, 4096, 0xbea1fd03
+0,  19456,  19456, 1024, 4096, 0x9bbe0434

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] fate: add test for dcshift filter

2016-07-20 Thread Petru Rares Sincraian
ffmpeg | branch: master | Petru Rares Sincraian  | Wed 
Jul 20 18:32:04 2016 +0200| [7403dcc34e0f9b1451e081e68c55c15c9a58cbc8] | 
committer: Michael Niedermayer

fate: add test for dcshift filter

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7403dcc34e0f9b1451e081e68c55c15c9a58cbc8
---

 tests/fate/filter-audio.mak   |5 +
 tests/ref/fate/filter-dcshift |   25 +
 2 files changed, 30 insertions(+)

diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 21f68ee..67340c1 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -99,6 +99,11 @@ fate-filter-chorus: tests/data/asynth-22050-1.wav
 fate-filter-chorus: SRC = $(TARGET_PATH)/tests/data/asynth-22050-1.wav
 fate-filter-chorus: CMD = framecrc -i $(SRC) -aframes 10 -af 
chorus=0.5:0.5:64:0.5:0.25:2
 
+FATE_AFILTER-$(call FILTERDEMDECENCMUX, DCSHIFT, WAV, PCM_S16LE, PCM_S16LE, 
WAV) += fate-filter-dcshift
+fate-filter-dcshift: tests/data/asynth-44100-2.wav
+fate-filter-dcshift: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
+fate-filter-dcshift: CMD = framecrc -i $(SRC) -aframes 20 -af 
dcshift=shift=0.25:limitergain=0.05
+
 tests/data/hls-list.m3u8: TAG = GEN
 tests/data/hls-list.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
diff --git a/tests/ref/fate/filter-dcshift b/tests/ref/fate/filter-dcshift
new file mode 100644
index 000..d04aa92
--- /dev/null
+++ b/tests/ref/fate/filter-dcshift
@@ -0,0 +1,25 @@
+#tb 0: 1/44100
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 44100
+#channel_layout 0: 3
+0,  0,  0, 1024, 4096, 0x96868842
+0,   1024,   1024, 1024, 4096, 0xeff98700
+0,   2048,   2048, 1024, 4096, 0x6ea28e1e
+0,   3072,   3072, 1024, 4096, 0x67b982be
+0,   4096,   4096, 1024, 4096, 0xd08a8302
+0,   5120,   5120, 1024, 4096, 0xfdf891dc
+0,   6144,   6144, 1024, 4096, 0xbec4784a
+0,   7168,   7168, 1024, 4096, 0x04ca910a
+0,   8192,   8192, 1024, 4096, 0xe4af87d0
+0,   9216,   9216, 1024, 4096, 0xc7f18c66
+0,  10240,  10240, 1024, 4096, 0x6448732a
+0,  11264,  11264, 1024, 4096, 0x98b89706
+0,  12288,  12288, 1024, 4096, 0xf47887f4
+0,  13312,  13312, 1024, 4096, 0x387290d2
+0,  14336,  14336, 1024, 4096, 0xc5716e84
+0,  15360,  15360, 1024, 4096, 0x94de8aa8
+0,  16384,  16384, 1024, 4096, 0x3a618d88
+0,  17408,  17408, 1024, 4096, 0xfeb56ec2
+0,  18432,  18432, 1024, 4096, 0x55fe8fb6
+0,  19456,  19456, 1024, 4096, 0x8ff788fa

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/mux: Fix some codecpar non uses

2016-07-20 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Jul 17 04:10:38 2016 +0200| [3af1aba2be028246556a223386029182b1873e5a] | 
committer: Michael Niedermayer

avformat/mux: Fix some codecpar non uses

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3af1aba2be028246556a223386029182b1873e5a
---

 libavformat/mux.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index d674bd4..e9973ed 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -557,7 +557,7 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, 
AVStream *st, AVPacket *
 av_log(s, AV_LOG_TRACE, "compute_muxer_pkt_fields: pts:%s dts:%s 
cur_dts:%s b:%d size:%d st:%d\n",
 av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), 
delay, pkt->size, pkt->stream_index);
 
-if (pkt->duration < 0 && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
+if (pkt->duration < 0 && st->codecpar->codec_type != 
AVMEDIA_TYPE_SUBTITLE) {
 av_log(s, AV_LOG_WARNING, "Packet with invalid duration %"PRId64" in 
stream %d\n",
pkt->duration, pkt->stream_index);
 pkt->duration = 0;
@@ -623,7 +623,7 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, 
AVStream *st, AVPacket *
 st->priv_pts->val = pkt->dts;
 
 /* update pts */
-switch (st->codec->codec_type) {
+switch (st->codecpar->codec_type) {
 case AVMEDIA_TYPE_AUDIO:
 frame_size = (pkt->flags & AV_PKT_FLAG_UNCODED_FRAME) ?
  ((AVFrame *)pkt->data)->nb_samples :

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Changelog: move a misplaced entry to the correct section

2016-07-20 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Jul 20 21:45:20 
2016 -0300| [ec0e888e3aeb7ee75cfa5cdf44695c8a49343ab1] | committer: James Almer

Changelog: move a misplaced entry to the correct section

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec0e888e3aeb7ee75cfa5cdf44695c8a49343ab1
---

 Changelog |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index f545d91..77fe44a 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - libopenmpt demuxer
 - tee protocol
+- Changed metadata print option to accept general urls
 
 
 version 3.1:
@@ -51,7 +52,6 @@ version 3.1:
 - libutvideo wrapper removed
 - YUY2 Lossless Codec decoder
 - VideoToolbox H.264 encoder
-- Changed metadata print option to accept general urls
 
 
 version 3.0:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat/oggenc: add vp8 muxing support

2016-07-20 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Jul 20 22:29:54 
2016 -0300| [120f34b6ac062568a395ebc9490c7d213c264087] | committer: James Almer

avformat/oggenc: add vp8 muxing support

Addresses ticket #5687

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=120f34b6ac062568a395ebc9490c7d213c264087
---

 Changelog   |1 +
 libavformat/oggenc.c|   99 ++-
 tests/fate/avformat.mak |1 +
 tests/lavf-regression.sh|4 ++
 tests/ref/lavf-fate/ogg_vp8 |3 ++
 5 files changed, 98 insertions(+), 10 deletions(-)

diff --git a/Changelog b/Changelog
index 196a574..2bd18ec 100644
--- a/Changelog
+++ b/Changelog
@@ -6,6 +6,7 @@ version :
 - tee protocol
 - Changed metadata print option to accept general urls
 - Alias muxer for Ogg Video (.ogv)
+- VP8 in Ogg muxing
 
 
 version 3.1:
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 2d64b77..0713a13 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -54,6 +54,8 @@ typedef struct OGGStreamContext {
 int kfgshift;
 int64_t last_kf_pts;
 int vrev;
+/* for VP8 granule */
+int isvp8;
 int eos;
 unsigned page_count; ///< number of page buffered
 OGGPage page; ///< current page
@@ -146,7 +148,8 @@ static int ogg_write_page(AVFormatContext *s, OGGPage 
*page, int extra_flags)
 
 static int ogg_key_granule(OGGStreamContext *oggstream, int64_t granule)
 {
-return oggstream->kfgshift && !(granule & ((1kfgshift && !(granule & ((1isvp8&& !((granule >> 3) & 0x07ff));
 }
 
 static int64_t ogg_granule_to_timestamp(OGGStreamContext *oggstream, int64_t 
granule)
@@ -154,6 +157,8 @@ static int64_t ogg_granule_to_timestamp(OGGStreamContext 
*oggstream, int64_t gra
 if (oggstream->kfgshift)
 return (granule>>oggstream->kfgshift) +
 (granule & ((1isvp8)
+return granule >> 32;
 else
 return granule;
 }
@@ -219,11 +224,11 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream 
*st,
 int i, segments, len, flush = 0;
 
 // Handles VFR by flushing page because this frame needs to have a 
timestamp
-// For theora, keyframes also need to have a timestamp to correctly mark
+// For theora and VP8, keyframes also need to have a timestamp to 
correctly mark
 // them as such, otherwise seeking will not work correctly at the very
 // least with old libogg versions.
 // Do not try to flush header packets though, that will create broken 
files.
-if (st->codecpar->codec_id == AV_CODEC_ID_THEORA && !header &&
+if ((st->codecpar->codec_id == AV_CODEC_ID_THEORA || 
st->codecpar->codec_id == AV_CODEC_ID_VP8) && !header &&
 (ogg_granule_to_timestamp(oggstream, granule) >
  ogg_granule_to_timestamp(oggstream, oggstream->last_granule) + 1 ||
  ogg_key_granule(oggstream, granule))) {
@@ -405,6 +410,57 @@ static int ogg_build_opus_headers(AVCodecParameters *par,
 return 0;
 }
 
+#define VP8_HEADER_SIZE 26
+
+static int ogg_build_vp8_headers(AVFormatContext *s, AVStream *st,
+ OGGStreamContext *oggstream, int bitexact)
+{
+AVCodecParameters *par = st->codecpar;
+uint8_t *p;
+
+/* first packet: VP8 header */
+p = av_mallocz(VP8_HEADER_SIZE);
+if (!p)
+return AVERROR(ENOMEM);
+oggstream->header[0] = p;
+oggstream->header_len[0] = VP8_HEADER_SIZE;
+bytestream_put_byte(&p, 0x4f); // HDRID
+bytestream_put_buffer(&p, "VP80", 4); // Identifier
+bytestream_put_byte(&p, 1); // HDRTYP
+bytestream_put_byte(&p, 1); // VMAJ
+bytestream_put_byte(&p, 0); // VMIN
+bytestream_put_be16(&p, par->width);
+bytestream_put_be16(&p, par->height);
+bytestream_put_be24(&p, par->sample_aspect_ratio.num);
+bytestream_put_be24(&p, par->sample_aspect_ratio.den);
+if (st->r_frame_rate.num > 0 && st->r_frame_rate.den > 0) {
+// OggVP8 requires pts to increase by 1 per visible frame, so use the 
least common
+// multiple framerate if available.
+av_log(s, AV_LOG_DEBUG, "Changing time base from %d/%d to %d/%d\n",
+   st->time_base.num, st->time_base.den,
+   st->r_frame_rate.den, st->r_frame_rate.num);
+avpriv_set_pts_info(st, 64, st->r_frame_rate.den, 
st->r_frame_rate.num);
+}
+bytestream_put_be32(&p, st->time_base.den);
+bytestream_put_be32(&p, st->time_base.num);
+
+/* optional second packet: VorbisComment */
+if (av_dict_get(st->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
+p = ogg_write_vorbiscomment(7, bitexact, &oggstream->header_len[1], 
&st->metadata, 0);
+if (!p)
+return AVERROR(ENOMEM);
+oggstream->header[1] = p;
+bytestream_put_byte(&p, 0x4f); // HDRID
+bytestream_put_buffer(&p, "VP80", 

[FFmpeg-cvslog] avformat: add an Ogg Video muxer

2016-07-20 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Jul 20 21:55:12 
2016 -0300| [66408fce493b36578638ee22b6305bc065bcede2] | committer: James Almer

avformat: add an Ogg Video muxer

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66408fce493b36578638ee22b6305bc065bcede2
---

 Changelog|1 +
 configure|1 +
 libavformat/Makefile |2 ++
 libavformat/allformats.c |1 +
 libavformat/oggenc.c |   24 +++-
 libavformat/version.h|2 +-
 6 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 77fe44a..196a574 100644
--- a/Changelog
+++ b/Changelog
@@ -5,6 +5,7 @@ version :
 - libopenmpt demuxer
 - tee protocol
 - Changed metadata print option to accept general urls
+- Alias muxer for Ogg Video (.ogv)
 
 
 version 3.1:
diff --git a/configure b/configure
index cc51e67..1b41303 100755
--- a/configure
+++ b/configure
@@ -2860,6 +2860,7 @@ nut_muxer_select="riffenc"
 nuv_demuxer_select="riffdec"
 oga_muxer_select="ogg_muxer"
 ogg_demuxer_select="dirac_parse"
+ogv_muxer_select="ogg_muxer"
 opus_muxer_select="ogg_muxer"
 psp_muxer_select="mov_muxer"
 rtp_demuxer_select="sdp_demuxer"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 52f35f0..c3f38b4 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -340,6 +340,8 @@ OBJS-$(CONFIG_OGA_MUXER) += oggenc.o \
 vorbiscomment.o
 OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \
 vorbiscomment.o
+OBJS-$(CONFIG_OGV_MUXER) += oggenc.o \
+vorbiscomment.o
 OBJS-$(CONFIG_OMA_DEMUXER)   += omadec.o pcm.o oma.o
 OBJS-$(CONFIG_OMA_MUXER) += omaenc.o rawenc.o oma.o id3v2enc.o
 OBJS-$(CONFIG_OPUS_MUXER)+= oggenc.o \
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 58c33a6..10c9bcc 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -225,6 +225,7 @@ void av_register_all(void)
 REGISTER_DEMUXER (NUV,  nuv);
 REGISTER_MUXER   (OGA,  oga);
 REGISTER_MUXDEMUX(OGG,  ogg);
+REGISTER_MUXER   (OGV,  ogv);
 REGISTER_MUXDEMUX(OMA,  oma);
 REGISTER_MUXER   (OPUS, opus);
 REGISTER_DEMUXER (PAF,  paf);
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 952261b..2d64b77 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -668,7 +668,10 @@ AVOutputFormat ff_ogg_muxer = {
 .name  = "ogg",
 .long_name = NULL_IF_CONFIG_SMALL("Ogg"),
 .mime_type = "application/ogg",
-.extensions= "ogg,ogv"
+.extensions= "ogg"
+#if !CONFIG_OGV_MUXER
+ ",ogv"
+#endif
 #if !CONFIG_SPX_MUXER
  ",spx"
 #endif
@@ -705,6 +708,25 @@ AVOutputFormat ff_oga_muxer = {
 };
 #endif
 
+#if CONFIG_OGV_MUXER
+OGG_CLASS(ogv, Ogg video)
+AVOutputFormat ff_ogv_muxer = {
+.name  = "ogv",
+.long_name = NULL_IF_CONFIG_SMALL("Ogg Video"),
+.mime_type = "video/ogg",
+.extensions= "ogv",
+.priv_data_size= sizeof(OGGContext),
+.audio_codec   = CONFIG_LIBVORBIS_ENCODER ?
+ AV_CODEC_ID_VORBIS : AV_CODEC_ID_FLAC,
+.video_codec   = AV_CODEC_ID_THEORA,
+.write_header  = ogg_write_header,
+.write_packet  = ogg_write_packet,
+.write_trailer = ogg_write_trailer,
+.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
+.priv_class= &ogv_muxer_class,
+};
+#endif
+
 #if CONFIG_SPX_MUXER
 OGG_CLASS(spx, Ogg Speex)
 AVOutputFormat ff_spx_muxer = {
diff --git a/libavformat/version.h b/libavformat/version.h
index 307542e..5630808 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you belive might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  43
+#define LIBAVFORMAT_VERSION_MINOR  44
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libopenmpt: Add "date" to metadata.

2016-07-20 Thread Jörn Heusipp
ffmpeg | branch: master | Jörn Heusipp  | 
Sun Jul 17 15:37:14 2016 +0200| [64131b87d64ddc5583522e7a181e35c66d12025a] | 
committer: Josh de Kock

libopenmpt: Add "date" to metadata.

Signed-off-by: Jörn Heusipp 
Signed-off-by: Josh de Kock 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=64131b87d64ddc5583522e7a181e35c66d12025a
---

 libavformat/libopenmpt.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index bad34b9..e7091ef 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -95,6 +95,7 @@ static int read_header_openmpt(AVFormatContext *s)
 add_meta(s, "title",   openmpt_module_get_metadata(openmpt->module, 
"title"));
 add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, 
"tracker"));
 add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, 
"message"));
+add_meta(s, "date",openmpt_module_get_metadata(openmpt->module, 
"date"));
 
 if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) {
 openmpt_module_destroy(openmpt->module);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libopenmpt: add subsong support

2016-07-20 Thread Josh de Kock
ffmpeg | branch: master | Josh de Kock  | Mon Jul 18 13:58:04 
2016 +0100| [9134d2df5b17426b14dbc9c3411441c412af66b0] | committer: Josh de Kock

libopenmpt: add subsong support

Signed-off-by: Josh de Kock 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9134d2df5b17426b14dbc9c3411441c412af66b0
---

 libavformat/libopenmpt.c |   30 +++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index 58a02be..a87283b 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -36,15 +36,19 @@ typedef struct OpenMPTContext {
 /* options */
 int sample_rate;
 int64_t layout;
+int subsong;
 } OpenMPTContext;
 
 #define OFFSET(x) offsetof(OpenMPTContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define D AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
-{"sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{.i64 = 48000},   1000, INT_MAX,   
A|D},
-{"layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = AV_CH_LAYOUT_STEREO}, 0,INT64_MAX, 
A|D},
-{NULL}
+{ "sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{ .i64 = 48000 },   1000, INT_MAX,   A 
| D },
+{ "layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_CHANNEL_LAYOUT, { .i64 = AV_CH_LAYOUT_STEREO }, 0,INT64_MAX, A 
| D },
+{ "subsong", "set subsong",OFFSET(subsong), 
AV_OPT_TYPE_INT,{ .i64 = -2 },  -2,   INT_MAX,   A 
| D, "subsong"},
+{ "all", "all",0,   
AV_OPT_TYPE_CONST,  { .i64 = -1},   0,0, A 
| D, "subsong" },
+{ "auto","auto",   0,   
AV_OPT_TYPE_CONST,  { .i64 = -2},   0,0, A 
| D, "subsong" },
+{ NULL }
 };
 
 static void openmpt_logfunc(const char *message, void *userdata)
@@ -70,6 +74,8 @@ static int read_header_openmpt(AVFormatContext *s)
 OpenMPTContext *openmpt = s->priv_data;
 int64_t size = avio_size(s->pb);
 char *buf = av_malloc(size);
+int ret;
+
 
 if (!buf)
 return AVERROR(ENOMEM);
@@ -88,6 +94,24 @@ static int read_header_openmpt(AVFormatContext *s)
 add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, 
"tracker"));
 add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, 
"message"));
 
+if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) {
+openmpt_module_destroy(openmpt->module);
+av_log(s, AV_LOG_ERROR, "Invalid subsong index: %d\n", 
openmpt->subsong);
+return AVERROR(EINVAL);
+}
+
+if (openmpt->subsong != -2) {
+if (openmpt->subsong >= 0) {
+av_dict_set_int(&s->metadata, "track", openmpt->subsong + 1, 0);
+}
+ret = openmpt_module_select_subsong(openmpt->module, openmpt->subsong);
+if (!ret){
+openmpt_module_destroy(openmpt->module);
+av_log(s, AV_LOG_ERROR, "Could not select requested subsong: %d", 
openmpt->subsong);
+return AVERROR(EINVAL);
+}
+}
+
 st = avformat_new_stream(s, NULL);
 if (!st) {
 openmpt_module_destroy(openmpt->module);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] libopenmpt: set stream duration and fix time base

2016-07-20 Thread Jörn Heusipp
ffmpeg | branch: master | Jörn Heusipp  | 
Sun Jul 17 15:37:13 2016 +0200| [840df1f1931499ba7a8b388115cff37f0b82ee48] | 
committer: Josh de Kock

libopenmpt: set stream duration and fix time base

Fix the confusion around the used time base.

Check size returned from avio_size()

Signed-off-by: Jörn Heusipp 
Signed-off-by: Josh de Kock 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=840df1f1931499ba7a8b388115cff37f0b82ee48
---

 libavformat/libopenmpt.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index a87283b..bad34b9 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -73,6 +73,8 @@ static int read_header_openmpt(AVFormatContext *s)
 AVStream *st;
 OpenMPTContext *openmpt = s->priv_data;
 int64_t size = avio_size(s->pb);
+if (!size)
+return AVERROR_INVALIDDATA;
 char *buf = av_malloc(size);
 int ret;
 
@@ -118,9 +120,8 @@ static int read_header_openmpt(AVFormatContext *s)
 openmpt->module = NULL;
 return AVERROR(ENOMEM);
 }
-avpriv_set_pts_info(st, 64, 1, 1000);
-if (st->duration > 0)
-st->duration = llrint(openmpt->duration*AV_TIME_BASE);
+avpriv_set_pts_info(st, 64, 1, AV_TIME_BASE);
+st->duration = llrint(openmpt->duration*AV_TIME_BASE);
 
 st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
 st->codecpar->codec_id= AV_NE(AV_CODEC_ID_PCM_F32BE, 
AV_CODEC_ID_PCM_F32LE);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] docs/demuxers: add libopenmpt section

2016-07-20 Thread Josh de Kock
ffmpeg | branch: master | Josh de Kock  | Tue Jul 19 15:48:30 
2016 +0100| [4ed6edac762721ce128ccf2423b5902d5d79d171] | committer: Josh de Kock

docs/demuxers: add libopenmpt section

Signed-off-by: Josh de Kock 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ed6edac762721ce128ccf2423b5902d5d79d171
---

 doc/demuxers.texi |   27 +++
 1 file changed, 27 insertions(+)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index e34f8b3..69890c8 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -267,6 +267,33 @@ track. Track indexes start at 0. The demuxer exports the 
number of tracks as
 
 For very large files, the @option{max_size} option may have to be adjusted.
 
+@section libopenmpt
+
+libopenmpt based module demuxer
+
+See @url{https://lib.openmpt.org/libopenmpt/} for more information.
+
+Some files have multiple subsongs (tracks) this can be set with the 
@option{subsong}
+option.
+
+It accepts the following options:
+
+@table @option
+@item subsong
+Set the subsong index. This can be either  'all', 'auto', or the index of the
+subsong. Subsong indexes start at 0. The default is 'auto'.
+
+The default value is to let libopenmpt choose.
+
+@item layout
+Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
+The default value is STEREO.
+
+@item sample_rate
+Set the sample rate for libopenmpt to output.
+Range is from 1000 to INT_MAX. The value default is 48000.
+@end table
+
 @section gif
 
 Animated GIF demuxer.

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog