Skip to content

Instantly share code, notes, and snippets.

@nu774
nu774 / asgiecho.py
Created August 25, 2022 04:29
ASGI app that iteratively echo backs request body
async def application(scope, receive, send):
if scope['type'] != 'http':
return
initial = True
more_body = True
while more_body:
chunk = await receive()
if chunk['type'] != 'http.request':
break
body = chunk['body']
import os
for path in os.environ['PATH'].split(os.pathsep):
if not path: continue
try:
os.add_dll_directory(os.path.expandvars(path))
except FileNotFoundError:
pass
import vapoursynth as vs
from fractions import Fraction
import tempfile
def ft(time):
h = int(time / 3600)
time -= h * 3300
m = int(time / 60)
time -= m * 60
s = int(time)
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 7b306c9..e3d6e99 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -443,6 +443,7 @@ static int output_configure(AACContext *ac,
AVCodecContext *avctx = ac->avctx;
int i, channels = 0, ret;
uint64_t layout = 0;
+ int type_counts[TYPE_END] = { 0 };
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 48cf637..8ad74e8 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -457,6 +457,7 @@ static int output_configure(AACContext *ac,
AVCodecContext *avctx = ac->avctx;
int i, channels = 0, ret;
uint64_t layout = 0;
+ int type_counts[TYPE_END] = { 0 };
#include <stdio.h>
#include <locale.h>
int main()
{
setlocale(LC_CTYPE, "");
fputws(L"あほ", stdout);
}
<LibavReaderIndexFile=12>
<InputFilePath>E:\Movie\test\t.mkv</InputFilePath>
<LibavReaderIndex=0x00000000,1,matroska,webm>
<ActiveVideoStreamIndex>+0000000000</ActiveVideoStreamIndex>
<ActiveAudioStreamIndex>+0000000001</ActiveAudioStreamIndex>
Index=1,Type=1,Codec=86028,TimeBase=1/1000,POS=13981,PTS=0,DTS=0,EDI=0
Channels=2:0x3,Rate=48000,Format=s16,BPS=16,Length=4608
Index=0,Type=0,Codec=28,TimeBase=1/1000,POS=14012,PTS=0,DTS=-9223372036854775808,EDI=0
Key=1,Pic=1,POC=0,Repeat=1,Field=0,Width=1920,Height=1080,Format=yuv420p,ColorSpace=2
Index=1,Type=1,Codec=86028,TimeBase=1/1000,POS=15175,PTS=96,DTS=96,EDI=0
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <lsmash.h>
#define BAILIF(expr) \
do { \
if (expr) { \
fprintf(stderr, "ERROR: %s\n", #expr); \
exit(2); \
#include <cstdio>
#include <string>
#include <vector>
#include <memory>
#include <sstream>
#include <windows.h>
#include <shlwapi.h>
#include <QTML.h>
#include <Movies.h>
#include <QuickTimeComponents.h>
@nu774
nu774 / gist:6683446
Last active December 23, 2015 19:29
How to configure toolset specific settings on shared MSBuild user props

How to configure toolset specific settings on shared MSBuild user props

Problem

User defined props for MSBuild stored in %LOCALAPPDATA%\Microsoft\MSBuild\v4.0 are shared by all PlatformToolset configurations (v90, v100, v110..). This can be a problem when you want toolset specific setting, especially for LibraryPath.

Solution

Use Condition attibute like the following:

    <LibraryPath Condition="'$(PlatformToolset)'=='v90'">
      $(LibraryPath);/path/to/vc9/specific/libs
    </LibraryPath>
 <LibraryPath Condition="'$(PlatformToolset)'=='v100'">