obs-ffmpeg: Fix race and deprecation warnings

Attempt to simply shutdown sequence to avoid race between vidoe and
write threads. Can no longer join on write thread from write thread.

Also use codecpar instead of deprecated codec member.
This commit is contained in:
jpark37
2020-07-19 12:44:34 -07:00
parent 06e4b10675
commit ffbc3ed923
2 changed files with 63 additions and 33 deletions

View File

@@ -30,9 +30,15 @@ struct ffmpeg_cfg {
int height;
};
struct ffmpeg_audio_info {
AVStream *stream;
AVCodecContext *ctx;
};
struct ffmpeg_data {
AVStream *video;
AVStream **audio_streams;
AVCodecContext *video_ctx;
struct ffmpeg_audio_info *audio_infos;
AVCodec *acodec;
AVCodec *vcodec;
AVFormatContext *output;