Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwriting PES and mux/demux errors. #8

Open
andersc opened this issue Jul 2, 2020 · 9 comments
Open

Overwriting PES and mux/demux errors. #8

andersc opened this issue Jul 2, 2020 · 9 comments

Comments

@andersc
Copy link

andersc commented Jul 2, 2020

Just want to let you know that I fixed a bunch of errors in the multiplexer and demux in my fork if you want to fix in your project.

Fixes here -> My fork

In general..

Using std::string to work with binary (non string) data is a bad idea
The PES Header is destroyed in some cases
The data is corrupt when building some size PES frames..

If you run the unit tests I made you will catch all of the errors that I found so far..

I also added mBroken to indicate broken PES frames.

You can close this at any time.. This is the only way for me to make you aware of the errors since we decided not to merge my fork earlier I can't create pull requests.

/Anders

@akanchi
Copy link
Owner

akanchi commented Jul 4, 2020

I will confirm these issue, thanks

@maddanio
Copy link

@andersc can you outline the neccessary fixes? we also used a fork and are restrcutruring a bit. also your code seems to have moved into a repo which has no shared history with this one, so its hard to merge

@maddanio
Copy link

I just checked, the only use of string is in PMTElementInfo, should that be replaces by vector or such?

@andersc
Copy link
Author

andersc commented Jul 28, 2020

@maddanio I made so many changes to the original repo it's not possible for me to be that specific. Just fork my clone to get to where I'm at ->

https://github.com/Unit-X/mpegts

Then just pullrequest from there.

/Anders

@maddanio
Copy link

Ok, i tried porting your unit tests, but I think its too hard, so i switched to your fork. One thing: in both versions the demuxer is sensitive to the block size it is fed. Basically the simple buffer borders must somehow align with the demuxer granularity, otherwise things just fail oddly. I would advice a streaming input here, i.e. either an std istream or a callback. Easiest would likely be the latter, and then plug that into simple buffer.

@andersc
Copy link
Author

andersc commented Jul 29, 2020

OK. Great you found a bug. Would it be possible for you to write a failing unit test? Then I'll fix it. Or provide more detailed information.

@maddanio
Copy link

Hmm, thats tricky, I think you kinda assert that packet size is divisible by 188 in your tests, which seems to be a magic number. its kinda obvious though that it is fragile like that, as the demuxer very rarely checks for emptiness of the buffer, i.e. it being used up, but happily reads from it the rest of the time. in debug mode that will probably trigger the assertions in the simple buffer

@maddanio
Copy link

let me try...

@maddanio
Copy link

OwnZones/mpegts#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants