comparison matroskadec.c @ 3662:7222dc75f80e libavformat

matroskadec: cosmetics: placement of 'else if'
author aurel
date Tue, 05 Aug 2008 00:41:31 +0000
parents 7cba55954d0e
children eb1c4a7b4aff
comparison
equal deleted inserted replaced
3661:7cba55954d0e 3662:7222dc75f80e
1398 1398
1399 st = track->stream = av_new_stream(s, matroska->num_streams++); 1399 st = track->stream = av_new_stream(s, matroska->num_streams++);
1400 if (st == NULL) 1400 if (st == NULL)
1401 return AVERROR(ENOMEM); 1401 return AVERROR(ENOMEM);
1402 1402
1403 if (!strcmp(track->codec_id, 1403 if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC)
1404 MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC) && 1404 && track->codec_priv.size >= 40
1405 (track->codec_priv.size >= 40) && 1405 && track->codec_priv.data != NULL) {
1406 (track->codec_priv.data != NULL)) {
1407 track->video.fourcc = AV_RL32(track->codec_priv.data + 16); 1406 track->video.fourcc = AV_RL32(track->codec_priv.data + 16);
1408 codec_id = codec_get_id(codec_bmp_tags, track->video.fourcc); 1407 codec_id = codec_get_id(codec_bmp_tags, track->video.fourcc);
1409 } 1408 } else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_AUDIO_ACM)
1410 else if (!strcmp(track->codec_id, 1409 && track->codec_priv.size >= 18
1411 MATROSKA_CODEC_ID_AUDIO_ACM) && 1410 && track->codec_priv.data != NULL) {
1412 (track->codec_priv.size >= 18) &&
1413 (track->codec_priv.data != NULL)) {
1414 uint16_t tag = AV_RL16(track->codec_priv.data); 1411 uint16_t tag = AV_RL16(track->codec_priv.data);
1415 codec_id = codec_get_id(codec_wav_tags, tag); 1412 codec_id = codec_get_id(codec_wav_tags, tag);
1416 } 1413 } else if (!strcmp(track->codec_id, "V_QUICKTIME")
1417 1414 && (track->codec_priv.size >= 86)
1418 else if (!strcmp(track->codec_id, "V_QUICKTIME") && 1415 && (track->codec_priv.data != NULL)) {
1419 (track->codec_priv.size >= 86) &&
1420 (track->codec_priv.data != NULL)) {
1421 track->video.fourcc = AV_RL32(track->codec_priv.data); 1416 track->video.fourcc = AV_RL32(track->codec_priv.data);
1422 codec_id=codec_get_id(codec_movvideo_tags, track->video.fourcc); 1417 codec_id=codec_get_id(codec_movvideo_tags, track->video.fourcc);
1423 } 1418 } else if (codec_id == CODEC_ID_AAC && !track->codec_priv.size) {
1424
1425 else if (codec_id == CODEC_ID_AAC && !track->codec_priv.size) {
1426 int profile = matroska_aac_profile(track->codec_id); 1419 int profile = matroska_aac_profile(track->codec_id);
1427 int sri = matroska_aac_sri(track->audio.samplerate); 1420 int sri = matroska_aac_sri(track->audio.samplerate);
1428 extradata = av_malloc(5); 1421 extradata = av_malloc(5);
1429 if (extradata == NULL) 1422 if (extradata == NULL)
1430 return AVERROR(ENOMEM); 1423 return AVERROR(ENOMEM);
1436 extradata[3] = 0xE5; 1429 extradata[3] = 0xE5;
1437 extradata[4] = 0x80 | (sri<<3); 1430 extradata[4] = 0x80 | (sri<<3);
1438 extradata_size = 5; 1431 extradata_size = 5;
1439 } else 1432 } else
1440 extradata_size = 2; 1433 extradata_size = 2;
1441 } 1434 } else if (codec_id == CODEC_ID_TTA) {
1442 else if (codec_id == CODEC_ID_TTA) {
1443 ByteIOContext b; 1435 ByteIOContext b;
1444 extradata_size = 30; 1436 extradata_size = 30;
1445 extradata = av_mallocz(extradata_size); 1437 extradata = av_mallocz(extradata_size);
1446 if (extradata == NULL) 1438 if (extradata == NULL)
1447 return AVERROR(ENOMEM); 1439 return AVERROR(ENOMEM);
1451 put_le16(&b, 1); 1443 put_le16(&b, 1);
1452 put_le16(&b, track->audio.channels); 1444 put_le16(&b, track->audio.channels);
1453 put_le16(&b, track->audio.bitdepth); 1445 put_le16(&b, track->audio.bitdepth);
1454 put_le32(&b, track->audio.out_samplerate); 1446 put_le32(&b, track->audio.out_samplerate);
1455 put_le32(&b, matroska->ctx->duration * track->audio.out_samplerate); 1447 put_le32(&b, matroska->ctx->duration * track->audio.out_samplerate);
1456 } 1448 } else if (codec_id == CODEC_ID_RV10 || codec_id == CODEC_ID_RV20 ||
1457 else if (codec_id == CODEC_ID_RV10 || codec_id == CODEC_ID_RV20 || 1449 codec_id == CODEC_ID_RV30 || codec_id == CODEC_ID_RV40) {
1458 codec_id == CODEC_ID_RV30 || codec_id == CODEC_ID_RV40) {
1459 extradata_offset = 26; 1450 extradata_offset = 26;
1460 track->codec_priv.size -= extradata_offset; 1451 track->codec_priv.size -= extradata_offset;
1461 } 1452 } else if (codec_id == CODEC_ID_RA_144) {
1462 else if (codec_id == CODEC_ID_RA_144) {
1463 track->audio.out_samplerate = 8000; 1453 track->audio.out_samplerate = 8000;
1464 track->audio.channels = 1; 1454 track->audio.channels = 1;
1465 } 1455 } else if (codec_id == CODEC_ID_RA_288 || codec_id == CODEC_ID_COOK ||
1466 else if (codec_id == CODEC_ID_RA_288 || 1456 codec_id == CODEC_ID_ATRAC3) {
1467 codec_id == CODEC_ID_COOK ||
1468 codec_id == CODEC_ID_ATRAC3) {
1469 ByteIOContext b; 1457 ByteIOContext b;
1470 1458
1471 init_put_byte(&b, track->codec_priv.data,track->codec_priv.size, 1459 init_put_byte(&b, track->codec_priv.data,track->codec_priv.size,
1472 0, NULL, NULL, NULL, NULL); 1460 0, NULL, NULL, NULL, NULL);
1473 url_fskip(&b, 24); 1461 url_fskip(&b, 24);