- Timestamp:
- Oct 15, 2018 4:26:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r74848 r74849 305 305 } 306 306 307 LogRel2(("VideoRec: Recording audio in %RU16Hz, %RU8 channels , %RU32 bitrate\n", uHz, cChannels, uBitrate));307 LogRel2(("VideoRec: Recording audio in %RU16Hz, %RU8 channels\n", uHz, cChannels)); 308 308 309 309 int orc; … … 317 317 AssertPtr(pEnc); 318 318 319 opus_encoder_ctl(pEnc, OPUS_SET_BITRATE(uBitrate)); 320 if (orc != OPUS_OK) 321 { 322 opus_encoder_destroy(pEnc); 323 pEnc = NULL; 324 325 LogRel(("VideoRec: Audio codec failed to set bitrate (%RU32): %s\n", uBitrate, opus_strerror(orc))); 326 return VERR_AUDIO_BACKEND_INIT_FAILED; 319 if (uBitrate) /* Only explicitly set the bitrate if we specified one. Otherwise let Opus decide. */ 320 { 321 opus_encoder_ctl(pEnc, OPUS_SET_BITRATE(uBitrate)); 322 if (orc != OPUS_OK) 323 { 324 opus_encoder_destroy(pEnc); 325 pEnc = NULL; 326 327 LogRel(("VideoRec: Audio codec failed to set bitrate (%RU32): %s\n", uBitrate, opus_strerror(orc))); 328 return VERR_AUDIO_BACKEND_INIT_FAILED; 329 } 327 330 } 328 331 … … 622 625 CodecParms.cChannels = 2; /** @todo Make this configurable. */ 623 626 CodecParms.cBits = 16; /** @todo Make this configurable. */ 624 CodecParms.uBitrate = 196000; /** @todo Make this configurable. */627 CodecParms.uBitrate = 0; /* Let Opus decide, based on the number of channels and the input sampling rate. */ 625 628 626 629 int rc = avRecSinkInit(pThis, &pThis->Sink, &ContainerParms, &CodecParms);
Note:
See TracChangeset
for help on using the changeset viewer.

