I have some simple code that that tries to play CD audio from a CD, It works around 50% of the time. The other times it crashes with a critical error in the heap with the call stack pointing to a free in Win32DebugOutputMsg. I am using 3.0.20 of libvlc. Here is the code I am using to play the CD.
Code:
libvlc_instance_t * pVLCInstance = m_libvlc_new(0, NULL);if (pVLCInstance){libvlc_media_t * pVLCMedia = m_libvlc_media_new_location(pVLCInstance, "cdda:///e:/");if (pVLCMedia){m_libvlc_media_parse_with_options(pVLCMedia, libvlc_media_fetch_network, 10000);libvlc_media_list_t * pVLCMediaList = m_libvlc_media_list_new(pVLCInstance);if (pVLCMediaList){m_libvlc_media_list_add_media(pVLCMediaList, pVLCMedia);libvlc_media_list_player_t *pVLCMediaListPlayer = m_libvlc_media_list_player_new(pVLCInstance);if (pVLCMediaListPlayer){m_libvlc_media_list_player_set_media_list(pVLCMediaListPlayer, pVLCMediaList);int iCount = m_libvlc_media_list_count(pVLCMediaList);m_libvlc_media_list_player_play(pVLCMediaListPlayer);Sleep(20000);m_libvlc_media_list_player_stop(pVLCMediaListPlayer);m_libvlc_media_list_player_release(pVLCMediaListPlayer);pVLCMediaListPlayer = NULL;}m_libvlc_media_list_release(pVLCMediaList);pVLCMediaList = NULL;}m_libvlc_media_release(pVLCMedia);pVLCMedia = NULL;}m_libvlc_release(pVLCInstance);}}
Here is a picture of the callstack.
https://drive.google.com/file/d/1YEd8d7 … drive_link
Any ideas, The Crash appears to happen after the call to “m_libvlc_media_list_player_play” and the debug output is as follows
Code:
main generic debug: keeping audio outputmain input debug: Creating an input for 'cdda:///e:/'main input debug: using timeshift granularity of 50 MiBmain input debug: using timeshift path: C:\Users\matt.DCA\AppData\Local\Tempmain input debug: `cdda:///e:/' gives access `cdda' demux `any' path `/e:/'main input source debug: creating demux: access="cdda" demux='any' location='/e:/' file="e:\"main demux debug: looking for access_demux module matching "cdda": 15 candidatescdda demux debug: using winNT/2K/XP ioctl layermain demux debug: no access_demux modules matchedmain stream debug: creating access: cdda:///e:/main stream debug: (path: e:\)main stream debug: looking for access module matching "cdda": 27 candidatescdda stream debug: using winNT/2K/XP ioctl layercdda stream debug: p_sectors: 0, 0cdda stream debug: p_sectors: 1, 14921cdda stream debug: p_sectors: 2, 38956cdda stream debug: p_sectors: 3, 59237cdda stream debug: p_sectors: 4, 80256cdda stream debug: p_sectors: 5, 97353cdda stream debug: p_sectors: 6, 115171cdda stream debug: p_sectors: 7, 130919cdda stream debug: p_sectors: 8, 146766cdda stream debug: p_sectors: 9, 164434cdda stream debug: p_sectors: 10, 184589cdda stream debug: p_sectors: 11, 203297cdda stream debug: p_sectors: 12, 220026cdda stream debug: p_sectors: 13, 238495cdda stream debug: p_sectors: 14, 252452cdda stream debug: p_sectors: 15, 269195cdda stream debug: p_sectors: 16, 285428Critical error detected c0000374VLCTest.exe has triggered a breakpoint.
It looks like something is corrupting the heap and at a random free it crashes. Is there something wrong with my calling code?
Thanks
Statistics: Posted by MattWheatley101 — 22 Apr 2024 10:55