Skip to content

net/hlssink3: Check if buffer pts is `None` instead of `unwrap`

Cocoa Xu requested to merge cocoa/gst-plugins-rs:cx-hlssink3-check-pts-none into main

Sorry that this commit is at most some workaround and I'm not exactly sure if it would cause other issues. But I was wondering if there's any known workaround for the following issue?

This happens randomly and from my best guess, I'd say it might be an issue from the encoder element before this sink...

Any thoughts or suggestions would be highly appreciated!

thread '<unnamed>' panicked at net/hlssink3/src/hlssink3/imp.rs:264:62:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at core/src/panicking.rs:221:5:
panic in a function that cannot unwind
stack backtrace:
   0:     0xfffea9560580 - std::backtrace_rs::backtrace::libunwind::trace::hd070a479823e7636
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0xfffea9560580 - std::backtrace_rs::backtrace::trace_unsynchronized::hd7494ab4dff58c75
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0xfffea9560580 - std::sys::backtrace::_print_fmt::h0b658f76a5b030ff
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:66:9
   3:     0xfffea9560580 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hb96435122ab7425b
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:39:26
   4:     0xfffea957c904 - core::fmt::rt::Argument::fmt::h4f3a088b13b4d86c
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/fmt/rt.rs:177:76
   5:     0xfffea957c904 - core::fmt::write::h7c561ca7c8433f95
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/fmt/mod.rs:1178:21
   6:     0xfffea955e460 - std::io::Write::write_fmt::hf7d9a5a24b8e20d9
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/io/mod.rs:1823:15
   7:     0xfffea95617b8 - std::sys::backtrace::BacktraceLock::print::hbf27e6b0477dae16
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:42:9
   8:     0xfffea95617b8 - std::panicking::default_hook::{{closure}}::hede73113e98cf4b8
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:266:22
   9:     0xfffea9561320 - std::panicking::default_hook::he405b118d658ffce
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:293:9
  10:     0xfffea9561ef4 - std::panicking::rust_panic_with_hook::hd458a5a67c8fc44a
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:797:13
  11:     0xfffea9561c5c - std::panicking::begin_panic_handler::{{closure}}::h4b3f096abbb4f13c
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:664:13
  12:     0xfffea9560a7c - std::sys::backtrace::__rust_end_short_backtrace::hf33da5adf3f15f28
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:170:18
  13:     0xfffea9561954 - rust_begin_unwind
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5
  14:     0xfffea94f1d8c - core::panicking::panic_nounwind_fmt::runtime::h8dcd5cd5121a3ed6
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:112:18
  15:     0xfffea94f1d8c - core::panicking::panic_nounwind_fmt::hf40a377f5ad5ac1e
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:122:5
  16:     0xfffea94f1e04 - core::panicking::panic_nounwind::h10b041b95427555f
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:221:5
  17:     0xfffea94f1f34 - core::panicking::panic_cannot_unwind::hdc935726f7d7d43e
                               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:310:5
  18:     0xfffea9500394 - glib::closure::Closure::new_unsafe::marshal::ha292aa61fa1a099c
                               at /root/.cargo/git/checkouts/gtk-rs-core-7be42ca38bd6361c/3d32a01/glib/src/closure.rs:214:9
  19:     0xfffeabcd6ba4 - g_closure_invoke
  20:     0xfffeabceba3c - <unknown>
  21:     0xfffeabcf5a08 - g_signal_emit_valist
  22:     0xfffeabcf6658 - g_signal_emit
  23:     0xfffeaa717f5c - set_next_filename
                               at /project/gstreamer/_build/../subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c:3899:3
  24:     0xfffeaa70e380 - start_next_fragment
                               at /project/gstreamer/_build/../subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c:2124:3
  25:     0xfffeaa7099ec - complete_or_wait_on_out
                               at /project/gstreamer/_build/../subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c:1328:19
  26:     0xfffeaa70d478 - handle_mq_output
                               at /project/gstreamer/_build/../subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c:1844:9
  27:     0xfffea9fdf0f0 - probe_hook_marshal
                               at /project/gstreamer/_build/../subprojects/gstreamer/gst/gstpad.c:3695:9
  28:     0xfffea265d780 - g_hook_list_marshal
  29:     0xfffea9fdf800 - do_probe_callbacks
                               at /project/gstreamer/_build/../subprojects/gstreamer/gst/gstpad.c:3879:3
  30:     0xfffea9fe3550 - gst_pad_push_data
                               at /project/gstreamer/_build/../subprojects/gstreamer/gst/gstpad.c:4756:3
  31:     0xfffea9fe3d68 - gst_pad_push
                               at /project/gstreamer/_build/../subprojects/gstreamer/gst/gstpad.c:4889:9
  32:     0xfffeabbb8a84 - gst_queue_push_one
                               at /project/gstreamer/_build/../subprojects/gstreamer/plugins/elements/gstqueue.c:1436:16
  33:     0xfffeabbb9868 - gst_queue_loop
                               at /project/gstreamer/_build/../subprojects/gstreamer/plugins/elements/gstqueue.c:1589:9
  34:     0xfffeaa028dbc - gst_task_func
                               at /project/gstreamer/_build/../subprojects/gstreamer/gst/gsttask.c:399:5
  35:     0xfffeaa02a340 - default_func
                               at /project/gstreamer/_build/../subprojects/gstreamer/gst/gsttaskpool.c:70:3
  36:     0xfffea2698e20 - <unknown>
  37:     0xfffea2698484 - <unknown>
  38:     0xffff8cb9c624 - start_thread
  39:     0xffff8c82762c - <unknown>
  40:                0x0 - <unknown>
thread caused non-unwinding panic. aborting.

Merge request reports

Loading