comparison matroskaenc.c @ 2495:9c3067533891 libavformat

Grammar nits
author conrad
date Wed, 05 Sep 2007 00:25:18 +0000
parents 7dfbd8e0502f
children 215eef1f3f37
comparison
equal deleted inserted replaced
2494:7dfbd8e0502f 2495:9c3067533891
1 /* 1 /*
2 * Matroska file muxer 2 * Matroska muxer
3 * Copyright (c) 2007 David Conrad 3 * Copyright (c) 2007 David Conrad
4 * 4 *
5 * This file is part of FFmpeg. 5 * This file is part of FFmpeg.
6 * 6 *
7 * FFmpeg is free software; you can redistribute it and/or 7 * FFmpeg is free software; you can redistribute it and/or
113 for (i = bytes-1; i >= 0; i--) 113 for (i = bytes-1; i >= 0; i--)
114 put_byte(pb, value >> i*8); 114 put_byte(pb, value >> i*8);
115 } 115 }
116 116
117 /** 117 /**
118 * Calculate how many bytes are needed to represent a given size in EBML 118 * Calculate how many bytes are needed to represent a given size in EBML.
119 */ 119 */
120 static int ebml_size_bytes(uint64_t size) 120 static int ebml_size_bytes(uint64_t size)
121 { 121 {
122 int bytes = 1; 122 int bytes = 1;
123 while ((size+1) >> bytes*7) bytes++; 123 while ((size+1) >> bytes*7) bytes++;
461 24000, 22050, 16000, 12000, 11025, 8000, 461 24000, 22050, 16000, 12000, 11025, 8000,
462 }; 462 };
463 int sri; 463 int sri;
464 464
465 if (codec->extradata_size < 2) { 465 if (codec->extradata_size < 2) {
466 av_log(codec, AV_LOG_WARNING, "no aac extradata, unable to determine sample rate\n"); 466 av_log(codec, AV_LOG_WARNING, "no AAC extradata, unable to determine samplerate\n");
467 return; 467 return;
468 } 468 }
469 469
470 sri = ((codec->extradata[0] << 1) & 0xE) | (codec->extradata[1] >> 7); 470 sri = ((codec->extradata[0] << 1) & 0xE) | (codec->extradata[1] >> 7);
471 if (sri > 12) { 471 if (sri > 12) {
472 av_log(codec, AV_LOG_WARNING, "aac samplerate index out of bounds\n"); 472 av_log(codec, AV_LOG_WARNING, "AAC samplerate index out of bounds\n");
473 return; 473 return;
474 } 474 }
475 *sample_rate = aac_sample_rates[sri]; 475 *sample_rate = aac_sample_rates[sri];
476 476
477 // if sbr, get output sample rate as well 477 // if sbr, get output sample rate as well
478 if (codec->extradata_size == 5) { 478 if (codec->extradata_size == 5) {
479 sri = (codec->extradata[4] >> 3) & 0xF; 479 sri = (codec->extradata[4] >> 3) & 0xF;
480 if (sri > 12) { 480 if (sri > 12) {
481 av_log(codec, AV_LOG_WARNING, "aac output samplerate index out of bounds\n"); 481 av_log(codec, AV_LOG_WARNING, "AAC output samplerate index out of bounds\n");
482 return; 482 return;
483 } 483 }
484 *output_sample_rate = aac_sample_rates[sri]; 484 *output_sample_rate = aac_sample_rates[sri];
485 } 485 }
486 } 486 }