obs-ffmpeg: Fix incompatible-pointer-types warning

This commit is contained in:
tytan652 2022-07-31 18:34:51 +02:00 committed by Jim
parent 4303e31268
commit 9d0c48af33

View File

@ -1168,7 +1168,7 @@ static bool write_header(struct ffmpeg_output *stream, struct ffmpeg_data *data)
return true; return true;
} }
static bool ffmpeg_mpegts_data(void *data, struct encoder_packet *packet) static void ffmpeg_mpegts_data(void *data, struct encoder_packet *packet)
{ {
struct ffmpeg_output *stream = data; struct ffmpeg_output *stream = data;
struct ffmpeg_data *ff_data = &stream->ff_data; struct ffmpeg_data *ff_data = &stream->ff_data;
@ -1191,28 +1191,27 @@ static bool ffmpeg_mpegts_data(void *data, struct encoder_packet *packet)
} }
if (!stream->active) if (!stream->active)
return 0; return;
/* encoder failure */ /* encoder failure */
if (!packet) { if (!packet) {
obs_output_signal_stop(stream->output, OBS_OUTPUT_ENCODE_ERROR); obs_output_signal_stop(stream->output, OBS_OUTPUT_ENCODE_ERROR);
ffmpeg_mpegts_deactivate(stream); ffmpeg_mpegts_deactivate(stream);
return 0; return;
} }
if (stopping(stream)) { if (stopping(stream)) {
if (packet->sys_dts_usec >= (int64_t)stream->stop_ts) { if (packet->sys_dts_usec >= (int64_t)stream->stop_ts) {
ffmpeg_mpegts_deactivate(stream); ffmpeg_mpegts_deactivate(stream);
return 0; return;
} }
} }
mpegts_write_packet(stream, packet); mpegts_write_packet(stream, packet);
return 1; return;
fail: fail:
obs_output_signal_stop(stream->output, code); obs_output_signal_stop(stream->output, code);
ffmpeg_mpegts_full_stop(stream); ffmpeg_mpegts_full_stop(stream);
return false;
} }
static obs_properties_t *ffmpeg_mpegts_properties(void *unused) static obs_properties_t *ffmpeg_mpegts_properties(void *unused)