VirtualBox

Ignore:
Timestamp:
Nov 7, 2018 1:56:14 PM (6 years ago)
Author:
vboxsync
Message:

Recording: Bugfixes for Main and FE/Qt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/VideoRecStream.cpp

    r75256 r75307  
    4545    : tsStartMs(0)
    4646{
     47    File.pWEBM = NULL;
     48    File.hFile = NIL_RTFILE;
    4749}
    4850
     
    5052    : tsStartMs(0)
    5153{
     54    File.pWEBM = NULL;
     55    File.hFile = NIL_RTFILE;
     56
    5257    int rc2 = initInternal(uScreen, Settings);
    5358    if (RT_FAILURE(rc2))
     
    6671 * @returns IPRT status code.
    6772 */
    68 int CaptureStream::open(void)
    69 {
    70     Assert(ScreenSettings.enmDest == CaptureDestination_None);
     73int CaptureStream::open(const settings::CaptureScreenSettings &Settings)
     74{
     75    /* Sanity. */
     76    Assert(Settings.enmDest != CaptureDestination_None);
    7177
    7278    int rc;
    7379
    74     switch (ScreenSettings.enmDest)
     80    switch (Settings.enmDest)
    7581    {
    7682        case CaptureDestination_File:
    7783        {
    78             Assert(ScreenSettings.File.strName.isNotEmpty());
    79 
    80             char *pszAbsPath = RTPathAbsDup(ScreenSettings.File.strName.c_str());
     84            Assert(Settings.File.strName.isNotEmpty());
     85
     86            char *pszAbsPath = RTPathAbsDup(Settings.File.strName.c_str());
    8187            AssertPtrReturn(pszAbsPath, VERR_NO_MEMORY);
    8288
     
    132138                    if (RT_SUCCESS(rc))
    133139                        rc = RTFileOpen(&hFile, pszFile, fOpen);
     140                }
     141
     142                try
     143                {
     144                    Assert(File.pWEBM == NULL);
     145                    File.pWEBM = new WebMWriter();
     146                }
     147                catch (std::bad_alloc &)
     148               {
     149                    rc = VERR_NO_MEMORY;
    134150                }
    135151
     
    656672        return rc;
    657673
    658     rc = open();
     674    rc = open(Settings);
    659675    if (RT_FAILURE(rc))
    660676        return rc;
     
    675691            const char *pszFile = this->ScreenSettings.File.strName.c_str();
    676692
     693            AssertPtr(File.pWEBM);
    677694            rc = File.pWEBM->OpenEx(pszFile, &this->File.hFile,
    678695#ifdef VBOX_WITH_AUDIO_VIDEOREC
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette