Skip to content

Instantly share code, notes, and snippets.

@alitavakol
alitavakol / simplest_player.c
Created September 23, 2023 07:41 — forked from mashingan/simplest_player.c
Simplest example of creating player using FFMpeg and SDL2. Currently with choppy audio playing.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <windows.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
//#include <libavutil/frame.h>
#include <SDL2/SDL.h>
@alitavakol
alitavakol / utf-16_encoder.cpp
Created September 15, 2019 07:44 — forked from bcachet/utf-16_encoder.cpp
Convert string to wstring to write to file with utf-16 encoding
// Windows version
#include <string>
#include <iostream>
#include <fstream>
#include <locale>
#include <codecvt>
#include <Windows.h>
std::wstring decode(const std::string &str, int codePage = GetACP())
{