Revision 1d7d9935

View differences:

libavformat/asf-enc.c
196 196

  
197 197
static int preroll_time = 3100;
198 198

  
199
static const uint8_t error_spread_ADPCM_G726[] = { 0x01, 0x90, 0x01, 0x90, 0x01, 0x01, 0x00, 0x00 };
200

  
201 199
static void put_guid(ByteIOContext *s, const GUID *g)
202 200
{
203 201
    assert(sizeof(*g) == 16);
......
345 343
    /* stream headers */
346 344
    for(n=0;n<s->nb_streams;n++) {
347 345
        int64_t es_pos;
348
        const uint8_t *er_spr = NULL;
349
        int er_spr_len = 0;
350 346
        //        ASFStream *stream = &asf->streams[n];
351 347

  
352 348
        enc = s->streams[n]->codec;
......
354 350
        asf->streams[n].seq = 0;
355 351

  
356 352

  
357
        if (enc->codec_type == CODEC_TYPE_AUDIO) {
358
            if (enc->codec_id == CODEC_ID_ADPCM_G726) {
359
                er_spr     = error_spread_ADPCM_G726;
360
                er_spr_len = sizeof(error_spread_ADPCM_G726);
361
            }
362
        }
363

  
364 353
        switch(enc->codec_type) {
365 354
        case CODEC_TYPE_AUDIO:
366 355
            wav_extra_size = 0;
367 356
            extra_size = 18 + wav_extra_size;
368
            extra_size2 = er_spr_len;
357
            extra_size2 = 8;
369 358
            break;
370 359
        default:
371 360
        case CODEC_TYPE_VIDEO:
......
378 367
        hpos = put_header(pb, &stream_header);
379 368
        if (enc->codec_type == CODEC_TYPE_AUDIO) {
380 369
            put_guid(pb, &audio_stream);
381
            if ((er_spr != NULL) && (er_spr_len != 0)) {
382
                put_guid(pb, &audio_conceal_spread);
383
            } else {
384
                put_guid(pb, &video_conceal_none);
385
            }
370
            put_guid(pb, &audio_conceal_spread);
386 371
        } else {
387 372
            put_guid(pb, &video_stream);
388 373
            put_guid(pb, &video_conceal_none);
......
411 396
                url_fseek(pb, cur_pos, SEEK_SET);
412 397
            }
413 398
            /* ERROR Correction */
414
            if ((er_spr != NULL) && (er_spr_len != 0))
415
                put_buffer(pb, er_spr, er_spr_len);
399
            put_byte(pb, 0x01);
400
            if(enc->codec_id == CODEC_ID_ADPCM_G726 || !enc->block_align){
401
                put_le16(pb, 0x0190);
402
                put_le16(pb, 0x0190);
403
            }else{
404
                put_le16(pb, enc->block_align);
405
                put_le16(pb, enc->block_align);
406
            }
407
            put_le16(pb, 0x01);
408
            put_byte(pb, 0x00);
416 409
        } else {
417 410
            put_le32(pb, enc->width);
418 411
            put_le32(pb, enc->height);
tests/ffmpeg.regression.ref
188 188
353368 ./data/a-flac.flac
189 189
c4228df189aad9567a037727d0e763e4 *./data/out.wav
190 190
stddev: 33.31 PSNR:65.87 bytes:1040384
191
4c841e72ef8b92dfce0dce756cf16bf1 *./data/a-wmav1.asf
192
99596 ./data/a-wmav1.asf
191
8fc0032faee2785502a506b6d0470833 *./data/a-wmav1.asf
192
99604 ./data/a-wmav1.asf
193 193
stddev:12251.50 PSNR:14.56 bytes:1056768
194 194
stddev:2106.00 PSNR:29.85 bytes:1048576
195
e5881f5c778d4907a5d18fd115ad778d *./data/a-wmav2.asf
196
99602 ./data/a-wmav2.asf
195
f249fbe66d28027cf5f63d85d49844a7 *./data/a-wmav2.asf
196
99610 ./data/a-wmav2.asf
197 197
stddev:12255.92 PSNR:14.55 bytes:1056768
198 198
stddev:2099.31 PSNR:29.88 bytes:1048576
tests/libav.regression.ref
2 2
8a0536ccfe36f4fff408b3327d33e1dd *./data/b-libav.avi
3 3
340344 ./data/b-libav.avi
4 4
./data/b-libav.avi CRC=0x400c29e9
5
c672d780cdf5c0ab11524011fab58760 *./data/b-libav.asf
6
339767 ./data/b-libav.asf
5
fc0716844f196fc791722b4c830a1155 *./data/b-libav.asf
6
339775 ./data/b-libav.asf
7 7
./data/b-libav.asf CRC=0x74113749
8 8
1ad618e9fd318eb3483270cf9b9b3f43 *./data/b-libav.rm
9 9
355405 ./data/b-libav.rm
tests/rotozoom.regression.ref
188 188
353368 ./data/a-flac.flac
189 189
c4228df189aad9567a037727d0e763e4 *./data/out.wav
190 190
stddev: 33.31 PSNR:65.87 bytes:1040384
191
4c841e72ef8b92dfce0dce756cf16bf1 *./data/a-wmav1.asf
192
99596 ./data/a-wmav1.asf
191
8fc0032faee2785502a506b6d0470833 *./data/a-wmav1.asf
192
99604 ./data/a-wmav1.asf
193 193
stddev:12251.50 PSNR:14.56 bytes:1056768
194 194
stddev:2106.00 PSNR:29.85 bytes:1048576
195
e5881f5c778d4907a5d18fd115ad778d *./data/a-wmav2.asf
196
99602 ./data/a-wmav2.asf
195
f249fbe66d28027cf5f63d85d49844a7 *./data/a-wmav2.asf
196
99610 ./data/a-wmav2.asf
197 197
stddev:12255.92 PSNR:14.55 bytes:1056768
198 198
stddev:2099.31 PSNR:29.88 bytes:1048576

Also available in: Unified diff