unsafe fn log_callback_inner(
    buf: &mut Vec<u8>,
    logger: &dyn log::Log,
    metadata: log::Metadata,
    avc: *const libc::c_void,
    fmt: *const c_char,
    vl: *mut libc::c_void,
) {
    append_vprintf(buf, fmt, vl);

    if !buf
        .last()
        .map(|&b| b == b'\r' || b == b'\n')
        .unwrap_or(false)
    {
        return; // save for next time.
    }

    // ffmpeg log lines apparently sometimes have these low-ASCII control characters.
    // av_log_default_callback "sanitizes" them; match its behavior.
    for c in buf.iter_mut() {
        if *c < 0x08 || (*c > 0x0D && *c < 0x20) {
            *c = b'?';
        }
    }

    let s = String::from_utf8_lossy(&buf[0..buf.len() - 1]);
    let target = metadata.target();
    logger.log(
        &log::RecordBuilder::new()
            .args(format_args!("{:?}: {}", avc, &s))
            .metadata(metadata)
            .module_path(Some(target))
            .build(),
    );
    buf.clear();
}
// Portion of log_callback_int that needs the thread-local data.
Portion of log_callback_int that needs the thread-local data.
Portion of log_callback_int that needs the thread - local data .
unsafe fn log_callback_inner(
    buf: &mut Vec<u8>,
    logger: &dyn log::Log,
    metadata: log::Metadata,
    avc: *const libc::c_void,
    fmt: *const c_char,
    vl: *mut libc::c_void,
) {
    append_vprintf(buf, fmt, vl);
    if !buf
        .last()
        .map(|&b| b == b'\r' || b == b'\n')
        .unwrap_or(false)
    {
        return; // save for next time.
    }
    // ffmpeg log lines apparently sometimes have these low-ASCII control characters.
    // av_log_default_callback "sanitizes" them; match its behavior.
    for c in buf.iter_mut() {
        if *c < 0x08 || (*c > 0x0D && *c < 0x20) {
            *c = b'?';
        }
    }
    let s = String::from_utf8_lossy(&buf[0..buf.len() - 1]);
    let target = metadata.target();
    logger.log(
        &log::RecordBuilder::new()
            .args(format_args!("{:?}: {}", avc, &s))
            .metadata(metadata)
            .module_path(Some(target))
            .build(),
    );
    buf.clear();
}
unsafe fn log_callback_inner ( buf : & mut Vec < u8 > , logger : & dyn log :: Log , metadata : log :: Metadata , avc : * const libc :: c_void , fmt : * const c_char , vl : * mut libc :: c_void , ) { append_vprintf ( buf , fmt , vl ) ; if ! buf . last ( ) . map ( | & b | b == b'\r' || b == b'\n' ) . unwrap_or ( false ) { return ; // save for next time. } // ffmpeg log lines apparently sometimes have these low-ASCII control characters. // av_log_default_callback "sanitizes" them; match its behavior. for c in buf . iter_mut ( ) { if * c < 0x08 || ( * c > 0x0D && * c < 0x20 ) { * c = b'?' ; } } let s = String :: from_utf8_lossy ( & buf [ 0 .. buf . len ( ) - 1 ] ) ; let target = metadata . target ( ) ; logger . log ( & log :: RecordBuilder :: new ( ) . args ( format_args ! ( " " avc s ) ) . metadata ( metadata ) . module_path ( Some ( target ) ) . build ( ) , ) ; buf . clear ( ) ; }
Portion of log_callback_int that needs the thread-local data.
Portion of log_callback_int that needs the thread - local data .
buf
&mut Vec<u8>
logger
&dyn log::Log
metadata
log::Metadata
avc
*const libc::c_void
fmt
*const c_char
vl
*mut libc::c_void
buf
&mut Vec<u8>
logger
&dyn log::Log
metadata
log::Metadata
avc
*const libc::c_void
fmt
*const c_char
vl
*mut libc::c_void