Hello, I hope you are alright. It seems you have been absent for quite a while.
I've noticed an issue when playing the MPEG stream from sonde.rtf from the CD-i title Chaos Control (Germany).
The issue is caused by having a 0xff just before a frame header.
I already know the solution but since my fork of pl_mpeg has diverged quite a lot, I can only make suggestions.
Within your implementation of plm_audio_decode_header you didn't seem to be so happy about the synchronization.
One issue I can see here is that next_frame_data_size is never used to calculate the next position.
assert(( self->buffer->bit_index & 7)==0);
int expected_bit_index_after_frame = self->buffer->bit_index + (self->next_frame_data_size<<3);
plm_audio_decode_frame(self);
assert(( self->buffer->bit_index & 7)==0);
if (self->buffer->bit_index < expected_bit_index_after_frame)
{
printf("skip from %d for %d\n",self->buffer->bit_index>>3,expected_bit_index_after_frame - self->buffer->bit_index);
plm_buffer_skip(self->buffer,expected_bit_index_after_frame - self->buffer->bit_index);
}
This has fixed it for me, but it might be possible that only works because I use pl_mpeg behind with a giant buffer of virtual memory.
And I only use the elementary stream parts of pl_mpeg.
Hello, I hope you are alright. It seems you have been absent for quite a while.
I've noticed an issue when playing the MPEG stream from
sonde.rtffrom the CD-i titleChaos Control (Germany).The issue is caused by having a 0xff just before a frame header.
I already know the solution but since my fork of pl_mpeg has diverged quite a lot, I can only make suggestions.
Within your implementation of
plm_audio_decode_headeryou didn't seem to be so happy about the synchronization.One issue I can see here is that next_frame_data_size is never used to calculate the next position.
This has fixed it for me, but it might be possible that only works because I use pl_mpeg behind with a giant buffer of virtual memory.
And I only use the elementary stream parts of pl_mpeg.