- Timestamp:
- Oct 24, 2017 8:59:02 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r68895 r69188 232 232 /** Codec data this sink uses for encoding. */ 233 233 AVRECCODEC Codec; 234 /** Timestamp (in ms) of when the sink was created. */ 235 uint64_t tsStartMs; 234 236 } AVRECSINK, *PAVRECSINK; 235 237 … … 245 247 /** Pointer to sink to use for writing. */ 246 248 PAVRECSINK pSink; 249 /** Last encoded PTS (in ms). */ 250 uint64_t uLastPTSMs; 247 251 } AVRECSTREAM, *PAVRECSTREAM; 248 252 … … 410 414 pSink->Codec.STAM.msEncTotal = 0; 411 415 #endif 416 417 pSink->tsStartMs = RTTimeMilliTS(); 412 418 } 413 419 else … … 509 515 if (RT_SUCCESS(rc)) 510 516 { 511 pStreamAV->pSink = pSink; /* Assign sink to stream. */ 517 pStreamAV->pSink = pSink; /* Assign sink to stream. */ 518 pStreamAV->uLastPTSMs = 0; 512 519 513 520 if (pCfgAcq) … … 760 767 Assert(cEncFrames == 1); /* At the moment we encode exactly *one* frame per frame. */ 761 768 769 if (pStreamAV->uLastPTSMs == 0) 770 pStreamAV->uLastPTSMs = RTTimeMilliTS() - pSink->tsStartMs; 771 762 772 const uint64_t uDurationMs = pSink->Codec.Opus.msFrame * cEncFrames; 773 const uint64_t uPTSMs = pStreamAV->uLastPTSMs + uDurationMs; 774 775 pStreamAV->uLastPTSMs += uDurationMs; 763 776 764 777 switch (pSink->Con.Parms.enmType) … … 766 779 case AVRECCONTAINERTYPE_MAIN_CONSOLE: 767 780 { 768 HRESULT hr = pSink->Con.Main.pConsole->i_audioVideoRecSendAudio(abDst, cbDst, u DurationMs);781 HRESULT hr = pSink->Con.Main.pConsole->i_audioVideoRecSendAudio(abDst, cbDst, uPTSMs); 769 782 Assert(hr == S_OK); 770 783 RT_NOREF(hr); … … 775 788 case AVRECCONTAINERTYPE_WEBM: 776 789 { 777 WebMWriter::BlockData_Opus blockData = { abDst, cbDst, u DurationMs };790 WebMWriter::BlockData_Opus blockData = { abDst, cbDst, uPTSMs }; 778 791 rc = pSink->Con.WebM.pWebM->WriteBlock(pSink->Con.WebM.uTrack, &blockData, sizeof(blockData)); 779 792 AssertRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.