project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 98e42a249e7891d295228ff19892450ba1f09092 | 1 | enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type,
enum AVMediaType type)
{
if (av_match_name("segment", fmt->name) || av_match_name("ssegment", fmt->name)) {
fmt = av_guess_... | 25,499 |
FFmpeg | e9f4001a30c563a840614048629055769f6f7020 | 1 | static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
{
AVIOContext *pb = s->pb;
int ret;
/* parse fmt header */
*st = av_new_stream(s, 0);
if (!*st)
return AVERROR(ENOMEM);
ff_get_wav_header(pb, (*st)->codec, size);
if (ret < 0)
return r... | 25,502 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int get_float64(QEMUFile *f, void *pv, size_t size)
{
float64 *v = pv;
*v = make_float64(qemu_get_be64(f));
return 0;
}
| 25,503 |
FFmpeg | ccb8f674995ded871ac725833b5efefce0ad63de | 1 | static int chunk_mux_init(AVFormatContext *s)
{
WebMChunkContext *wc = s->priv_data;
AVFormatContext *oc;
int ret;
ret = avformat_alloc_output_context2(&wc->avf, wc->oformat, NULL, NULL);
if (ret < 0)
return ret;
oc = wc->avf;
oc->interrupt_callback = s->interrupt_callba... | 25,504 |
qemu | b49f7ead8d222bcb8df0388f3177002f3e33d046 | 0 | void commit_active_start(const char *job_id, BlockDriverState *bs,
BlockDriverState *base, int64_t speed,
BlockdevOnError on_error,
BlockCompletionFunc *cb,
void *opaque, Error **errp)
{
int64_t length, base_le... | 25,507 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void virtio_blk_handle_flush(VirtIOBlockReq *req, MultiReqBuffer *mrb)
{
block_acct_start(bdrv_get_stats(req->dev->bs), &req->acct, 0,
BLOCK_ACCT_FLUSH);
/*
* Make sure all outstanding writes are posted to the backing device.
*/
virtio_submit_multiwrite(req->de... | 25,508 |
qemu | 2399d4e7cec22ecf1c51062d2ebfd45220dbaace | 0 | static void gen_store_exclusive(DisasContext *s, int rd, int rt, int rt2,
TCGv_i64 addr, int size, int is_pair)
{
/* if (env->exclusive_addr == addr && env->exclusive_val == [addr]
* && (!is_pair || env->exclusive_high == [addr + datasize])) {
* [addr] = {Rt};
... | 25,509 |
qemu | cb51ac2ffe3649eb8f5c65dccc2012f0ba2c6b12 | 0 | void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)
{
VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
GArray *table_offsets;
unsigned dsdt, rsdt;
GArray *tables_blob = tables->table_data;
table_offsets = g_array_new(false, true /* clear */,
... | 25,511 |
qemu | 5fb8084f31e9df7f0b2d63cfd3d10645d29b5eab | 0 | static void versatile_init(QEMUMachineInitArgs *args, int board_id)
{
ARMCPU *cpu;
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
qemu_irq *cpu_pic;
qemu_irq pic[32];
qemu_irq sic[32];
DeviceState *dev, *sysctl;
SysBusDevice *busdev;
... | 25,512 |
FFmpeg | 6c9c8b06b32013c58101f27991eae251bf4eb485 | 0 | static int interp(RA144Context *ractx, int16_t *out, int block_num,
int copyold, int energy)
{
int work[10];
int a = block_num + 1;
int b = NBLOCKS - a;
int x;
// Interpolate block coefficients from the this frame forth block and
// last frame forth block
for (x=... | 25,513 |
qemu | 242acf3af4605adce933906bdc053b2414181ec7 | 0 | sorecvfrom(so)
struct socket *so;
{
struct sockaddr_in addr;
int addrlen = sizeof(struct sockaddr_in);
DEBUG_CALL("sorecvfrom");
DEBUG_ARG("so = %lx", (long)so);
if (so->so_type == IPPROTO_ICMP) { /* This is a "ping" reply */
char buff[256];
int len;
len = recvfrom(so->s, buff, 256, 0,
... | 25,514 |
qemu | b01fe89e91268c6b02720735643020746610e6d8 | 0 | char *qmp_human_monitor_command(const char *command_line, bool has_cpu_index,
int64_t cpu_index, Error **errp)
{
char *output = NULL;
Monitor *old_mon, hmp;
memset(&hmp, 0, sizeof(hmp));
hmp.outbuf = qstring_new();
hmp.skip_flush = true;
old_mon = cur_... | 25,516 |
qemu | 9307c4c1d93939db9b04117b654253af5113dc21 | 0 | static void do_screen_dump(int argc, const char **argv)
{
if (argc != 2) {
help_cmd(argv[0]);
return;
}
vga_screen_dump(argv[1]);
}
| 25,517 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static int rndis_get_response(USBNetState *s, uint8_t *buf)
{
int ret = 0;
struct rndis_response *r = s->rndis_resp.tqh_first;
if (!r)
return ret;
TAILQ_REMOVE(&s->rndis_resp, r, entries);
ret = r->length;
memcpy(buf, r->buf, r->length);
qemu_free(r);
return ret;
... | 25,518 |
qemu | ef76dc59fa5203d146a2acf85a0ad5a5971a4824 | 0 | START_TEST(single_quote_string)
{
int i;
struct {
const char *encoded;
const char *decoded;
} test_cases[] = {
{ "'hello world'", "hello world" },
{ "'the quick brown fox \\' jumped over the fence'",
"the quick brown fox ' jumped over the fence" },
... | 25,520 |
qemu | 03e6e5017757645f00b2f3b4f3a257973985e455 | 0 | static inline void compute_hflags(CPUMIPSState *env)
{
env->hflags &= ~(MIPS_HFLAG_COP1X | MIPS_HFLAG_64 | MIPS_HFLAG_CP0 |
MIPS_HFLAG_F64 | MIPS_HFLAG_FPU | MIPS_HFLAG_KSU |
MIPS_HFLAG_UX);
if (!(env->CP0_Status & (1 << CP0St_EXL)) &&
!(env->CP0_Status & ... | 25,521 |
qemu | 51b19ebe4320f3dcd93cea71235c1219318ddfd2 | 0 | static void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq)
{
V9fsVirtioState *v = (V9fsVirtioState *)vdev;
V9fsState *s = &v->state;
V9fsPDU *pdu;
ssize_t len;
while ((pdu = pdu_alloc(s))) {
struct {
uint32_t size_le;
uint8_t id;
uint16_t ... | 25,522 |
qemu | 91cda45b69e45a089f9989979a65db3f710c9925 | 0 | hwaddr ppc_hash64_get_phys_page_debug(CPUPPCState *env, target_ulong addr)
{
struct mmu_ctx_hash64 ctx;
if (unlikely(ppc_hash64_get_physical_address(env, &ctx, addr, 0, ACCESS_INT)
!= 0)) {
return -1;
}
return ctx.raddr & TARGET_PAGE_MASK;
}
| 25,523 |
FFmpeg | 3b64e3ea45c580c5e158c086f2eb7c65635fc33b | 0 | int ff_framesync_request_frame(FFFrameSync *fs, AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
int input, ret;
if ((ret = ff_framesync_process_frame(fs, 0)) < 0)
return ret;
if (ret > 0)
return 0;
if (fs->eof)
return AVERROR_EOF;
input = fs->in_... | 25,524 |
qemu | 5d1abf234462d13bef3617cc2c55b6815703ddf2 | 0 | int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
{
CPUS390XState *env = &cpu->env;
S390PCIBusDevice *pbdev;
uint64_t offset;
uint64_t data;
uint8_t len;
uint32_t fh;
uint8_t pcias;
cpu_synchronize_state(CPU(cpu));
if (env->psw.mask & PSW_MASK_PSTATE) {
... | 25,525 |
FFmpeg | 84a6bc23570c17ce91071e41431103f709c0d595 | 0 | static Jpeg2000TgtNode *ff_jpeg2000_tag_tree_init(int w, int h)
{
int pw = w, ph = h;
Jpeg2000TgtNode *res, *t, *t2;
int32_t tt_size;
tt_size = tag_tree_size(w, h);
if (tt_size == -1)
return NULL;
t = res = av_mallocz_array(tt_size, sizeof(*t));
if (!res)
return... | 25,527 |
qemu | 25b9fb107bc1f6735fdb3fce537792f5db95f78d | 1 | int kvm_arch_put_registers(CPUState *cs, int level)
{
struct kvm_one_reg reg;
uint32_t fpr;
uint64_t val;
int i;
int ret;
ARMCPU *cpu = ARM_CPU(cs);
CPUARMState *env = &cpu->env;
/* If we are in AArch32 mode then we need to copy the AArch32 regs to the
* AArch64 regist... | 25,529 |
qemu | 5b08fc106d3146ddc1447d82d4770fc402fc363b | 0 | static void sdl_refresh(DisplayState *ds)
{
SDL_Event ev1, *ev = &ev1;
int mod_state;
int buttonstate = SDL_GetMouseState(NULL, NULL);
if (last_vm_running != vm_running) {
last_vm_running = vm_running;
sdl_update_caption();
}
vga_hw_update();
SDL_EnableUNICODE(!... | 25,531 |
qemu | 75af1f34cd5b07c3c7fcf86dfc99a42de48a600d | 0 | static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
size_t size)
{
int64_t len;
if (size > INT_MAX) {
return -EIO;
}
if (!bdrv_is_inserted(bs))
return -ENOMEDIUM;
if (bs->growable)
return 0;
len = ... | 25,532 |
FFmpeg | 7800b09ece52490dda4c46fbd8e93f92e8438428 | 0 | static int planarRgb16ToRgb16Wrapper(SwsContext *c, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
const uint16_t *src102[] = { (uint16_t *)src[1], (uint16_t *)src[0], (uint16_t *)s... | 25,533 |
FFmpeg | e45a2872fafe631c14aee9f79d0963d68c4fc1fd | 0 | void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
POWERPC_TBL_DECLARE(altivec_put_pixels16_num, 1);
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
int i;
POWERPC_TBL_START_COUNT(altivec_put_pixels16_num, 1);
for(i=0; i<h; i++) {
*((uint32_t*)(block )) = (((const stru... | 25,534 |
qemu | 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b | 0 | static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport,
void *data,
size_t len) {
struct VncState *vs = (struct VncState *)transport;
int ret;
retry:
ret = recv(vs->csock, data, len, 0);
if (ret < 0) {
if (errno == EINTR)
go... | 25,535 |
qemu | c3f33667a64a6de0b92106c862247d97d81490ef | 0 | static bool pcie_aer_msg_root_port(PCIDevice *dev, const PCIEAERMsg *msg)
{
bool msg_sent;
uint16_t cmd;
uint8_t *aer_cap;
uint32_t root_cmd;
uint32_t root_status;
bool msi_trigger;
msg_sent = false;
cmd = pci_get_word(dev->config + PCI_COMMAND);
aer_cap = dev->config + d... | 25,536 |
qemu | c3f8f61157625d0bb5bfc135047573de48fdc675 | 0 | static void put_pci_irq_state(QEMUFile *f, void *pv, size_t size)
{
int i;
PCIDevice *s = container_of(pv, PCIDevice, config);
for (i = 0; i < PCI_NUM_PINS; ++i) {
qemu_put_be32(f, pci_irq_state(s, i));
}
}
| 25,537 |
qemu | 348295838384941d1e5420d10e57366c4e303d45 | 0 | static void data_plane_blk_remove_notifier(Notifier *n, void *data)
{
VirtIOBlockDataPlane *s = container_of(n, VirtIOBlockDataPlane,
remove_notifier);
assert(s->conf->conf.blk == data);
data_plane_remove_op_blockers(s);
}
| 25,538 |
qemu | f53a829bb9ef14be800556cbc02d8b20fc1050a7 | 0 | static int nbd_co_send_request(NbdClientSession *s,
struct nbd_request *request,
QEMUIOVector *qiov, int offset)
{
AioContext *aio_context;
int rc, ret;
qemu_co_mutex_lock(&s->send_mutex);
s->send_coroutine = qemu_coroutine_self();
aio_context = bdrv_get_aio_context(s->bs);
ai... | 25,539 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t ac97_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
MilkymistAC97State *s = opaque;
uint32_t r = 0;
addr >>= 2;
switch (addr) {
case R_AC97_CTRL:
case R_AC97_ADDR:
case R_AC97_DATAOUT:
case R_AC97_DATAIN:
case R_D_C... | 25,540 |
qemu | e1833e1f96456fd8fc17463246fe0b2050e68efb | 0 | static void spr_write_ibatu_h (void *opaque, int sprn)
{
DisasContext *ctx = opaque;
gen_op_store_ibatu((sprn - SPR_IBAT4U) / 2);
RET_STOP(ctx);
}
| 25,541 |
qemu | bd31c214c328bc6a2b2f5567623d964b65c8f44c | 0 | static int find_partition(BlockBackend *blk, int partition,
off_t *offset, off_t *size)
{
struct partition_record mbr[4];
uint8_t data[512];
int i;
int ext_partnum = 4;
int ret;
if ((ret = blk_read(blk, 0, data, 1)) < 0) {
error_report("error while re... | 25,542 |
qemu | b3ceef24f4fee8d5ed96b8c4a5d3e80c0a651f0b | 0 | static void sun4m_common_init(int ram_size, int boot_device, DisplayState *ds,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model,
unsigned int machine, int max_ram)
{
... | 25,543 |
qemu | b172c56a6d849554f7e43adc95983a9d6c042689 | 0 | static always_inline void _cpu_ppc_store_hdecr (CPUState *env, uint32_t hdecr,
uint32_t value, int is_excp)
{
ppc_tb_t *tb_env = env->tb_env;
__cpu_ppc_store_decr(env, &tb_env->hdecr_next, tb_env->hdecr_timer,
&cpu_ppc_hdecr_excp, h... | 25,544 |
FFmpeg | 4c7b023d56e09a78a587d036db1b64bf7c493b3d | 0 | static int nvdec_vp9_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
{
VP9SharedContext *h = avctx->priv_data;
const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
CUVIDPICPARAMS *pp =... | 25,545 |
qemu | f22d85e9e67262db34504f4079745f9843da6a92 | 0 | void qmp_disable_command(const char *name)
{
QmpCommand *cmd;
QTAILQ_FOREACH(cmd, &qmp_commands, node) {
if (strcmp(cmd->name, name) == 0) {
cmd->enabled = false;
return;
}
}
}
| 25,546 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void ref405ep_init(MachineState *machine)
{
ram_addr_t ram_size = machine->ram_size;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
char *filename;
ppc4xx_bd_info_... | 25,547 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | static int v9fs_synth_opendir(FsContext *ctx,
V9fsPath *fs_path, V9fsFidOpenState *fs)
{
V9fsSynthOpenState *synth_open;
V9fsSynthNode *node = *(V9fsSynthNode **)fs_path->data;
synth_open = g_malloc(sizeof(*synth_open));
synth_open->node = node;
node->open_count... | 25,548 |
qemu | 2e6fc7eb1a4af1b127df5f07b8bb28af891946fa | 0 | static void raw_reopen_commit(BDRVReopenState *state)
{
BDRVRawState *new_s = state->opaque;
BDRVRawState *s = state->bs->opaque;
memcpy(s, new_s, sizeof(BDRVRawState));
g_free(state->opaque);
state->opaque = NULL;
}
| 25,552 |
FFmpeg | 7457da3698c641212bb921cfb0aa0e7853fdda48 | 1 | static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
int width, int height)
{
DrawTextContext *dtext = ctx->priv;
uint32_t code = 0, prev_code = 0;
int x = 0, y = 0, i = 0, ret;
int max_text_line_w = 0, len;
int box_w, box_h;
char *text = dtext->text... | 25,553 |
FFmpeg | bd5c860fdbc33d19d2ff0f6d1f06de07c17560dd | 1 | static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,
void *msg,
unsigned flags)
{
while (!mq->err_recv && av_fifo_size(mq->fifo) < mq->elsize) {
if ((flags & AV_THREAD_MESSAGE_NONBLOCK))
... | 25,554 |
qemu | c547e5640d5b0993cdfb252331065c1a1d813bd8 | 1 | static int blkdebug_debug_resume(BlockDriverState *bs, const char *tag)
{
BDRVBlkdebugState *s = bs->opaque;
BlkdebugSuspendedReq *r;
QLIST_FOREACH(r, &s->suspended_reqs, next) {
if (!strcmp(r->tag, tag)) {
qemu_coroutine_enter(r->co, NULL);
return 0;
}
... | 25,556 |
qemu | 42e38c1fd0199155d32f3464aedce282d3d7f6a1 | 1 | static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb)
{
BlockRequest *blkreq;
uint64_t sector;
sector = virtio_ldq_p(VIRTIO_DEVICE(req->dev), &req->out.sector);
bdrv_acct_start(req->dev->bs, &req->acct, req->qiov.size, BDRV_ACCT_WRITE);
trace_virtio_blk_handle_wri... | 25,558 |
qemu | 2343dd11a673597aa59813fd0cac2ae42e2e0312 | 1 | static int ppce500_load_device_tree(MachineState *machine,
PPCE500Params *params,
hwaddr addr,
hwaddr initrd_base,
hwaddr initrd_size,
... | 25,559 |
qemu | 3e831b40e015ba34dfb55ff11f767001839425ff | 1 | pvscsi_on_cmd_setup_rings(PVSCSIState *s)
{
PVSCSICmdDescSetupRings *rc =
(PVSCSICmdDescSetupRings *) s->curr_cmd_data;
trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_RINGS");
pvscsi_dbg_dump_tx_rings_config(rc);
pvscsi_ring_init_data(&s->rings, rc);
s->rings_info_valid = TRUE;
... | 25,560 |
FFmpeg | cefa5999534de75686607891b4c06f5b8bd99991 | 1 | void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width){
long i = width;
while(i & 15)
{
i--;
b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS;
b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS;
b2[i] += (W... | 25,561 |
qemu | 636a30a890c50f734c90ee929e16492fbc6c73e3 | 1 | static int parse_add_fd(QemuOpts *opts, void *opaque)
{
int fd, dupfd, flags;
int64_t fdset_id;
const char *fd_opaque = NULL;
fd = qemu_opt_get_number(opts, "fd", -1);
fdset_id = qemu_opt_get_number(opts, "set", -1);
fd_opaque = qemu_opt_get(opts, "opaque");
if (fd < 0) {
... | 25,562 |
FFmpeg | bd5c860fdbc33d19d2ff0f6d1f06de07c17560dd | 1 | void av_thread_message_flush(AVThreadMessageQueue *mq)
{
#if HAVE_THREADS
int used, off;
void *free_func = mq->free_func;
pthread_mutex_lock(&mq->lock);
used = av_fifo_size(mq->fifo);
if (free_func)
for (off = 0; off < used; off += mq->elsize)
av_fifo_generic_peek_at(m... | 25,563 |
FFmpeg | 4e59c8ecf1433b85b539c5e89bb68cfe8b839866 | 1 | int av_open_input_stream(AVFormatContext **ic_ptr,
AVIOContext *pb, const char *filename,
AVInputFormat *fmt, AVFormatParameters *ap)
{
int err;
AVDictionary *opts;
AVFormatContext *ic;
AVFormatParameters default_ap;
if(!ap){
ap=&d... | 25,564 |
qemu | 854e67fea6a6f181163a5467fc9ba04de8d181bb | 1 | void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
{
x86_cpu_dump_local_apic_state(mon_get_cpu(), (FILE *)mon, monitor_fprintf,
CPU_DUMP_FPU);
}
| 25,565 |
qemu | b8b08266bd58d26e9c6b529ab4130c13eaed3406 | 0 | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
{
if (!mon)
return;
if (mon->mc && !mon->mc->print_enabled) {
qemu_error_new(QERR_UNDEFINED_ERROR);
} else {
char buf[4096];
vsnprintf(buf, sizeof(buf), fmt, ap);
monitor_puts(mon, buf);
}... | 25,567 |
qemu | 80db0e7822962554c91bef05d784c898e8ab1c3c | 0 | static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
PCIBus *bus, PIIX4PMState *s)
{
memory_region_init_io(&s->io_gpe, OBJECT(s), &piix4_gpe_ops, s,
"acpi-gpe0", GPE_LEN);
memory_region_add_subregion(parent, GPE_BASE, &s->io_g... | 25,568 |
qemu | 1c275925bfbbc2de84a8f0e09d1dd70bbefb6da3 | 0 | long do_sigreturn(CPUX86State *env)
{
struct sigframe *frame;
abi_ulong frame_addr = env->regs[R_ESP] - 8;
target_sigset_t target_set;
sigset_t set;
int eax, i;
#if defined(DEBUG_SIGNAL)
fprintf(stderr, "do_sigreturn\n");
#endif
if (!lock_user_struct(VERIFY_READ, frame, frame_add... | 25,569 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static ssize_t vc_sendv_compat(VLANClientState *vc, const struct iovec *iov,
int iovcnt)
{
uint8_t buffer[4096];
size_t offset = 0;
int i;
for (i = 0; i < iovcnt; i++) {
size_t len;
len = MIN(sizeof(buffer) - offset, iov[i].iov_len);
me... | 25,572 |
qemu | 13b9414b5798539e2dbb87a570d96184fe21edf4 | 0 | void do_blockdev_backup(BlockdevBackup *backup, BlockJobTxn *txn, Error **errp)
{
BlockDriverState *bs;
BlockDriverState *target_bs;
Error *local_err = NULL;
AioContext *aio_context;
if (!backup->has_speed) {
backup->speed = 0;
}
if (!backup->has_on_source_error) {
... | 25,573 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void input_visitor_test_add(const char *testpath,
TestInputVisitorData *data,
void (*test_func)(TestInputVisitorData *data, const void *user_data))
{
g_test_add(testpath, TestInputVisitorData, data, NULL, test_func,
vis... | 25,575 |
qemu | ee76a09fc72cfbfab2bb5529320ef7e460adffd8 | 0 | static void spapr_populate_pa_features(PowerPCCPU *cpu, void *fdt, int offset,
bool legacy_guest)
{
CPUPPCState *env = &cpu->env;
uint8_t pa_features_206[] = { 6, 0,
0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 };
uint8_t pa_features_207[] = { 24, 0,
0xf6,... | 25,579 |
qemu | c83c66c3b58893a4dc056e272822beb88fe9ec7f | 0 | void *block_job_create(const BlockJobType *job_type, BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque,
Error **errp)
{
BlockJob *job;
if (bs->job || bdrv_in_use(bs)) {
error_set(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));
... | 25,581 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | int bdrv_is_snapshot(BlockDriverState *bs)
{
return !!(bs->open_flags & BDRV_O_SNAPSHOT);
}
| 25,582 |
qemu | 12f86b5b3e1bdf75e0a467d771c16cc42f3a1f1a | 0 | static void nvdimm_init_fit_buffer(NvdimmFitBuffer *fit_buf)
{
qemu_mutex_init(&fit_buf->lock);
fit_buf->fit = g_array_new(false, true /* clear */, 1);
}
| 25,584 |
qemu | 019c2ab8623daee210df8b1085a33b1e83c9ee11 | 1 | static void test_cipher(const void *opaque)
{
const QCryptoCipherTestData *data = opaque;
QCryptoCipher *cipher;
Error *err = NULL;
uint8_t *key, *iv, *ciphertext, *plaintext, *outtext;
size_t nkey, niv, nciphertext, nplaintext;
char *outtexthex;
g_test_message("foo");
nkey ... | 25,587 |
qemu | 7e09797c299712cafa7bc05dd57c1b13afcc6039 | 1 | static uint64_t pmsav5_insn_ap_read(CPUARMState *env, const ARMCPRegInfo *ri)
{
return simple_mpu_ap_bits(env->cp15.c5_insn);
}
| 25,588 |
FFmpeg | a8bdf2405c6027f45a899eaaa6ba74e97c1c2701 | 1 | static av_cold int libgsm_encode_init(AVCodecContext *avctx) {
if (avctx->channels > 1) {
av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
avctx->channels);
return -1;
if (avctx->sample_rate != 8000) {
av_log(avctx, AV_LOG_ERROR, "Sample rat... | 25,589 |
FFmpeg | bcd7bf7eeb09a395cc01698842d1b8be9af483fc | 0 | static void avc_wgt_4x2_msa(uint8_t *data,
int32_t stride,
int32_t log2_denom,
int32_t src_weight,
int32_t offset_in)
{
uint32_t data0, data1;
v16u8 zero = { 0 };
v16u8 src0, src1;
v4... | 25,590 |
qemu | a9db86b223030bd40bdd81b160788196bc95fe6f | 1 | static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQuorumState *s = bs->opaque;
Error *local_err = NULL;
QemuOpts *opts;
bool *opened;
QDict *sub = NULL;
QList *list = NULL;
const QListEntry *lentry;
int i;
in... | 25,591 |
FFmpeg | b9fa32082c71013e90eab9e9997967d2939cf4a6 | 1 | void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output,
const FFTSample *input, FFTSample *tmp)
{
long n8, n4, n2, n;
x86_reg k;
const uint16_t *revtab = s->fft.revtab;
const FFTSample *tcos = s->tcos;
const FFTSample *tsin = s->tsin;
const FFTSample *in1, *in2... | 25,592 |
FFmpeg | 6796a1dd8c14843b77925cb83a3ef88706ae1dd0 | 0 | void ff_put_h264_qpel8_mc01_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_vt_qrt_8w_msa(src - (stride * 2), stride, dst, stride, 8, 0);
}
| 25,594 |
FFmpeg | 8b00ab0113a8ca40429e0a06331be83996963a9e | 0 | int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
{
int ret = 0;
/* If there is a user-supplied mutex locking routine, call it. */
if (ff_lockmgr_cb) {
if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
return -1;
}
entangled_thread_counter+... | 25,595 |
FFmpeg | 3deb4b54a24f8cddce463d9f5751b01efeb976af | 0 | static int synth_superframe(AVCodecContext *ctx, AVFrame *frame,
int *got_frame_ptr)
{
WMAVoiceContext *s = ctx->priv_data;
GetBitContext *gb = &s->gb, s_gb;
int n, res, n_samples = 480;
double lsps[MAX_FRAMES][MAX_LSPS];
const double *mean_lsf = s->lsps == 16 ?
... | 25,596 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void virtual_css_bridge_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
k->init = virtual_css_bridge_init;
dc->no_user = 1;
}
| 25,597 |
FFmpeg | 5029a406334ad0eaf92130e23d596e405a8a5aa0 | 1 | static void free_picture(MpegEncContext *s, Picture *pic){
int i;
if(pic->data[0] && pic->type!=FF_BUFFER_TYPE_SHARED){
free_frame_buffer(s, pic);
}
av_freep(&pic->mb_var);
av_freep(&pic->mc_mb_var);
av_freep(&pic->mb_mean);
av_freep(&pic->mbskip_table);
av_freep(&pi... | 25,598 |
qemu | 5f8b6491f20732e0a31e64bbf75b62def579e044 | 1 | static void tracked_request_begin(BdrvTrackedRequest *req,
BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, bool is_write)
{
*req = (BdrvTrackedRequest){
.bs = bs,
.sector_num = sect... | 25,599 |
FFmpeg | 4533d2d67f28860304cdaa8aa0b3db85f368810e | 1 | static int mov_read_close(AVFormatContext *s)
{
int i;
MOVContext *mov = s->priv_data;
for(i=0; i<mov->total_streams; i++)
mov_free_stream_context(mov->streams[i]);
for(i=0; i<s->nb_streams; i++)
av_free(s->streams[i]);
return 0;
}
| 25,601 |
FFmpeg | 7caee063a0b71a2b9bdd21f508bb39b6b7a83ceb | 1 | static int aac_decode_frame(AVCodecContext *avccontext, void *data,
int *data_size, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AACContext *ac = avccontext->priv_data;
ChannelElement *che = NULL, *che_prev = NULL;
GetBitContext ... | 25,603 |
FFmpeg | 6df5f6ae51ca3e9f3af760066bc7b3423677a8b4 | 1 | static inline void dv_guess_qnos(EncBlockInfo* blks, int* qnos)
{
int size[5];
int i, j, k, a, prev, a2;
EncBlockInfo* b;
size[4]= 1<<24;
do {
b = blks;
for (i=0; i<5; i++) {
if (!qnos[i])
continue;
qnos[i]--;
size[i] = 0;
... | 25,604 |
FFmpeg | bd8d28e2d2713f0368ee6b7dbb5ec251cbc162ac | 0 | static av_cold int hnm_decode_init(AVCodecContext *avctx)
{
Hnm4VideoContext *hnm = avctx->priv_data;
if (avctx->extradata_size < 1) {
av_log(avctx, AV_LOG_ERROR,
"Extradata missing, decoder requires version number\n");
return AVERROR_INVALIDDATA;
}
hnm->versio... | 25,605 |
qemu | 33f461e0c5d8efa21ef7e746be561fc57a1df106 | 1 | static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs,
BdrvTrackedRequest *req, int64_t offset, unsigned int bytes,
int64_t align, QEMUIOVector *qiov, int flags)
{
BlockDriver *drv = bs->drv;
int ret;
int64_t sector_num = offset >> BDRV_SECTOR_BITS;
unsigned int nb_sectors = ... | 25,606 |
qemu | 1ee24514aed34760fb2863d98bea3a1b705d9c9f | 1 | static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeIdentify *c)
{
NvmeNamespace *ns;
uint32_t nsid = le32_to_cpu(c->nsid);
uint64_t prp1 = le64_to_cpu(c->prp1);
uint64_t prp2 = le64_to_cpu(c->prp2);
if (nsid == 0 || nsid > n->num_namespaces) {
return NVME_INVALID_NSID | NVME_DNR;
... | 25,607 |
qemu | 6905b93447a42e606dfd126b90f75f4cd3c6fe94 | 1 | void dpy_gfx_replace_surface(QemuConsole *con,
DisplaySurface *surface)
{
DisplayState *s = con->ds;
DisplaySurface *old_surface = con->surface;
DisplayChangeListener *dcl;
con->surface = surface;
QLIST_FOREACH(dcl, &s->listeners, next) {
if (con != (dcl->con ? d... | 25,608 |
FFmpeg | 3b55429d5692dd782d8b3ce6a19819305157d1b8 | 1 | static int tqi_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_end = buf+buf_size;
TqiContext *t = avctx->priv_data;
Mpe... | 25,609 |
qemu | cb58a6d3611b2d0ff4ed29bb6b659c95a23cb2d5 | 1 | static void patch_call(VAPICROMState *s, X86CPU *cpu, target_ulong ip,
uint32_t target)
{
uint32_t offset;
offset = cpu_to_le32(target - ip - 5);
patch_byte(cpu, ip, 0xe8); /* call near */
cpu_memory_rw_debug(CPU(cpu), ip + 1, (void *)&offset, sizeof(offset), 1);
}
| 25,611 |
FFmpeg | 8978c743fb1d1f5a0d6dbdd83ff05817f8a41230 | 1 | static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
{
int k, e;
int ch;
if (id_aac == TYPE_CPE && sbr->bs_coupling) {
float alpha = sbr->data[0].bs_amp_res ? 1.0f : 0.5f;
float pan_offset = sbr->data[0].bs_amp_res ? 12.0f : 24.0f;
for (e = 1; e <= sbr->d... | 25,612 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static inline int16_t logadd(int16_t a, int16_t b)
{
int16_t c = a - b;
uint8_t address = FFMIN((ABS(c) >> 1), 255);
return ((c >= 0) ? (a + latab[address]) : (b + latab[address]));
}
| 25,613 |
qemu | db486cc334aafd3dbdaf107388e37fc3d6d3e171 | 1 | static void range_merge(Range *range1, Range *range2)
{
if (range1->end < range2->end) {
range1->end = range2->end;
}
if (range1->begin > range2->begin) {
range1->begin = range2->begin;
}
}
| 25,614 |
FFmpeg | e65849a70bfb401306038d41ebd8b5750deb3cfd | 1 | static int write_manifest(AVFormatContext *s, int final)
{
DASHContext *c = s->priv_data;
AVIOContext *out;
char temp_filename[1024];
int ret, i;
AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0);
snprintf(temp_filename, sizeof(temp_filename), "%s.tmp", s->filename);... | 25,615 |
FFmpeg | a557ae8d52ce1cfaf3be5cdb13728b7b2b9512b9 | 1 | static int get_scale_factor(H264SliceContext *sl,
int poc, int poc1, int i)
{
int poc0 = sl->ref_list[0][i].poc;
int td = av_clip_int8(poc1 - poc0);
if (td == 0 || sl->ref_list[0][i].parent->long_ref) {
return 256;
} else {
int tb = av_clip_int8(poc - ... | 25,616 |
qemu | 57d0a39d98b0d0e4712e736084667bcb5aed3474 | 0 | static int ppc_hash64_pte_prot(CPUPPCState *env,
ppc_slb_t *slb, ppc_hash_pte64_t pte)
{
unsigned pp, key;
/* Some pp bit combinations have undefined behaviour, so default
* to no access in those cases */
int prot = 0;
key = !!(msr_pr ? (slb->vsid & SLB_VSID_... | 25,617 |
FFmpeg | 349b65eee2fd5590b7e511c915dcd2d3aef3960e | 0 | static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt)
{
int got_picture, i;
if (packet_queue_get(&is->videoq, pkt, 1) < 0)
return -1;
if (pkt->data == flush_pkt.data) {
avcodec_flush_buffers(is->video_st->codec);
SDL_LockMutex(is->pictq_... | 25,618 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void omap_sysctl_write8(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
struct omap_sysctl_s *s = (struct omap_sysctl_s *) opaque;
int pad_offset, byte_offset;
int prev_value;
switch (addr) {
case 0x030 ... 0x140: /* CONTROL_PADCONF - only used in the POP */
... | 25,620 |
qemu | 95b1416ae93106923f733941e52dfe55c4318643 | 0 | static void l2tpv3_update_fd_handler(NetL2TPV3State *s)
{
qemu_set_fd_handler2(s->fd,
s->read_poll ? l2tpv3_can_send : NULL,
s->read_poll ? net_l2tpv3_send : NULL,
s->write_poll ? l2tpv3_writable : NULL,
s)... | 25,621 |
qemu | 4fc9af53d88c0a2a810704a06cb39a7182982e4e | 0 | void bdrv_set_boot_sector(BlockDriverState *bs, const uint8_t *data, int size)
{
bs->boot_sector_enabled = 1;
if (size > 512)
size = 512;
memcpy(bs->boot_sector_data, data, size);
memset(bs->boot_sector_data + size, 0, 512 - size);
}
| 25,623 |
qemu | 7848c8d19f8556666df25044bbd5d8b29439c368 | 0 | void helper_sysexit(CPUX86State *env, int dflag)
{
int cpl;
cpl = env->hflags & HF_CPL_MASK;
if (env->sysenter_cs == 0 || cpl != 0) {
raise_exception_err(env, EXCP0D_GPF, 0);
}
cpu_x86_set_cpl(env, 3);
#ifdef TARGET_X86_64
if (dflag == 2) {
cpu_x86_load_seg_cache(env,... | 25,626 |
qemu | a9899996c8bc8eb7686f64207ef2ce1137dd125b | 0 | static int slirp_guestfwd(SlirpState *s, const char *config_str,
int legacy_format)
{
struct in_addr server = { .s_addr = 0 };
struct GuestFwd *fwd;
const char *p;
char buf[128];
char *end;
int port;
p = config_str;
if (legacy_format) {
if (... | 25,627 |
qemu | 2174f12bdeb3974141784e14bbb7ad8c53178cd9 | 0 | BlockAIOCB *laio_submit(BlockDriverState *bs, LinuxAioState *s, int fd,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque, int type)
{
struct qemu_laiocb *laiocb;
struct iocb *iocbs;
off_t offset = sector_num * 512;
laiocb = qemu_aio_g... | 25,628 |
FFmpeg | 76d81909ae65f5a771e3a58d6a5d6bb58bfed995 | 0 | static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
int bufsize, void *data)
{
X264Context *x4 = ctx->priv_data;
AVFrame *frame = data;
x264_nal_t *nal;
int nnal, i;
x264_picture_t pic_out;
x4->pic.img.i_csp = X264_CSP_I420;
x4->pic.img.i_plane = 3;
... | 25,629 |
qemu | ddca7f86ac022289840e0200fd4050b2b58e9176 | 0 | static void v9fs_rename(void *opaque)
{
int32_t fid;
ssize_t err = 0;
size_t offset = 7;
V9fsString name;
int32_t newdirfid;
V9fsFidState *fidp;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name);
fidp = get_fid... | 25,630 |
qemu | 550830f9351291c585c963204ad9127998b1c1ce | 0 | static int coroutine_fn cow_co_is_allocated(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, int *num_same)
{
int64_t bitnum = sector_num + sizeof(struct cow_header_v2) * 8;
uint64_t offset = (bitnum / 8) & -BDRV_SECTOR_SIZE;
bool first = true;
int changed = 0, same = 0;
do... | 25,631 |
qemu | ccea25f1c7cd3f0b12d878a5294620f5478729f8 | 0 | void os_setup_post(void)
{
int fd = 0;
if (daemonize) {
uint8_t status = 0;
ssize_t len;
again1:
len = write(daemon_pipe, &status, 1);
if (len == -1 && (errno == EINTR)) {
goto again1;
}
if (len != 1) {
exit(1);
... | 25,632 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.