aboutsummaryrefslogtreecommitdiff
path: root/transcode_talker.c
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-09-14 15:58:34 +0800
committerMistivia <i@mistivia.com>2025-09-14 15:58:34 +0800
commitc5c3ec74e8f39995a060e105e95db1d8d8908180 (patch)
tree4ce4d7fc15906012d97e06a725ed5d537328de5c /transcode_talker.c
parent1c53bb350cfa2ec6941a5f24571f54c0ee5ce387 (diff)
delete unused config
Diffstat (limited to 'transcode_talker.c')
-rw-r--r--transcode_talker.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/transcode_talker.c b/transcode_talker.c
index 5dd9715..3e2f05c 100644
--- a/transcode_talker.c
+++ b/transcode_talker.c
@@ -126,6 +126,10 @@ static void update_m3u8(HlsList *lst, int last_seg) {
char out_filename[256];
tmp_local_filename("/tmp/ezlive", out_filename);
FILE *fp = fopen(out_filename, "w");
+ if (fp == NULL) {
+ fprintf(stderr, "failed to open %s for output.\n", out_filename);
+ exit(-1);
+ }
if (lst->len == 0) {
fprintf(fp, "\n");
} else {
@@ -247,6 +251,14 @@ void* TranscodeTalker_main (void *vself) {
segment_start_pts = pts_time;
tmp_local_filename("/tmp/ezlive", out_filename);
output_stream = start_new_output_file(in_fmt_ctx, &out_fmt_ctx, out_filename, audio_stream_index, video_stream_index);
+ if (pkt.stream_index == video_stream_index)
+ out_stream = output_stream.video_stream;
+ else if (pkt.stream_index == audio_stream_index)
+ out_stream = output_stream.audio_stream;
+ else {
+ av_packet_unref(&pkt);
+ continue;
+ }
}
}
pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);