Skip to content

Commit 887df9c

Browse files
author
Clement Champetier
committed
AudioRewrapper: refactoring
* Rename audioODesc to audioOutputDesc. * Explain the magick numbers ;)
1 parent 6f68e2f commit 887df9c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/audioRewrapper/audioRewrapper.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ void transcodeAudio( const char* inputfilename, const char* outputFilename )
6565

6666
// init audio encoders
6767
OutputStreamAudio outputStreamAudio;
68-
AudioDesc& audioDesc = outputStreamAudio.getAudioDesc();
69-
audioDesc.setAudioCodec( "pcm_s24le" );
70-
audioDesc.setAudioParameters(
68+
AudioDesc& audioOutputDesc = outputStreamAudio.getAudioDesc();
69+
audioOutputDesc.setAudioCodec( "pcm_s24le" );
70+
audioOutputDesc.setAudioParameters(
7171
inputFile.getStream( 0 ).getAudioDesc().getSampleRate(),
7272
inputFile.getStream( 0 ).getAudioDesc().getChannels(),
7373
AV_SAMPLE_FMT_S32//,inputFile.getStream( 0 ).getAudioDesc().getSampleFormat()
@@ -79,7 +79,7 @@ void transcodeAudio( const char* inputfilename, const char* outputFilename )
7979
exit( -1 );
8080
}
8181

82-
outputFile.addAudioStream( audioDesc );
82+
outputFile.addAudioStream( audioOutputDesc );
8383
outputFile.beginWrap();
8484

8585
// init convert
@@ -91,7 +91,7 @@ void transcodeAudio( const char* inputfilename, const char* outputFilename )
9191
std::cout << "start transcoding" << std::endl;
9292

9393
AudioFrame audioFrameSource( inputFile.getStream( 0 ).getAudioDesc().getFrameDesc() );
94-
AudioFrame audioFrameToEncode( audioDesc.getFrameDesc() );
94+
AudioFrame audioFrameToEncode( audioOutputDesc.getFrameDesc() );
9595

9696
size_t frame = 0;
9797
while( inputStreamAudio.readNextFrame( audioFrameSource ) )
@@ -105,6 +105,7 @@ void transcodeAudio( const char* inputfilename, const char* outputFilename )
105105
outputFile.wrap( codedFrame, 0 );
106106

107107
++frame;
108+
// if you want to stop the transcoding process (after 10s at 48,1 KHz)
108109
// if(frame == 10*48100)
109110
// break;
110111
}

0 commit comments

Comments
 (0)