Re: [FFmpeg-devel] [PATCH] avformat/sierravmd: Support for Shivers 2 stereo tracks

2017-02-21 Thread Michael Niedermayer
On Tue, Feb 21, 2017 at 10:11:37AM +0100, Paul B Mahol wrote:
> On 2/18/17, Nicolas Roy-Renaud  wrote:
> > Signed-off-by: Nicolas Roy-Renaud 
> > ---
> >  libavformat/sierravmd.c | 20 +---
> >  1 file changed, 13 insertions(+), 7 deletions(-)
> >
> > diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
> > index 734a3f2c1e..6960c2868f 100644
> > --- a/libavformat/sierravmd.c
> > +++ b/libavformat/sierravmd.c
> > @@ -142,13 +142,6 @@ static int vmd_read_header(AVFormatContext *s)
> >  st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
> >  st->codecpar->codec_id   = AV_CODEC_ID_VMDAUDIO;
> >  st->codecpar->codec_tag  = 0;  /* no fourcc */
> > -if (vmd->vmd_header[811] & 0x80) {
> > -st->codecpar->channels   = 2;
> > -st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
> > -} else {
> > -st->codecpar->channels   = 1;
> > -st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
> > -}
> >  st->codecpar->sample_rate = vmd->sample_rate;
> >  st->codecpar->block_align = AV_RL16(>vmd_header[806]);
> >  if (st->codecpar->block_align & 0x8000) {
> > @@ -157,6 +150,19 @@ static int vmd_read_header(AVFormatContext *s)
> >  } else {
> >  st->codecpar->bits_per_coded_sample = 8;
> >  }
> > +if (vmd->vmd_header[811] & 0x80) {
> > +st->codecpar->channels   = 2;
> > +st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
> > +} else if (vmd->vmd_header[811] & 0x2) {
> > +/* Shivers 2 stereo audio */
> > +/* Frame length is for 1 channel */
> > +st->codecpar->channels   = 2;
> > +st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
> > +st->codecpar->block_align = st->codecpar->block_align << 1;
> > +} else {
> > +st->codecpar->channels   = 1;
> > +st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
> > +}
> >  st->codecpar->bit_rate = st->codecpar->sample_rate *
> >  st->codecpar->bits_per_coded_sample * st->codecpar->channels;
> >
> > --
> > 2.11.0
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> lgtm

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/sierravmd: Support for Shivers 2 stereo tracks

2017-02-21 Thread Paul B Mahol
On 2/18/17, Nicolas Roy-Renaud  wrote:
> Signed-off-by: Nicolas Roy-Renaud 
> ---
>  libavformat/sierravmd.c | 20 +---
>  1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
> index 734a3f2c1e..6960c2868f 100644
> --- a/libavformat/sierravmd.c
> +++ b/libavformat/sierravmd.c
> @@ -142,13 +142,6 @@ static int vmd_read_header(AVFormatContext *s)
>  st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
>  st->codecpar->codec_id   = AV_CODEC_ID_VMDAUDIO;
>  st->codecpar->codec_tag  = 0;  /* no fourcc */
> -if (vmd->vmd_header[811] & 0x80) {
> -st->codecpar->channels   = 2;
> -st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
> -} else {
> -st->codecpar->channels   = 1;
> -st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
> -}
>  st->codecpar->sample_rate = vmd->sample_rate;
>  st->codecpar->block_align = AV_RL16(>vmd_header[806]);
>  if (st->codecpar->block_align & 0x8000) {
> @@ -157,6 +150,19 @@ static int vmd_read_header(AVFormatContext *s)
>  } else {
>  st->codecpar->bits_per_coded_sample = 8;
>  }
> +if (vmd->vmd_header[811] & 0x80) {
> +st->codecpar->channels   = 2;
> +st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
> +} else if (vmd->vmd_header[811] & 0x2) {
> +/* Shivers 2 stereo audio */
> +/* Frame length is for 1 channel */
> +st->codecpar->channels   = 2;
> +st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
> +st->codecpar->block_align = st->codecpar->block_align << 1;
> +} else {
> +st->codecpar->channels   = 1;
> +st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
> +}
>  st->codecpar->bit_rate = st->codecpar->sample_rate *
>  st->codecpar->bits_per_coded_sample * st->codecpar->channels;
>
> --
> 2.11.0
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

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


[FFmpeg-devel] [PATCH] avformat/sierravmd: Support for Shivers 2 stereo tracks

2017-02-17 Thread Nicolas Roy-Renaud
Signed-off-by: Nicolas Roy-Renaud 
---
 libavformat/sierravmd.c | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 734a3f2c1e..6960c2868f 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -142,13 +142,6 @@ static int vmd_read_header(AVFormatContext *s)
 st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
 st->codecpar->codec_id   = AV_CODEC_ID_VMDAUDIO;
 st->codecpar->codec_tag  = 0;  /* no fourcc */
-if (vmd->vmd_header[811] & 0x80) {
-st->codecpar->channels   = 2;
-st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
-} else {
-st->codecpar->channels   = 1;
-st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
-}
 st->codecpar->sample_rate = vmd->sample_rate;
 st->codecpar->block_align = AV_RL16(>vmd_header[806]);
 if (st->codecpar->block_align & 0x8000) {
@@ -157,6 +150,19 @@ static int vmd_read_header(AVFormatContext *s)
 } else {
 st->codecpar->bits_per_coded_sample = 8;
 }
+if (vmd->vmd_header[811] & 0x80) {
+st->codecpar->channels   = 2;
+st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
+} else if (vmd->vmd_header[811] & 0x2) {
+/* Shivers 2 stereo audio */
+/* Frame length is for 1 channel */
+st->codecpar->channels   = 2;
+st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
+st->codecpar->block_align = st->codecpar->block_align << 1;
+} else {
+st->codecpar->channels   = 1;
+st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+}
 st->codecpar->bit_rate = st->codecpar->sample_rate *
 st->codecpar->bits_per_coded_sample * st->codecpar->channels;
 
-- 
2.11.0

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