OSDN Git Service

Updated OggEnc2 binaries to v2.87 using libvorbis v1.3.5 and aoTuV v6.03_2015 (2014...
[lamexp/LameXP.git] / etc / Patches / AC3Filter-valdec-STDOUT+LavcFixes.V4.diff
1  valib/auto_file.cpp              | 13 +++++++++++++
2  valib/parsers/ffmpeg_decoder.cpp |  2 ++
3  2 files changed, 15 insertions(+)
4
5 diff --git a/valib/auto_file.cpp b/valib/auto_file.cpp
6 index 8f1dec3..91ae397 100644
7 --- a/valib/auto_file.cpp
8 +++ b/valib/auto_file.cpp
9 @@ -90,6 +90,19 @@ bool
10  AutoFile::open(const char *filename, const char *mode)
11  {
12    if (f) close();
13 +  
14 +  if(_stricmp(filename, "-") == 0)
15 +  {
16 +    const bool flag_r = (strchr(mode, 'r') != NULL);
17 +    const bool flag_w = (strchr(mode, 'w') != NULL) || (strchr(mode, 'a') != NULL);
18 +    if((!(flag_r && flag_w)) && (flag_r || flag_w))
19 +    {
20 +      f = (flag_r) ? stdin : stdout;
21 +      own_file = false;
22 +    }
23 +    return is_open();
24 +  }
25 +  
26    f = fopen_utf8(filename, mode);
27    if (f)
28    {
29 diff --git a/valib/parsers/ffmpeg_decoder.cpp b/valib/parsers/ffmpeg_decoder.cpp
30 index b6b20d7..864f83c 100644
31 --- a/valib/parsers/ffmpeg_decoder.cpp
32 +++ b/valib/parsers/ffmpeg_decoder.cpp
33 @@ -10,6 +10,8 @@ extern "C"
34  {
35  #define __STDC_CONSTANT_MACROS
36  #include "../../3rdparty/ffmpeg/include/libavcodec/avcodec.h"
37 +#include "../../3rdparty/ffmpeg/include/libavutil/mem.h"
38 +#include "../../3rdparty/ffmpeg/include/libavutil/channel_layout.h"
39  }
40  
41  static const string module = "FfmpegDecoder";