VirtualBox

Changeset 6140 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 18, 2007 5:20:07 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
26872
Message:

Pass the VM name to the audio driver. PulseAudio will name the name of the stream according to that name.

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/audio.c

    r6117 r6140  
    8787};
    8888
     89static char *audio_streamname;
     90
     91const char *audio_get_stream_name(void)
     92{
     93    return audio_streamname;
     94}
     95
    8996struct fixed_settings {
    9097    int enabled;
     
    19121919     * Validate the config.
    19131920     */
    1914     if (!CFGMR3AreValuesValid(pCfgHandle, "AudioDriver\0"))
     1921    if (!CFGMR3AreValuesValid(pCfgHandle, "AudioDriver\0StreamName\0"))
    19151922        return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    19161923
     
    19291936    if (VBOX_FAILURE (rc))
    19301937        return rc;
     1938
     1939    rc = CFGMR3QueryStringAlloc (pCfgHandle, "StreamName", &audio_streamname);
     1940    if (VBOX_FAILURE (rc))
     1941        audio_streamname = NULL;
    19311942
    19321943    rc = AUD_init (pDrvIns, drvname);
  • trunk/src/VBox/Devices/Audio/audio.h

    r6056 r6140  
    196196#endif
    197197
     198#ifdef VBOX
     199const char *audio_get_stream_name(void);
     200#endif
     201
    198202#endif  /* audio.h */
  • trunk/src/VBox/Devices/Audio/pulseaudio.c

    r6133 r6140  
    180180    const pa_buffer_attr *pBufAttr;
    181181    const pa_sample_spec *pSampSpec;
    182     const char           *pchPCMName = fIn ? "pcm_in" : "pcm_out";
     182    char                  achPCMName[64];
    183183    pa_stream_flags_t     flags;
    184184    int                   ms = fIn ? conf.buffer_msecs_in : conf.buffer_msecs_out;
    185 
     185    const char           *stream_name = audio_get_stream_name();
     186
     187    RTStrPrintf(achPCMName, sizeof(achPCMName), "%.32s%s%s%s",
     188                stream_name ? stream_name : "",
     189                stream_name ? " (" : "",
     190                fIn ? "pcm_in" : "pcm_out",
     191                stream_name ? ")" : "");
    186192    sspec.rate     = req->freq;
    187193    sspec.channels = req->nchannels;
     
    206212    pa_threaded_mainloop_lock(g_pMainLoop);
    207213
    208     if (!(pStream = pa_stream_new(g_pContext, pchPCMName, &sspec, &cmap)))
    209     {
    210         LogRel(("Pulse: Cannot create stream %s\n", pchPCMName));
     214    if (!(pStream = pa_stream_new(g_pContext, achPCMName, &sspec, &cmap)))
     215    {
     216        LogRel(("Pulse: Cannot create stream %s\n", achPCMName));
    211217        goto unlock_and_fail;
    212218    }
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r6056 r6140  
    13451345#endif
    13461346        }
     1347        hrc = pMachine->COMGETTER(Name)(&str);                                          H();
     1348        STR_CONV();
     1349        rc = CFGMR3InsertString(pCfg,  "StreamName", psz);                              RC_CHECK();
     1350        STR_FREE();
    13471351    }
    13481352
Note: See TracChangeset for help on using the changeset viewer.

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