mpg123-devel Mailing List for mpg123 (Page 10)
Brought to you by:
sobukus
You can subscribe to this list here.
2006 |
Jan
(2) |
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
(6) |
Jul
(4) |
Aug
(17) |
Sep
(2) |
Oct
(13) |
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(2) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(6) |
Oct
|
Nov
(7) |
Dec
(6) |
2008 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(18) |
May
(16) |
Jun
(10) |
Jul
(13) |
Aug
(14) |
Sep
(12) |
Oct
(32) |
Nov
(12) |
Dec
(33) |
2009 |
Jan
(2) |
Feb
(10) |
Mar
(16) |
Apr
(48) |
May
(92) |
Jun
(68) |
Jul
(37) |
Aug
(28) |
Sep
(61) |
Oct
(43) |
Nov
(33) |
Dec
(48) |
2010 |
Jan
(8) |
Feb
(27) |
Mar
(16) |
Apr
(11) |
May
(34) |
Jun
(27) |
Jul
(15) |
Aug
(16) |
Sep
(24) |
Oct
(14) |
Nov
(17) |
Dec
(9) |
2011 |
Jan
(21) |
Feb
(12) |
Mar
(8) |
Apr
(33) |
May
(2) |
Jun
(29) |
Jul
(16) |
Aug
(27) |
Sep
(27) |
Oct
(11) |
Nov
(16) |
Dec
(4) |
2012 |
Jan
(40) |
Feb
(12) |
Mar
(40) |
Apr
(34) |
May
(32) |
Jun
(6) |
Jul
(7) |
Aug
(13) |
Sep
(8) |
Oct
(12) |
Nov
(14) |
Dec
(5) |
2013 |
Jan
(3) |
Feb
(19) |
Mar
(2) |
Apr
(7) |
May
(30) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(23) |
Oct
(8) |
Nov
(3) |
Dec
(1) |
2014 |
Jan
(2) |
Feb
(2) |
Mar
(1) |
Apr
(9) |
May
(8) |
Jun
(2) |
Jul
|
Aug
(15) |
Sep
(7) |
Oct
(1) |
Nov
(5) |
Dec
|
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
(13) |
Aug
(16) |
Sep
(26) |
Oct
(2) |
Nov
(5) |
Dec
|
2016 |
Jan
(13) |
Feb
(2) |
Mar
(1) |
Apr
(2) |
May
(16) |
Jun
(2) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(2) |
Dec
|
2017 |
Jan
(11) |
Feb
(10) |
Mar
(6) |
Apr
(4) |
May
(3) |
Jun
|
Jul
(8) |
Aug
(4) |
Sep
(2) |
Oct
|
Nov
|
Dec
(11) |
2018 |
Jan
(8) |
Feb
(16) |
Mar
(6) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(5) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
(10) |
Dec
(1) |
2020 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
(13) |
Jun
(9) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(3) |
Apr
(12) |
May
(4) |
Jun
(12) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(68) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
(9) |
Oct
(7) |
Nov
|
Dec
|
2023 |
Jan
(7) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(11) |
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2024 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
(2) |
2025 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Kevin J. <inv...@ya...> - 2019-09-09 21:21:04
|
Hi All, I am currently porting libmpg123 to Windows/ARM64. From the libmpg123 web site, I gathered that Patrick and JonY are responsible for creating the Windows binaries. How can I reach either of them to include the modifications to create the Windows/ARM64 binary? Best regards, Kevin Jones |
From: Thomas O. <tho...@or...> - 2019-08-24 18:08:07
|
Hello there, we got another security bugfix release of mpg123. Still working on the proper feature update 1.26.0. Until then you got the fun to update to version 1.25.12 ------- More credit to OSS-Fuzz. The ID3v2 parser code is not yet as hardened as the actual MPEG decoder. The paranoid can disable it at build-time. If you do not need it, this is a good idea, anyway: Code that is not there, cannot be exploited. Speaking about exploits: The recent crop of bugs trigger a denial of service (crash) worst-case, some invalid ID3 data normally. Code injection maybe not totally ruled out (that one write of a zero byte?), but does not seem easy. Update to be sure that you are only suceptible to as of yet hidden bugs. - libmpg123 -- Fix an out-of-bounds read of maximal two bytes for truncated RVA2 frames (oss-fuzz-bug 15975). The earlier fix around the same location needed one thought more. Actually, another though was needed, oss-fuzz-bug 16009 documents the incomplete fix. -- Fix an invalid write of one zero byte for empty ID3v2 frames that demand de-unsyncing (oss-fuzz-bug 16050). -- Correct preprocessor syntax in mangle.h, no #error in a #define line. (bug 273, thanks to nmlgc). - Fix dynamic build with gcc -fsanitize=address (check for all dl functions before deciding that separate -ldl is not needed). Get it from the usual places … Alrighty then, Thomas |
From: Thomas O. <tho...@or...> - 2019-07-18 12:39:36
|
Am Thu, 18 Jul 2019 12:13:02 +0200 schrieb Reino Wijnsma <rwi...@xs...>: > I see that libmpg123.pc.in > <http://mpg123.org/cgi-bin/scm/mpg123/trunk/libmpg123.pc.in?view=markup> > hasn't been updated in over 11 years and that you haven't considered > my proposal anymore. MayI ask why not? Thanks for asking. I simply forgot. I am working a lot, since over a year, on the mpg123 1.26 feature release, among RL pressure. The recent release of 1.25.11 was prompted by the security bugs found by OSS-Fuzz. So, let's revisit your proposal to include something. You suggested placing @LIBS@ there. That is the list of libraries used to link mpg123 against. This is a supperset of what is needed for libmpg213. On Linux, this is just -lm. On Windows, we got -lshlwapi in addition (-lws2_32 is again only for the mpg123 application itself). We need to separate the libraries in the configure script to only include what is necessary in LIBS.private. For libout123.pc, there is also -ldl, usually. I see that @LIBS@ is actually used for linking libmpg123. That is wrong, but without consequence with linkers that drop unneeded references. We need to separate things in the build system to put the correct set of libs into the .pc files. I'll work on not forgetting this for the 1.26 release. Alrighty then, Thomas |
From: Reino W. <rwi...@xs...> - 2019-07-18 10:13:10
|
On 5-3-2018 1:17, Thomas Orgis <tho...@or...> wrote: > Am Sun, 4 Mar 2018 14:32:17 +0100 > schrieb Reino Wijnsma <rwi...@xs...>: >> --- libmpg123.pc.in.bak 2017-11-30 08:55:41.000000000 +0100 >> +++ libmpg123.pc.in 2018-03-04 01:46:59.203125000 +0100 >> @@ -8,4 +8,5 @@ >> Requires: >> Version: @PACKAGE_VERSION@ >> Libs: -L${libdir} -lmpg123 >> +Libs.private: @LIBS@ >> Cflags: -I${includedir} > I will consider this and also check other .pc files. Thanks. On 18-7-2019 7:52, Thomas Orgis <tho...@or...> wrote: > mpg123 1.25.11 I see that libmpg123.pc.in <http://mpg123.org/cgi-bin/scm/mpg123/trunk/libmpg123.pc.in?view=markup> hasn't been updated in over 11 years and that you haven't considered my proposal anymore. MayI ask why not? -- Reino |
From: Thomas O. <tho...@or...> - 2019-07-18 06:09:01
|
Hi folks, the OSS-Fuzz project integrated mpg123 and thus came a bunch of bugs they found. Please update to the current mpg123 1.25.11 to get rid of them. 1.25.11 ------- So, here is a number of bugs found by OSS-Fuzz. Credit to OSS-Fuzz for the bunch, then. - libmpg123: -- Fix out-of-bounds reads in ID3 parser for unsynced frames. (oss-fuzz-bug 15852) -- Fix out-of-bounds read for RVA2 frames with non-delimited identifier. (oss-fuzz-bug 15852) -- Fix implementation-defined parsing of RVA2 values. (oss-fuzz-bug 15862) -- Fix undefined parsing of APE header for skipping. Also prevent endless loop on premature end of supposed APE header. (oss-fuzz-bug 15864) -- Fix some syntax to make pedantic compiler happy. Alrighty then, Thomas PS: I got no CVEs for these. If downstream distros would like to have some, they are free to allocate numbers. Please tell me in that case, so that I can at least post them to the mpg123 website. |
From: Thomas O. <tho...@or...> - 2019-04-14 11:46:25
|
Yeah, getting rid of these manual ports that pollute the repositories would really be welcomed. CMake is clearly better than curating those. The repository is public for read access. That's no invention of github;-) Just use svn://scm.orgis.org/mpg123/trunk . Happy hacking! Alrighty then, Thomas unterwegs ohne Signatur |
From: <kro...@gm...> - 2019-04-14 11:26:08
|
Well, CMake can definitely simplify things for Windows and Mac. Not sure about sony-psp<div><br /></div><div>Can I get access to the SVN repo for reading? That would make coding and patch exchanging a bit easier</div><div> 12:40, 14 апреля 2019 г., Thomas Orgis <tho...@or...>:<br /><blockquote><p>Hi,<br /><br />am Sun, 14 Apr 2019 11:58:38 +0300<br />schrieb Виталий Кирсанов <<a href="mailto:kro...@gm...">kro...@gm...</a>>: <br /><br /></p><blockquote> I see mpg123 doesn't have CMake support and I could help with this and<br /> write a suite of CMake files.<br /><br /> Would you welcome this and find it needful?<br /></blockquote><p><br />Tricky question. Good that you ask beforehand;-) My first reaction is<br />that mpg123 does not have CMake as build system because I do not prefer<br />it, and I still have that opinion when it comes to UNIX builds. But: We<br />have that manually-curated (not since quite some time) ports directory.<br /><br /> <a href="http://scm.orgis.org/view/mpg123/trunk/ports/">http://scm.orgis.org/view/mpg123/trunk/ports/</a><br /><br />That usually is broken after some mpg123 development and needs major<br />manual intervention, involving the respective IDEs. Can CMake be a<br />better replacement for these? As I see it, a major reason vor CMake is<br />that you can generate native build files for differing platforms,<br />namely Windows stuff.<br /><br />There is a big but to this but: I'd see it as addition to the current<br />build system and the current build system will stay (until I decide to<br />replace it with something simpler, geared to UNIX-like platforms). Not<br />that I am a huge fan of autotools. Build systems suck. Heck, we had<br />plain Makefiles alongside autotools for quite some time until I gave in<br />to get rid of them. But I am way less a fan of CMake on UNIX platforms,<br />where I live. I do lots of software builds with different packaging<br />toolsets, and SCons and CMake are all-too-ready to be a source of<br />trouble/additional work there. Some of this is inherent in the<br />different platform focus of the build systems.<br /><br />If we can replace the custom ports (mainly MSVC) with CMake, and it's<br />trivial enough to keep the CMake stuff up to date when new files are<br />added/renamed, I'd welcome a patch. I won't promise to test it often,<br />but you could set up something automated that does that, anyway.<br />Of course you can use CMake for your Linux builds as well, but I do not<br />see it becoming the primary build system there.<br /><br />Oh, the ports are usually only for building libmpg123, as the console<br />application is not that interesting for most people outside UNIX-like<br />environments. You have to decide if you will keep it at that. If<br />libmpg123 is all you need, the job is a lot easier. Only complication<br />is the assembly code for different CPUs, where a request is pending to<br />convert them from AT&T to Intel syntax (will do for next release). But<br />you save yourself a lot of system specifics if the application is not<br />included. So far, it can be built using Mingw/MSYS or Cygwin.<br /><br />The mpg123 project is not very busy. You can send the patch via this<br />list, or add it to the tracker. You could even send it to<br /><a href="mailto:mai...@mp...">mai...@mp...</a>. IF fact, you just reminded me that the -devel<br />lists still exists separately. I planned on merging it with the -user<br />list, due to the very low volume. It's a mature project, there is not<br />that much to discuss. But anyhow, we can keep the discussion here.<br /><br /><br />Alrighty then,<br /><br />Thomas<br /><br /><br />_______________________________________________<br />mpg123-devel mailing list<br /><a href="mailto:mpg...@li...">mpg...@li...</a><br /><a href="https://lists.sourceforge.net/lists/listinfo/mpg123-devel">https://lists.sourceforge.net/lists/listinfo/mpg123-devel</a><br /></p></blockquote><br /><br />-- <br />Отправлено из мобильного приложения Яндекс.Почты </div> |
From: Thomas O. <tho...@or...> - 2019-04-14 09:39:57
|
Hi, am Sun, 14 Apr 2019 11:58:38 +0300 schrieb Виталий Кирсанов <kro...@gm...>: > I see mpg123 doesn't have CMake support and I could help with this and > write a suite of CMake files. > > Would you welcome this and find it needful? Tricky question. Good that you ask beforehand;-) My first reaction is that mpg123 does not have CMake as build system because I do not prefer it, and I still have that opinion when it comes to UNIX builds. But: We have that manually-curated (not since quite some time) ports directory. http://scm.orgis.org/view/mpg123/trunk/ports/ That usually is broken after some mpg123 development and needs major manual intervention, involving the respective IDEs. Can CMake be a better replacement for these? As I see it, a major reason vor CMake is that you can generate native build files for differing platforms, namely Windows stuff. There is a big but to this but: I'd see it as addition to the current build system and the current build system will stay (until I decide to replace it with something simpler, geared to UNIX-like platforms). Not that I am a huge fan of autotools. Build systems suck. Heck, we had plain Makefiles alongside autotools for quite some time until I gave in to get rid of them. But I am way less a fan of CMake on UNIX platforms, where I live. I do lots of software builds with different packaging toolsets, and SCons and CMake are all-too-ready to be a source of trouble/additional work there. Some of this is inherent in the different platform focus of the build systems. If we can replace the custom ports (mainly MSVC) with CMake, and it's trivial enough to keep the CMake stuff up to date when new files are added/renamed, I'd welcome a patch. I won't promise to test it often, but you could set up something automated that does that, anyway. Of course you can use CMake for your Linux builds as well, but I do not see it becoming the primary build system there. Oh, the ports are usually only for building libmpg123, as the console application is not that interesting for most people outside UNIX-like environments. You have to decide if you will keep it at that. If libmpg123 is all you need, the job is a lot easier. Only complication is the assembly code for different CPUs, where a request is pending to convert them from AT&T to Intel syntax (will do for next release). But you save yourself a lot of system specifics if the application is not included. So far, it can be built using Mingw/MSYS or Cygwin. The mpg123 project is not very busy. You can send the patch via this list, or add it to the tracker. You could even send it to mai...@mp.... IF fact, you just reminded me that the -devel lists still exists separately. I planned on merging it with the -user list, due to the very low volume. It's a mature project, there is not that much to discuss. But anyhow, we can keep the discussion here. Alrighty then, Thomas |
From: Виталий К. <kro...@gm...> - 2019-04-14 08:58:58
|
Hi everyone and nice to meet you. I see mpg123 doesn't have CMake support and I could help with this and write a suite of CMake files. Would you welcome this and find it needful? If yes what is the proper way to contribute? I mean sending you a patch then passing through a review and so on. BR, Vitaly Kirsanov skype: vkirsan |
From: Sven B. <s.b...@gm...> - 2018-10-13 14:44:53
|
I got it myself, the destination handle was null, which is no good ;). Thanks anyway, now it works also on C# side :). Thank you and have a nice weekend :)! Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Sven Baus [mailto:s.b...@gm...] Gesendet: Samstag, 13. Oktober 2018 16:22 An: 'Thomas Orgis' Cc: mpg...@li... Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index So, thanks for your help. I got one more step near: [DllImport(Mpg123Dll)]public unsafe static extern int mpg123_index(IntPtr mh, long **offsets, long *step, ulong *fill); [DllImport(Mpg123Dll)]public unsafe static extern int mpg123_set_index(IntPtr mh, long* offsets, long step, ulong fill); public static Boolean CopyIndex(IntPtr _sourceHandle,IntPtr _destinationHandle) { Boolean copiedIndex = false; unsafe { long* offsets = null; long step = 0; ulong fill = 0; int result = MPGImport.mpg123_index(_sourceHandle, &offsets, &step, &fill); if (result == (int)MPGImport.mpg123_errors.MPG123_OK) { result = MPGImport.mpg123_set_index(_destinationHandle, offsets, step, fill); <---- result is always -1 //MPG123_ERR = -1, /**< Generic Error */ if (result == (int)mpg123_errors.MPG123_OK) { copiedIndex = true; } } } return copiedIndex; } Do you have an idea, why this could fail? Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Thomas Orgis [mailto:tho...@or...] Gesendet: Freitag, 12. Oktober 2018 11:37 An: s.baus86 Cc: mpg...@li... Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index Am Fri, 12 Oct 2018 11:18:18 +0200 schrieb "s.baus86" <s.b...@gm...>: > Ok, I see, pIndex has a different initialisation. What I googled, it > is a pointer and you hand the adress of that pointer to mpg123_index, > correct? Yes. You want the address of the internal storage of the index copied to your pointer variable. Alrighty then, Thomas _______________________________________________ mpg123-devel mailing list mpg...@li... https://lists.sourceforge.net/lists/listinfo/mpg123-devel |
From: Sven B. <s.b...@gm...> - 2018-10-13 14:22:10
|
So, thanks for your help. I got one more step near: [DllImport(Mpg123Dll)]public unsafe static extern int mpg123_index(IntPtr mh, long **offsets, long *step, ulong *fill); [DllImport(Mpg123Dll)]public unsafe static extern int mpg123_set_index(IntPtr mh, long* offsets, long step, ulong fill); public static Boolean CopyIndex(IntPtr _sourceHandle,IntPtr _destinationHandle) { Boolean copiedIndex = false; unsafe { long* offsets = null; long step = 0; ulong fill = 0; int result = MPGImport.mpg123_index(_sourceHandle, &offsets, &step, &fill); if (result == (int)MPGImport.mpg123_errors.MPG123_OK) { result = MPGImport.mpg123_set_index(_destinationHandle, offsets, step, fill); <---- result is always -1 //MPG123_ERR = -1, /**< Generic Error */ if (result == (int)mpg123_errors.MPG123_OK) { copiedIndex = true; } } } return copiedIndex; } Do you have an idea, why this could fail? Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Thomas Orgis [mailto:tho...@or...] Gesendet: Freitag, 12. Oktober 2018 11:37 An: s.baus86 Cc: mpg...@li... Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index Am Fri, 12 Oct 2018 11:18:18 +0200 schrieb "s.baus86" <s.b...@gm...>: > Ok, I see, pIndex has a different initialisation. What I googled, it > is a pointer and you hand the adress of that pointer to mpg123_index, > correct? Yes. You want the address of the internal storage of the index copied to your pointer variable. Alrighty then, Thomas |
From: s.baus86 <s.b...@gm...> - 2018-10-12 09:57:19
|
Ok, thanks for your mail. I'm currently handing in an empty pointer, but keep getting system.accessviolation exceptions. Any idea, why? Mit freundlichen GrüßenSven Baus0175/4950309 -------- Ursprüngliche Nachricht --------Von: Thomas Orgis <tho...@or...> Datum: 12.10.18 11:37 (GMT+01:00) An: "s.baus86" <s.b...@gm...> Cc: mpg...@li... Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index Am Fri, 12 Oct 2018 11:18:18 +0200 schrieb "s.baus86" <s.b...@gm...>: > Ok, I see, pIndex has a different initialisation. What I googled, it > is a pointer and you hand the adress of that pointer to mpg123_index, > correct? Yes. You want the address of the internal storage of the index copied to your pointer variable. Alrighty then, Thomas |
From: Thomas O. <tho...@or...> - 2018-10-12 09:37:16
|
Am Fri, 12 Oct 2018 11:18:18 +0200 schrieb "s.baus86" <s.b...@gm...>: > Ok, I see, pIndex has a different initialisation. What I googled, it > is a pointer and you hand the adress of that pointer to mpg123_index, > correct? Yes. You want the address of the internal storage of the index copied to your pointer variable. Alrighty then, Thomas |
From: s.baus86 <s.b...@gm...> - 2018-10-12 09:18:29
|
Ok, I see, pIndex has a different initialisation. What I googled, it is a pointer and you hand the adress of that pointer to mpg123_index, correct? Sorry if I'm asking to much, but currently its a bit mysterious to me, how this works. Mit freundlichen GrüßenSven Baus0175/4950309 -------- Ursprüngliche Nachricht --------Von: Thomas Orgis <tho...@or...> Datum: 29.09.18 21:58 (GMT+01:00) An: Sven Baus <s.b...@gm...> Cc: mpg...@li... Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index Am Sat, 29 Sep 2018 16:45:28 +0200 schrieb "Sven Baus" <s.b...@gm...>: > So I think the following code should work, correct? > > off_t* pIndex; > off_t* pStep; > size_t* pFill; > > mpg123_index(pHandle,pIndex,pStep,pFill); Not quite. More like this: off_t* pIndex; off_t pStep; size_t pFill; mpg123_index(pHandle,&pIndex,&pStep,&pFill); The difference is crucial and explains access violations. You see use of this in src/term.c, in print_index() (and yes, the printing formats there should not just cast things to long, other parts of mpg123 do better). Alrighty then, Thomas |
From: Thomas O. <tho...@or...> - 2018-09-29 19:58:48
|
Am Sat, 29 Sep 2018 16:45:28 +0200 schrieb "Sven Baus" <s.b...@gm...>: > So I think the following code should work, correct? > > off_t* pIndex; > off_t* pStep; > size_t* pFill; > > mpg123_index(pHandle,pIndex,pStep,pFill); Not quite. More like this: off_t* pIndex; off_t pStep; size_t pFill; mpg123_index(pHandle,&pIndex,&pStep,&pFill); The difference is crucial and explains access violations. You see use of this in src/term.c, in print_index() (and yes, the printing formats there should not just cast things to long, other parts of mpg123 do better). Alrighty then, Thomas |
From: Sven B. <s.b...@gm...> - 2018-09-29 14:45:51
|
So I think the following code should work, correct? off_t* pIndex; off_t* pStep; size_t* pFill; mpg123_index(pHandle,pIndex,pStep,pFill); I'm currently transforming the C code to C# (I use a wrapper directly to libmpg123-0.dll) and I'm trying to understand on how to use the function, since I'm currently just getting access violation exceptions. The current code looks like this: IntPtr pOffset = Marshal.AllocHGlobal(sizeof(int)); IntPtr pStep = IntPtr.Zero; IntPtr pFill = IntPtr.Zero; int result = MPGImport.mpg123_index(mp3ScanHandle,pOffset,pStep,pFill); Sincerely Sven Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Thomas Orgis [mailto:tho...@or...] Gesendet: Donnerstag, 27. September 2018 23:14 An: Sven Baus Cc: mpg...@li... Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index Am Thu, 27 Sep 2018 19:20:37 +0200 schrieb "Sven Baus" <s.b...@gm...>: > What do you mean by re-reading the index? Reading back into a data structure When you have stored it externally. Generally, you are supposed to copy the index from mpg123_index() to someplace before continuing work with the handle. You just get a pointer to internal memory! > I thought > mpg123_index() wants a pointer to an array It wants a pointer to a pointer, which can be an array in C. You need to read up and understand more about the relationship between pointers and arrays in C. It is not that tricky, but you must be familiar with the meanings. > code example would be nice, of how to retreave the index and hand it to > another handle ;). > When the original handle is not modified in between, you can just give the value of the pointer from mpg123_index() and the fill and step values directly to mpg123_set_index(). It will make an internal copy. You do not need to allocate any arrays. Alrighty then, Thomas |
From: Thomas O. <tho...@or...> - 2018-09-27 21:13:54
|
Am Thu, 27 Sep 2018 19:20:37 +0200 schrieb "Sven Baus" <s.b...@gm...>: > What do you mean by re-reading the index? Reading back into a data structure When you have stored it externally. Generally, you are supposed to copy the index from mpg123_index() to someplace before continuing work with the handle. You just get a pointer to internal memory! > I thought > mpg123_index() wants a pointer to an array It wants a pointer to a pointer, which can be an array in C. You need to read up and understand more about the relationship between pointers and arrays in C. It is not that tricky, but you must be familiar with the meanings. > code example would be nice, of how to retreave the index and hand it to > another handle ;). > When the original handle is not modified in between, you can just give the value of the pointer from mpg123_index() and the fill and step values directly to mpg123_set_index(). It will make an internal copy. You do not need to allocate any arrays. Alrighty then, Thomas |
From: Sven B. <s.b...@gm...> - 2018-09-27 17:21:00
|
Hello, so just a more question: You said " Of course, when re-reading the index for handing it to mpg123_set_index(), you need to allocate fill elements of the correct type and then store the values there." What do you mean by re-reading the index? I thought mpg123_index() wants a pointer to an array and tells after the call, how much the array has been filled, or am I missunderstanding something? Maybe a code example would be nice, of how to retreave the index and hand it to another handle ;). Thanks for your answers Sven Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Thomas Orgis [mailto:tho...@or...] Gesendet: Dienstag, 25. September 2018 12:57 An: mpg...@li... Cc: s.baus86 Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index Am Tue, 25 Sep 2018 11:30:18 +0200 schrieb "s.baus86" <s.b...@gm...>: > Thanks for your mail. How should the array be initialised? The argument to mpg123_index() is just a pointer without associated memory. You get the size of the associated memory via fill. Of course, when re-reading the index for handing it to mpg123_set_index(), you need to allocate fill elements of the correct type and then store the values there. > Sorry for asking, but I'm not that familiar with C. You need some understanding of C with pointers and data types. If in doubt, try to read a bit more, the net is ripe with tutorials and examples. > int[] indexArray = new int[100]?! Or is it that simple? If 100 is the number of elements, not some arbitrary fixed value, this sounds about right for C++ (I'd write int* instead of int[]) except for the fact that int is not the correct type. It is off_t. That an be identical to int, but mostly will not be. Alrighty then, Thomas |
From: Thomas O. <tho...@or...> - 2018-09-25 10:57:41
|
Am Tue, 25 Sep 2018 11:30:18 +0200 schrieb "s.baus86" <s.b...@gm...>: > Thanks for your mail. How should the array be initialised? The argument to mpg123_index() is just a pointer without associated memory. You get the size of the associated memory via fill. Of course, when re-reading the index for handing it to mpg123_set_index(), you need to allocate fill elements of the correct type and then store the values there. > Sorry for asking, but I'm not that familiar with C. You need some understanding of C with pointers and data types. If in doubt, try to read a bit more, the net is ripe with tutorials and examples. > int[] indexArray = new int[100]?! Or is it that simple? If 100 is the number of elements, not some arbitrary fixed value, this sounds about right for C++ (I'd write int* instead of int[]) except for the fact that int is not the correct type. It is off_t. That an be identical to int, but mostly will not be. Alrighty then, Thomas |
From: s.baus86 <s.b...@gm...> - 2018-09-25 09:30:30
|
Hello, Thanks for your mail. How should the array be initialised? Sorry for asking, but I'm not that familiar with C. What kind of array should it be? I don't think its a int[] indexArray = new int[100]?! Or is it that simple? SincerelySven Mit freundlichen GrüßenSven Baus0175/4950309 -------- Ursprüngliche Nachricht --------Von: Thomas Orgis <tho...@or...> Datum: 25.09.18 10:38 (GMT+01:00) An: mpg...@li... Betreff: Re: [mpg123-devel] Code example of mpg123_index and mpg123_set_index Am Mon, 24 Sep 2018 19:49:08 +0200 schrieb "Sven Baus" <s.b...@gm...>: > https://www.mpg123.de/api/group__mpg123__seek.shtml the definitions, but > what about the input parameters? How should the be initialised, etc?! Well, the parameters to mpg123_index() are just addresses to store the named values, including the pointer to the internal index array. You make a copy of that, then hand a pointer to the copy and the other values to mpg123_set_index(), which will make an internal copy again. Alrighty then, Thomas _______________________________________________ mpg123-devel mailing list mpg...@li... https://lists.sourceforge.net/lists/listinfo/mpg123-devel |
From: Thomas O. <tho...@or...> - 2018-09-25 08:39:07
|
Am Mon, 24 Sep 2018 19:49:08 +0200 schrieb "Sven Baus" <s.b...@gm...>: > https://www.mpg123.de/api/group__mpg123__seek.shtml the definitions, but > what about the input parameters? How should the be initialised, etc?! Well, the parameters to mpg123_index() are just addresses to store the named values, including the pointer to the internal index array. You make a copy of that, then hand a pointer to the copy and the other values to mpg123_set_index(), which will make an internal copy again. Alrighty then, Thomas |
From: Sven B. <s.b...@gm...> - 2018-09-24 17:49:32
|
Hello everybody, I'm trying to use mpg123_index and mpg123_set_index to scan a mp3 file and afterwards apply the scanned index to a playback handle. Are there any code examples, of how to use the functions? I can see here https://www.mpg123.de/api/group__mpg123__seek.shtml the definitions, but what about the input parameters? How should the be initialised, etc?! Thanks for any help! Sincerely Sven Mit freundlichen Grüßen Sven Baus 0175/49 50 309 |
From: Thomas O. <tho...@or...> - 2018-05-29 13:24:36
|
Hi, I'm sorry that I lack time and fluency in C#. I have a basic issue with such: > int errorScanHandle = … > mp3ScanHandle = MPGImport.mpg123_new(null, > (IntPtr)errorScanHandle); When you do (IntPtr)errorScanHandle, does that take the address of the integer errorScanHandle or does it cast its value to an address? > //this.mp3Handle = mp3ScanHandle; > <-- if uncommented, the application crashes > //TODO: Delete old handle > > MPGImport.mpg123_seek(this.mp3Handle,samples,(int) SeekOrigin.Begin); If these were just C pointers, I wouldn't see why it should crash, unless your locking is not safe. Is the decoder thread also blocking on this.mutex? Alrighty then, Thomas |
From: Sven B. <s.b...@gm...> - 2018-05-27 16:48:45
|
Hello again, sorry for another mail, but I got rid of the bad handle error. A process outside the code caused the handle to be reset to IntPtr.Zero which caused the bad handle error. Now I almost got it, but I'm stuck a bit: This code runs only, if I don't switch the handle: tScan = new Thread(delegate() { int errorScanHandle = (int)MPGImport.mpg123_errors.MPG123_OK; IntPtr mp3ScanHandle = IntPtr.Zero; mp3ScanHandle = MPGImport.mpg123_new(null, (IntPtr)errorScanHandle); if (mp3ScanHandle != IntPtr.Zero) { if (MPGImport.mpg123_open(mp3ScanHandle, _filename) != (int)MPGImport.mpg123_errors.MPG123_OK) { log.error("Error opening file: " + MPGImport.mpg123_strerror(mp3ScanHandle)); } log.debug("Starting mpg123_scan ..."); int scanResult = MPGImport.mpg123_scan(mp3ScanHandle); log.debug("mpg123_scan finished"); if (scanResult != (int)MPGImport.mpg123_errors.MPG123_OK) { log.error("Error scanning file: " + MPGImport.mpg123_strerror(mp3ScanHandle)); } else { //Swap the mp3 handle this.mutex.WaitOne(); if (this.mp3Handle != IntPtr.Zero) { int samples = MPGImport.mpg123_tell(this.mp3Handle); log.debug("Swapping mp3 handle!"); //this.mp3Handle = mp3ScanHandle; <-- if uncommented, the application crashes //TODO: Delete old handle MPGImport.mpg123_seek(this.mp3Handle,samples,(int) SeekOrigin.Begin); } else { MPGImport.mpg123_delete(mp3ScanHandle); mp3ScanHandle = IntPtr.Zero; } this.mutex.ReleaseMutex(); } } else { log.error("Failed to instance scan handle!"); } tScan = null; }); tScan.IsBackground = true; tScan.Start(); Do you have an idea, why the swap could fail? Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Sven Baus [mailto:s.b...@gm...] Gesendet: Sonntag, 27. Mai 2018 10:58 An: 'Thomas Orgis' Cc: 'mpg...@li...' Betreff: AW: [mpg123-devel] mpg123_length not correct Hi Thomas, so, I tried to get in contact with the developer, but there is no response on my mails. I also tried to get help on stackoverflow, but there is also nobody able to help me. Your idea with switching the handle doesn't sound to bad, but I'm currently facing the issue, that I always get a bad handle error. Some code: tScan = new Thread(delegate() { int errorScanHandle = (int)MPGImport.mpg123_errors.MPG123_OK; IntPtr mp3ScanHandle = IntPtr.Zero; mp3ScanHandle = MPGImport.mpg123_new(null, (IntPtr)errorScanHandle); if (mp3ScanHandle != IntPtr.Zero) { if (MPGImport.mpg123_open(mp3ScanHandle, _filename) != (int)MPGImport.mpg123_errors.MPG123_OK) { log.error("Error opening file: " + MPGImport.mpg123_strerror(mp3ScanHandle)); } } if (mp3ScanHandle != IntPtr.Zero) { log.debug("Starting mpg123_scan ..."); if (MPGImport.mpg123_scan(mp3ScanHandle) != (int)MPGImport.mpg123_errors.MPG123_OK) { log.error("Error scanning file: " + MPGImport.mpg123_strerror(mp3ScanHandle)); } log.debug("mpg123_scan finished"); kvpScannedHandle = new KeyValuePair<string, IntPtr>(_filename, mp3ScanHandle); //Swap the mp3 handle this.mutex.WaitOne(); int samples = MPGImport.mpg123_tell(this.mp3Handle); if (samples != (int)MPGImport.mpg123_errors.MPG123_OK) { int errorCode = MPGImport.mpg123_errcode(this.mp3Handle); if (errorCode != (int) MPGImport.mpg123_errors.MPG123_BAD_HANDLE) { log.error("Failed to get the sample position from the handle! " + MPGImport.mpg123_plain_strerror(errorCode)); } else { log.error("Failed to get the sample position from the handle! Bad Handle"); } } else { log.debug("Swapping mp3 handle!"); MPGImport.mpg123_delete(this.mp3Handle); this.mp3Handle = IntPtr.Zero; this.mp3Handle = mp3ScanHandle; MPGImport.mpg123_seek(this.mp3Handle,samples,(int) SeekOrigin.Begin); } this.mutex.ReleaseMutex(); } tScan = null; }); tScan.IsBackground = true; tScan.Start(); The code runs into the error " Failed to get the sample position from the handle! Bad Handle", but I have no idea, why :(. Do you know, why this error is triggered? Thanks for your response. Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Thomas Orgis [mailto:tho...@or...] Gesendet: Sonntag, 25. Februar 2018 17:32 An: Sven Baus Cc: mpg...@li... Betreff: Re: [mpg123-devel] mpg123_length not correct Am Sun, 25 Feb 2018 15:46:08 +0100 schrieb "Sven Baus" <s.b...@gm...>: > You ship a CLR ready dll with mpg123? Erm, well, we have the binding code / MSVC project in our repo from an external contributor. It for shure would need some work since its last update. But we do not provide binaries built from that. There is a DLL in the windows binary downloads, that is built using MinGW. I cannot contribute any personal experience with the CLR stuff. > Concerning the error string bug, it gets really strange now: > I have no idea, why, but it seems to me, that whenever the string > would be a correct message, the function crashes. Really weird stuff happening usually means that there is memory corruption. An invalid / too large error code results in a specific conditional being triggered. Proper values get looked up in a char* array. Is there weird index math going on? Or is there a fundamental difference between char* array[] = { "text", "more text" }; return array[0]; and return "text"; ? > I wait also for a reply of the author of MPGIMPORT Let's wait for that. If this works out and the behaviour can be fixed, we might drop our 2008clr port for this project. The mpg123 project doesn't really have the people to support this ourselves. We have a very simple test case for what is going on. Heck, you might even ask Microsoft;-) Alrighty then, Thomas |
From: Sven B. <s.b...@gm...> - 2018-05-27 08:58:21
|
Hi Thomas, so, I tried to get in contact with the developer, but there is no response on my mails. I also tried to get help on stackoverflow, but there is also nobody able to help me. Your idea with switching the handle doesn't sound to bad, but I'm currently facing the issue, that I always get a bad handle error. Some code: tScan = new Thread(delegate() { int errorScanHandle = (int)MPGImport.mpg123_errors.MPG123_OK; IntPtr mp3ScanHandle = IntPtr.Zero; mp3ScanHandle = MPGImport.mpg123_new(null, (IntPtr)errorScanHandle); if (mp3ScanHandle != IntPtr.Zero) { if (MPGImport.mpg123_open(mp3ScanHandle, _filename) != (int)MPGImport.mpg123_errors.MPG123_OK) { log.error("Error opening file: " + MPGImport.mpg123_strerror(mp3ScanHandle)); } } if (mp3ScanHandle != IntPtr.Zero) { log.debug("Starting mpg123_scan ..."); if (MPGImport.mpg123_scan(mp3ScanHandle) != (int)MPGImport.mpg123_errors.MPG123_OK) { log.error("Error scanning file: " + MPGImport.mpg123_strerror(mp3ScanHandle)); } log.debug("mpg123_scan finished"); kvpScannedHandle = new KeyValuePair<string, IntPtr>(_filename, mp3ScanHandle); //Swap the mp3 handle this.mutex.WaitOne(); int samples = MPGImport.mpg123_tell(this.mp3Handle); if (samples != (int)MPGImport.mpg123_errors.MPG123_OK) { int errorCode = MPGImport.mpg123_errcode(this.mp3Handle); if (errorCode != (int) MPGImport.mpg123_errors.MPG123_BAD_HANDLE) { log.error("Failed to get the sample position from the handle! " + MPGImport.mpg123_plain_strerror(errorCode)); } else { log.error("Failed to get the sample position from the handle! Bad Handle"); } } else { log.debug("Swapping mp3 handle!"); MPGImport.mpg123_delete(this.mp3Handle); this.mp3Handle = IntPtr.Zero; this.mp3Handle = mp3ScanHandle; MPGImport.mpg123_seek(this.mp3Handle,samples,(int) SeekOrigin.Begin); } this.mutex.ReleaseMutex(); } tScan = null; }); tScan.IsBackground = true; tScan.Start(); The code runs into the error " Failed to get the sample position from the handle! Bad Handle", but I have no idea, why :(. Do you know, why this error is triggered? Thanks for your response. Mit freundlichen Grüßen Sven Baus 0175/49 50 309 -----Ursprüngliche Nachricht----- Von: Thomas Orgis [mailto:tho...@or...] Gesendet: Sonntag, 25. Februar 2018 17:32 An: Sven Baus Cc: mpg...@li... Betreff: Re: [mpg123-devel] mpg123_length not correct Am Sun, 25 Feb 2018 15:46:08 +0100 schrieb "Sven Baus" <s.b...@gm...>: > You ship a CLR ready dll with mpg123? Erm, well, we have the binding code / MSVC project in our repo from an external contributor. It for shure would need some work since its last update. But we do not provide binaries built from that. There is a DLL in the windows binary downloads, that is built using MinGW. I cannot contribute any personal experience with the CLR stuff. > Concerning the error string bug, it gets really strange now: > I have no idea, why, but it seems to me, that whenever the string > would be a correct message, the function crashes. Really weird stuff happening usually means that there is memory corruption. An invalid / too large error code results in a specific conditional being triggered. Proper values get looked up in a char* array. Is there weird index math going on? Or is there a fundamental difference between char* array[] = { "text", "more text" }; return array[0]; and return "text"; ? > I wait also for a reply of the author of MPGIMPORT Let's wait for that. If this works out and the behaviour can be fixed, we might drop our 2008clr port for this project. The mpg123 project doesn't really have the people to support this ourselves. We have a very simple test case for what is going on. Heck, you might even ask Microsoft;-) Alrighty then, Thomas |