diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-02-12 23:32:55 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-02-12 23:32:55 +0000 |
commit | 1d7d9935b27c41215174d73dbb97a4a125c2ed8c (patch) | |
tree | 54055a8df3fa65ac35427f8a01515fcec66f3a15 /libavformat/asf-enc.c | |
parent | dc02fc6a68ca6def23faf2bd3d222876e3945e7f (diff) | |
download | ffmpeg-streaming-1d7d9935b27c41215174d73dbb97a4a125c2ed8c.zip ffmpeg-streaming-1d7d9935b27c41215174d73dbb97a4a125c2ed8c.tar.gz |
always use audio spread (instead of "video no spread" for audio ...)
Originally committed as revision 7960 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf-enc.c')
-rw-r--r-- | libavformat/asf-enc.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/libavformat/asf-enc.c b/libavformat/asf-enc.c index ffa41e6..2a87591 100644 --- a/libavformat/asf-enc.c +++ b/libavformat/asf-enc.c @@ -196,8 +196,6 @@ static const AVCodecTag codec_asf_bmp_tags[] = { static int preroll_time = 3100; -static const uint8_t error_spread_ADPCM_G726[] = { 0x01, 0x90, 0x01, 0x90, 0x01, 0x01, 0x00, 0x00 }; - static void put_guid(ByteIOContext *s, const GUID *g) { assert(sizeof(*g) == 16); @@ -345,8 +343,6 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data /* stream headers */ for(n=0;n<s->nb_streams;n++) { int64_t es_pos; - const uint8_t *er_spr = NULL; - int er_spr_len = 0; // ASFStream *stream = &asf->streams[n]; enc = s->streams[n]->codec; @@ -354,18 +350,11 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data asf->streams[n].seq = 0; - if (enc->codec_type == CODEC_TYPE_AUDIO) { - if (enc->codec_id == CODEC_ID_ADPCM_G726) { - er_spr = error_spread_ADPCM_G726; - er_spr_len = sizeof(error_spread_ADPCM_G726); - } - } - switch(enc->codec_type) { case CODEC_TYPE_AUDIO: wav_extra_size = 0; extra_size = 18 + wav_extra_size; - extra_size2 = er_spr_len; + extra_size2 = 8; break; default: case CODEC_TYPE_VIDEO: @@ -378,11 +367,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data hpos = put_header(pb, &stream_header); if (enc->codec_type == CODEC_TYPE_AUDIO) { put_guid(pb, &audio_stream); - if ((er_spr != NULL) && (er_spr_len != 0)) { - put_guid(pb, &audio_conceal_spread); - } else { - put_guid(pb, &video_conceal_none); - } + put_guid(pb, &audio_conceal_spread); } else { put_guid(pb, &video_stream); put_guid(pb, &video_conceal_none); @@ -411,8 +396,16 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data url_fseek(pb, cur_pos, SEEK_SET); } /* ERROR Correction */ - if ((er_spr != NULL) && (er_spr_len != 0)) - put_buffer(pb, er_spr, er_spr_len); + put_byte(pb, 0x01); + if(enc->codec_id == CODEC_ID_ADPCM_G726 || !enc->block_align){ + put_le16(pb, 0x0190); + put_le16(pb, 0x0190); + }else{ + put_le16(pb, enc->block_align); + put_le16(pb, enc->block_align); + } + put_le16(pb, 0x01); + put_byte(pb, 0x00); } else { put_le32(pb, enc->width); put_le32(pb, enc->height); |