Giter Site home page Giter Site logo

xiph / ogg Goto Github PK

View Code? Open in Web Editor NEW
342.0 32.0 167.0 2.08 MB

Reference implementation of the Ogg media container

License: BSD 3-Clause "New" or "Revised" License

Shell 0.17% C 86.94% CMake 5.60% Makefile 1.30% M4 5.99%
ogg-bitstream libogg codecs ogg

ogg's Issues

CMake issue when linking ogg library into vorbis

So, first I was struggling with finding Ogg Package. In my project, that is builded with CMake, I have both Ogg and Vorbis repositories as submodules:

/deps/ogg/<ogg repository>
/deps/vorbis/<vorbis repository>
CMakeLists.txt

Alongside others dependencies, I have these two sections dedicated to include Ogg and Vorbis in my CMakeLists.txt

(...)
# OGG
add_subdirectory("deps/ogg")
list( APPEND LINK_LIBRARIES ogg )

# Vorbis
set( OGG_ROOT ${PROJECT_SOURCE_DIR}/deps/ogg )
set( OGG_LIBRARY ogg )
add_subdirectory("deps/vorbis")
list( APPEND LINK_LIBRARIES vorbisfile )
(...)

I took a look at FindOgg.cmake (Vorbis repo) to find out that I should hint OGG_ROOT, but should I have defined OGG_LIBRARY as well? I'm kinda new to CMake so that was a bit confusing to me, since I thought that the point with find_package(Ogg) was to define OGG_LIBRARY. If I don't define OGG_LIBRARY, find_package(Ogg) fails.

Anyway, from here everything works fine until linking stage. I got it working after editing Vorbis's CMakeLists.txt:

(...)
    target_link_libraries(vorbis
        PUBLIC Ogg::ogg
        PRIVATE $<$<BOOL:${HAVE_LIBM}>:m>
    )
(...)

Ogg::ogg was being included simply as "ogg", i.e.:
/usr/bin/g++-9 -g (.....) deps/ogg/libogg.a deps/vorbis/lib/libvorbisfile.a deps/vorbis/lib/libvorbis.a ogg (....)
Is this somehow related to how I defined OGG_LIBRARY? I managed to fix it by changing Ogg::ogg to ${OGG_LIBRARY}:

(...)
    target_link_libraries(vorbis
        PUBLIC ${OGG_LIBRARY}
        PRIVATE $<$<BOOL:${HAVE_LIBM}>:m>
    )
(...)

GNU Autotools install doesn't place OggConfig.cmake in place

So the problem here is a package maintainer for a distro or some system may not use the CMake build when making their packages, and instead base their process on the Autotools or other build. When this happens, the OggConfig.cmake file will not be in place, and in turn using find_package in other CMake projects in such system won't work.

Also a new release with the recent CMake improvements would be welcome.

library prefix in MSVC files.

Hello,

currently the MSVC project files define a lib prefix for the ogg library, leading to a libogg.dll shared library, a libogg.lib import library and a libogg_static.lib static library. This is inconsistent with the output generated by CMake, which in the current configuration creates a ogg.dll shared library, a ogg.lib import library and a ogg.lib static library.

But how to fix this? It's possible to change the MSVC projects or to set the prefix in the CMake configuration. The lib prefix isn't removed by the linker during runtime linking so one would always need to link against libogg on windows, making it inconsistent across platforms where you link against ogg, making cross platform builds a bit harder (eg. you would need to update the CMakelists.txt of the vorbis project to search for libogg too instead of just searching for ogg). On the other hand it would break compatibility in the sense that clients who use libogg in their project file, causing link error until the linker dependency is changed from libogg.lib to ogg.lib.

CMake support

Dear All,

since I found no online IRC client to contact the devs of multiple projects, this is my entry point.

I am a user of SFML, a cross-platform GUI project that has an audio module that heavily depends on Xiph.org projects. Since I am an HPC GPGPU developer living on Windows but targeting linux clusters, CMake is the bread and butter for my life, as is for most cross-platform developers. If you are not familiar with it, consider taking a look. I tend to use always the latest unreleased versions of MSVC I need to build most of my own dependencies from source.

SFML has nice CMake support, but it's dependencies do not. While Xiph.org projects do provide some outdated Visual Studio solution files, moving to CMake has a meta-makefile would make life easier on your part too. Creating installer packages with (CPack) and creating unit tests (CTest) or getting distributed build automation (CDash) comes at a few lines of scripting only. CMake is not easily mastered, but pays off in the long run.

I would be willing to conitrubte to CMakeifying libOGG and libFLAC, and based on it other Xiph.org projects could adopt the build system easily. I have been using CMake for a while now for my own projects, and feel that I could put together PROPER CMake support. If you could give me a jump-start as to what platform-specific things are done by the current machinery, I could get started with a prototype, if you see fit.

I am a heavily overburdened person, so the speed at which I could work on this is not much, but I would like to contribute to the greater good.

ogg.def problem with mingw-w64

when compile with cmake/mingw64 with msys2 shell
ogg.def is used
LIBRARY must be set to libogg, and then the executables will looking for libogg.dll, and not ogg.dll like now

flac and opus don't use a .def, and it works fine
is it necessary to use ogg.def for win32?

install msys2 from msys2.org
install mingw64 toolchain, mingw64 cmake

git clone opus in a dir ......src/opus

cd build/opus
export CFLAGS="-D_FORTIFY_SOURCE=0"
cmake -G "MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make -DWITH_STACK_PROTECTOR=OFF 
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DWITH_OGG=ON  ../../src/opus

if you build libsndfile for example, it will lookfor ogg.dll and not libogg.dll
if you set LIBRARY libogg it will be OK

but it would be simpler to make like flac or opus, withiut a def file

missing ogg_uint64_t in configuration generated by cmake

include/ogg/config_types.h:24:10: error: ‘ogg_uint64_t’ does not name a type; did you mean ‘ogg_int64_t’?
 typedef  ogg_uint64_t;
          ^~~~~~~~~~~~
          ogg_int64_t

I am getting this error on linux, gcc with cmake generated project.
Has the unsigned type been removed?

gcc 7.x warns about overflowing an object's maximum size

In function ‘_os_lacing_expand’,
    inlined from ‘ogg_stream_pagein.constprop’ at framing.c:814:6:
framing.c:215:8: warning: argument 2 range [18446744073709551484, 18446744073709551612] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
     ret=_ogg_realloc(os->lacing_vals,lacing_storage*sizeof(*os->lacing_vals));
     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


In file included from framing.c:26:0:
framing.c: In function ‘ogg_stream_pagein.constprop’:
/usr/include/stdlib.h:549:14: note: in a call to allocation function ‘realloc’ declared here
 extern void *realloc (void *__ptr, size_t __size)
              ^~~~~~~

In function ‘_os_lacing_expand’,
    inlined from ‘ogg_stream_pagein.constprop’ at framing.c:814:6:
framing.c:221:8: warning: argument 2 range [18446744073709551352, 18446744073709551608] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
     ret=_ogg_realloc(os->granule_vals,lacing_storage*
     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                      sizeof(*os->granule_vals));
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~

Feel free to add -Wall -pedantic CFLAGS to help catch these if they're not showing up. Cheers.

build system: add meson build system

Hello

meson has some advantages over cmake:

  • a bit faster
  • a lot nicer syntax, close to python
  • better and simpler cross platform support
  • Windows support is better
  • wrap system for dependencies

Version info in ogg.h

Many other projects (zlib, png, SDL2, ...) embed version info in header file. I think ogg could also benefit from that. Yes, I'm aware of version info in pc files but that's not an option on Windows.

Please do not rewrite public history

I'm aware that this github repo is only mirror for git.xiph.org/ogg.git and they had diverged a bit. But it's really bad idea to rewrite history instead of merging.

Tag v1.3.4 release

@tmatth asked me to make a new release. I'm slowly going through the accumulated PRs and issues to get things ready to go.

If you haven't tested the ogg development tree recently, now is a good time!

Clang's static code analysis flagged three warnings against the latest master branch

https://github.com/dreamer/dosbox-staging/commit/3a219326b6e01175316ff461d41ec3d4ab556572/checks#step:6:110

2019-09-26T07:58:23.6518222Z analyze-build: INFO: /home/runner/work/dosbox-staging/dosbox-staging/src/libs/decoders/internal/ogg/src/bitwise.c:98:12: warning: Array access (via field 'ptr') results in a null pointer dereference
2019-09-26T07:58:23.6519776Z analyze-build: INFO:   b->ptr[0]|=value<<b->endbit;
2019-09-26T07:58:23.6520495Z analyze-build: INFO:      ~~~   ^
2019-09-26T07:58:23.6521232Z analyze-build: INFO: /home/runner/work/dosbox-staging/dosbox-staging/src/libs/decoders/internal/ogg/src/bitwise.c:209:7: warning: 2nd function call argument is an uninitialized value
2019-09-26T07:58:23.6521886Z analyze-build: INFO:       w(b,(unsigned long)(ptr[i]),8);
2019-09-26T07:58:23.6522659Z analyze-build: INFO:       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-09-26T07:58:23.6523468Z analyze-build: INFO: /home/runner/work/dosbox-staging/dosbox-staging/src/libs/decoders/internal/ogg/src/bitwise.c:223:7: warning: 2nd function call argument is an uninitialized value
2019-09-26T07:58:23.6524092Z analyze-build: INFO:       w(b,(unsigned long)(ptr[bytes]),bits);
2019-09-26T07:58:23.6524658Z analyze-build: INFO:       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-09-26T07:58:23.6525200Z analyze-build: INFO: 3 warnings generated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.