VIDEO: Correctly handle raw Elementary Stream MPEG Videos#6496
VIDEO: Correctly handle raw Elementary Stream MPEG Videos#6496bluegr merged 5 commits intoscummvm:masterfrom
Conversation
Recognize the type of the stream in .mpg files (ES or PS) In case of ES (Elementary Streams) bypass the PES header parsing process and directly feed the MPEG decoder the raw data. Remove warning that appears when opening the ND logo when opening the game 3mice1-pl Changes made in how ES stream packets are pushed in the _demuxer queue for decoding in function queueNextPacket Made sure that the ES stream is handled in the MPEGPSDecoder::MPEGPSDemuxer class entirely
|
This new PR doesn't seem to take my comments of #6491 into account. |
Recognize the type of the stream in .mpg files (ES or PS) In case of ES (Elementary Streams) bypass the PES header parsing process and directly feed the MPEG decoder the raw data. Remove warning that appears when opening the ND logo when opening the game 3mice1-pl Changes made in how ES stream packets are pushed in the _demuxer queue for decoding in function queueNextPacket Made sure that the ES stream is handled in the MPEGPSDecoder::MPEGPSDemuxer class entirely
|
I'm sorry, I must have made a mistake, I've resolved it |
video/mpegps_decoder.cpp
Outdated
| stream->seek(startPosition); | ||
|
|
||
| // If it is a Sequence Header (ES Stream), pass the stream to a Elementary Stream handler. | ||
| if (header == kStartCodeSequenceHeader) |
There was a problem hiding this comment.
Please use curly braces even if the if block only has one line.
In addition, you have to set _isESStream value even when the start code is not recognised (to false I would say).
There was a problem hiding this comment.
Yep got it
And I'm sorry, I should realize this before pushing
There was a problem hiding this comment.
Now, you are not following our code formatting conventions (hugging braces). :)
There was a problem hiding this comment.
Done. Hopefully, this time...
Add curly braces for one line if statements Set the value of _isEstream to false if stream is not recognized.
Fixed the part not following the coding convention.
video/mpegps_decoder.cpp
Outdated
| // ES streams start with the Sequence Header which has a start code of 0x1b3 | ||
| int64 startPosition = stream->pos(); | ||
| uint32 header = stream->readUint32BE(); | ||
| stream->seek(startPosition); |
There was a problem hiding this comment.
You already know that you've read 4 bytes above. So, you can remove startPosition and simplify the seek as follows:
stream->seek(-4, SEEK_CUR);
There was a problem hiding this comment.
All right, got it
|
Why the previous PR was closed? |
Simplified the code for reading the first four bytes of the stream in queueNextPacket for header checking
|
Thanks for your work! Looks good now, squashing |
|
This is so annoying. I see that it is a THIRD PR on the same issue, the previous two were closed by the author for no reason. |
Recognize the type of the stream in .mpg files (ES or PS) In case of ES (Elementary Streams) bypass the PES header parsing process and directly feed the MPEG decoder the raw data. Remove warning that appears when opening the ND
logo when opening the game 3mice1-pl
Changes made in how ES stream packets are pushed
in the _demuxer queue for decoding in function queueNextPacket Made sure that the ES stream is handled in
the MPEGPSDecoder::MPEGPSDemuxer class entirely