Ticket #4144: decklink.patch

File decklink.patch, 1.0 KB (added by jb_alvarado, 12 years ago)
  • libavdevice/decklink_common.cpp

    diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
    index 9a9e44b..6899bd2 100644
    a b static char *dup_wchar_to_utf8(wchar_t *w)  
    6969}
    7070#define DECKLINK_STR    OLECHAR *
    7171#define DECKLINK_STRDUP dup_wchar_to_utf8
     72#define DECKLINK_FREE(s) SysFreeString(s)
    7273#else
    7374#define DECKLINK_STR    const char *
    7475#define DECKLINK_STRDUP av_strdup
     76/* free() is needed for a string returned by the DeckLink SDL. */
     77#define DECKLINK_FREE(s) free((void *) s)
    7578#endif
    7679
    7780HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName)
    HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName)  
    8184    if (hr != S_OK)
    8285        return hr;
    8386    *displayName = DECKLINK_STRDUP(tmpDisplayName);
    84     /* free() is needed for a string returned by the DeckLink SDL. */
    85     free((void *) tmpDisplayName);
     87    DECKLINK_FREE(tmpDisplayName);
    8688    return hr;
    8789}