Commit cc0e105d authored by aurel's avatar aurel

set bytes per sample in the context

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10802 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5e5499df
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#define MV0K_TAG MKTAG('M', 'V', '0', 'K') #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
#define MV0F_TAG MKTAG('M', 'V', '0', 'F') #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
#define EA_BITS_PER_SAMPLE 16
typedef struct EaDemuxContext { typedef struct EaDemuxContext {
int big_endian; int big_endian;
...@@ -50,6 +48,7 @@ typedef struct EaDemuxContext { ...@@ -50,6 +48,7 @@ typedef struct EaDemuxContext {
int64_t audio_pts; int64_t audio_pts;
int bytes;
int sample_rate; int sample_rate;
int num_channels; int num_channels;
int num_samples; int num_samples;
...@@ -83,6 +82,7 @@ static int process_audio_header_elements(AVFormatContext *s) ...@@ -83,6 +82,7 @@ static int process_audio_header_elements(AVFormatContext *s)
ByteIOContext *pb = &s->pb; ByteIOContext *pb = &s->pb;
int compression_type = -1, revision = -1; int compression_type = -1, revision = -1;
ea->bytes = 2;
ea->sample_rate = -1; ea->sample_rate = -1;
ea->num_channels = 1; ea->num_channels = 1;
...@@ -267,7 +267,7 @@ static int ea_read_header(AVFormatContext *s, ...@@ -267,7 +267,7 @@ static int ea_read_header(AVFormatContext *s,
st->codec->codec_tag = 0; /* no tag */ st->codec->codec_tag = 0; /* no tag */
st->codec->channels = ea->num_channels; st->codec->channels = ea->num_channels;
st->codec->sample_rate = ea->sample_rate; st->codec->sample_rate = ea->sample_rate;
st->codec->bits_per_sample = EA_BITS_PER_SAMPLE; st->codec->bits_per_sample = ea->bytes * 8;
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
st->codec->bits_per_sample / 4; st->codec->bits_per_sample / 4;
st->codec->block_align = st->codec->channels * st->codec->bits_per_sample; st->codec->block_align = st->codec->channels * st->codec->bits_per_sample;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment