AviSynth+ outputs audio in the same format as the OS, so assuming little endian formats as input on big endian OSes results in nothing but static.
Unified · Split
| @@ -42,6 +42,13 @@ · 41 unmodified lines | ||
| 42 | 42 | #define AVISYNTH_LIB AVISYNTH_NAME SLIBSUF |
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | +/* Endianness guards for audio */ | |
| 46 | +#if HAVE_BIGENDIAN | |
| 47 | + #define PCM(format) (AV_CODEC_ID_PCM_ ## format ## BE) | |
| 48 | +#else | |
| 49 | + #define PCM(format) (AV_CODEC_ID_PCM_ ## format ## LE) | |
| 50 | +#endif | |
| 51 | + | |
| 45 | 52 | #include <avisynth/avisynth_c.h> |
| 46 | 53 | |
| 47 | 54 | typedef struct AviSynthLibrary { |
| @@ -513,16 +520,16 @@ static int avisynth_create_stream_audio(AVFormatContext *s, AVStream *st) · 465 unmodified lines | ||
| 513 | 520 | st->codecpar->codec_id = AV_CODEC_ID_PCM_U8; |
| 514 | 521 | break; |
| 515 | 522 | case AVS_SAMPLE_INT16: |
| 516 | − st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; | |
| 523 | + st->codecpar->codec_id = PCM(S16); | |
| 517 | 524 | break; |
| 518 | 525 | case AVS_SAMPLE_INT24: |
| 519 | − st->codecpar->codec_id = AV_CODEC_ID_PCM_S24LE; | |
| 526 | + st->codecpar->codec_id = PCM(S24); | |
| 520 | 527 | break; |
| 521 | 528 | case AVS_SAMPLE_INT32: |
| 522 | − st->codecpar->codec_id = AV_CODEC_ID_PCM_S32LE; | |
| 529 | + st->codecpar->codec_id = PCM(S32); | |
| 523 | 530 | break; |
| 524 | 531 | case AVS_SAMPLE_FLOAT: |
| 525 | − st->codecpar->codec_id = AV_CODEC_ID_PCM_F32LE; | |
| 532 | + st->codecpar->codec_id = PCM(F32); | |
| 526 | 533 | break; |
| 527 | 534 | default: |
| 528 | 535 | av_log(s, AV_LOG_ERROR, |