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

fix avformat struct definitions #153

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

marler8997
Copy link
Contributor

@marler8997 marler8997 commented Jan 22, 2021

I removed all the fields that were not being used from the MpegTS* structs. Then I looked at the differences between the struct definitions between what was committed and what was in the ffmpeg repo. For the difference that mattered I checked the git history and added a version check to include the field.

Futhermore, the MpegTSWriteStream struct supposedly contained a pointer to a MpegTSService struct, however, I could not find any version of ffmpeg where this field exists. I removed it and removed the 2 references to it.

After these changes, I'm able to build picam and I no longer get a segfault in hls_write_packet when dereferencing ts_st->service (see a backtrace here #144 (comment)).

this is fix 1 of 2 for issue #144

I removed all the fields that were not being used from the MpegTS* structs.  Then I looked at the differences between the struct definitions between what was committed and what was in the ffmpeg repo. For the difference that mattered I checked the git history and added a version check to include the field.

Futhermore, the MpegTSWriteStream struct supposedly contained a pointer to a MpegTSService struct, however, I could not find any version of ffmpeg where this field exists.  I removed it and removed the 2 references to it.

After these changes, I'm able to build picam and I no longer get a segfault in hls_write_packet when dereferencing ts_st->service (see a backtrace here iizukanao#144 (comment)).
@@ -347,9 +315,6 @@ int hls_write_packet(HTTPLiveStreaming *hls, AVPacket *pkt, int split) {
for (i = 0; i < nb_streams; i++) {
ts_st = hls->format_ctx->streams[i]->priv_data;
stream_cc[i] = ts_st->cc;
if (i == 0) {
Copy link
Contributor Author

@marler8997 marler8997 Jan 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note I don't really know what these 3 lines or the 3 lines below (369-371) were for. They just had to be removed because there's no references to a service structure in ts_st, so I just removed them. Feel free to enlighten me if this is incorrect.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That code was to retain the value of continuity counter for Program Map Table (PID 4096) between two consecutive *.ts files. I've added the code for it at commit 6684cfe.

@iizukanao iizukanao merged commit d419f4a into iizukanao:master Feb 4, 2021
@iizukanao
Copy link
Owner

@marler8997
Sorry for taking a long time to review this pull request. picam runs fine now. I really appreciate your effort.

@marler8997 marler8997 deleted the fix_avformat_structs branch February 4, 2021 16:03
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

Successfully merging this pull request may close these issues.

2 participants