project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 9e5381a21b2106a012b92c1878886c5af4e1a932 | 0 | void parse_options(int argc, char **argv, const OptionDef *options,
void (* parse_arg_function)(const char*))
{
const char *opt, *arg;
int optindex, handleoptions=1;
const OptionDef *po;
/* parse options */
optindex = 1;
while (optindex < argc) {
opt = argv[... | 13,954 |
qemu | f7736b91c40a617e93505e32dcbd2cb56aad8a23 | 0 | static int dma_buf_rw(BMDMAState *bm, int is_write)
{
IDEState *s = bmdma_active_if(bm);
struct {
uint32_t addr;
uint32_t size;
} prd;
int l, len;
for(;;) {
l = s->io_buffer_size - s->io_buffer_index;
if (l <= 0)
break;
if (bm->cur_pr... | 13,955 |
qemu | 5fa9a0ae49a01536a403f38e39222c3e8cc964c5 | 0 | static void eepro100_cu_command(EEPRO100State * s, uint8_t val)
{
eepro100_tx_t tx;
uint32_t cb_address;
switch (val) {
case CU_NOP:
/* No operation. */
break;
case CU_START:
if (get_cu_state(s) != cu_idle) {
/* Intel documentation says that CU must be i... | 13,956 |
qemu | f101cd885ec148761738638ae42f7c5162b6d445 | 0 | void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val)
{
int op1;
int op2;
int crm;
op1 = (insn >> 21) & 7;
op2 = (insn >> 5) & 7;
crm = insn & 0xf;
switch ((insn >> 16) & 0xf) {
case 0:
/* ID codes. */
if (arm_feature(env, ARM_FEATURE_XSCALE))
... | 13,957 |
qemu | 57407ea44cc0a3d630b9b89a2be011f1955ce5c1 | 0 | static void pci_pcnet_cleanup(NetClientState *nc)
{
PCNetState *d = qemu_get_nic_opaque(nc);
pcnet_common_cleanup(d);
}
| 13,958 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void gen_mulo(DisasContext *ctx)
{
int l1 = gen_new_label();
TCGv_i64 t0 = tcg_temp_new_i64();
TCGv_i64 t1 = tcg_temp_new_i64();
TCGv t2 = tcg_temp_new();
/* Start with XER OV disabled, the most likely case */
tcg_gen_movi_tl(cpu_ov, 0);
tcg_gen_extu_tl_i64(t0, cpu_gpr[rA(ctx-... | 13,959 |
qemu | 12d69ac03b45156356b240424623719f15d8143e | 0 | static void test_source_flush_event_notifier(void)
{
EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true };
event_notifier_init(&data.e, false);
aio_set_event_notifier(ctx, &data.e, event_ready_cb);
g_assert(g_main_context_iteration(NULL, false));
g_assert_cmpint(data.n, ==, ... | 13,960 |
qemu | 8bfc26ea302ec03585d7258a7cf8938f76512730 | 0 | uint32_t HELPER(v7m_mrs)(CPUARMState *env, uint32_t reg)
{
uint32_t mask;
unsigned el = arm_current_el(env);
/* First handle registers which unprivileged can read */
switch (reg) {
case 0 ... 7: /* xPSR sub-fields */
mask = 0;
if ((reg & 1) && el) {
mask |= X... | 13,961 |
qemu | 104981d52b63dc3d68f39d4442881c667f44bbb9 | 0 | static void usbredir_control_packet(void *priv, uint32_t id,
struct usb_redir_control_packet_header *control_packet,
uint8_t *data, int data_len)
{
USBRedirDevice *dev = priv;
int len = control_packet->length;
AsyncURB *aurb;
DPRINTF("ctrl-in status %d len %d id %u\n", control_packet->s... | 13,962 |
qemu | 5d47e3728bbd589701f74bb494c9c9825ba23c88 | 0 | static int qemu_paio_submit(struct qemu_paiocb *aiocb, int is_write)
{
aiocb->is_write = is_write;
aiocb->ret = -EINPROGRESS;
aiocb->active = 0;
mutex_lock(&lock);
if (idle_threads == 0 && cur_threads < max_threads)
spawn_thread();
TAILQ_INSERT_TAIL(&request_list, aiocb, node);
... | 13,963 |
qemu | 2e6a64cb8d7506ad27d3b6c8000bc8d773936932 | 0 | static void input_linux_event_keyboard(void *opaque)
{
InputLinux *il = opaque;
struct input_event event;
int rc;
for (;;) {
rc = read(il->fd, &event, sizeof(event));
if (rc != sizeof(event)) {
if (rc < 0 && errno != EAGAIN) {
fprintf(stderr, "%s: r... | 13,964 |
qemu | c572f23a3e7180dbeab5e86583e43ea2afed6271 | 1 | static void v9fs_create(void *opaque)
{
int32_t fid;
int err = 0;
size_t offset = 7;
V9fsFidState *fidp;
V9fsQID qid;
int32_t perm;
int8_t mode;
V9fsPath path;
struct stat stbuf;
V9fsString name;
V9fsString extension;
int iounit;
V9fsPDU *pdu = opaque;
... | 13,965 |
qemu | 600b828c448f108b89e1f864f0420a49ccb70d43 | 1 | static int gen_neon_unzip(int rd, int rm, int size, int q)
{
TCGv tmp, tmp2;
if (size == 3 || (!q && size == 2)) {
return 1;
}
tmp = tcg_const_i32(rd);
tmp2 = tcg_const_i32(rm);
if (q) {
switch (size) {
case 0:
gen_helper_neon_qunzip8(tmp, tmp2);
... | 13,966 |
qemu | 35b5066ea7c2c3051fbc5a24b3d463b9800063e2 | 1 | static void gen_wait(DisasContext *ctx)
{
TCGv_i32 t0 = tcg_temp_new_i32();
tcg_gen_st_i32(t0, cpu_env,
-offsetof(PowerPCCPU, env) + offsetof(CPUState, halted));
tcg_temp_free_i32(t0);
/* Stop translation, as the CPU is supposed to sleep from now */
gen_exception_err(ctx, E... | 13,967 |
qemu | 3005c2c2fa2875a3413af97e9db368856d3330fd | 1 | GuestExec *qmp_guest_exec(const char *path,
bool has_arg, strList *arg,
bool has_env, strList *env,
bool has_input_data, const char *input_data,
bool has_capture_output, bool capture_output,
Error **e... | 13,968 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, long width, enum PixelFormat srcFormat)
{
__asm__ volatile(
"movq 24(%4), %%mm6 \n\t"
"mov %3, %%"REG_a" \n\t"
"pxor %%mm7, %%mm... | 13,970 |
FFmpeg | ac4b32df71bd932838043a4838b86d11e169707f | 1 | void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
VP8Macroblock *mb, int mb_x, int mb_y)
{
int x, y, mode, nnz;
uint32_t tr;
/* for the first row, we need to run xchg_mb_border to init the top edge
* to 127 otherwise, skip it if we aren't going to deblock ... | 13,971 |
FFmpeg | 526886e6069636a918c8c04db17e864e3d8151c1 | 1 | static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b, int is_arith)
{
int cb_x, cb_y, left, right, top, bottom;
DiracArith c;
GetBitContext gb;
int cb_width = s->codeblock[b->level + (b->orientation != subband_ll)].width;
int cb_height = s->codeblock[b->level + (b-... | 13,972 |
FFmpeg | 28bf81c90d36a55cf76e2be913c5215ebebf61f2 | 1 | static inline void RENAME(yuv2rgb2)(uint16_t *buf0, uint16_t *buf1, uint16_t *uvbuf0, uint16_t *uvbuf1,
uint8_t *dest, int dstW, int yalpha, int uvalpha, int dstbpp)
{
int yalpha1=yalpha^4095;
int uvalpha1=uvalpha^4095;
if(fullUVIpol)
{
#ifdef HAVE_MMX
if(dstbpp == 32)
{
asm volatile(
... | 13,973 |
FFmpeg | 2e9b79fc003f19c65f4fd6ef30748c1916ed4fa7 | 1 | static int wavpack_encode_block(WavPackEncodeContext *s,
int32_t *samples_l, int32_t *samples_r,
uint8_t *out, int out_size)
{
int block_size, start, end, data_size, tcount, temp, m = 0;
int i, j, ret, got_extra = 0, nb_samples = s->block_samp... | 13,974 |
qemu | b161e2e4b32ac8fb9e6a891eba3da0b825b5d046 | 1 | static void qemu_laio_process_completion(struct qemu_laio_state *s,
struct qemu_laiocb *laiocb)
{
int ret;
s->count--;
ret = laiocb->ret;
if (ret != -ECANCELED) {
if (ret == laiocb->nbytes)
ret = 0;
else if (ret >= 0)
ret = -EINVAL;
la... | 13,975 |
qemu | d72915c60bff51495529449750e051d01b03c62f | 1 | void throttle_get_config(ThrottleState *ts, ThrottleConfig *cfg)
{
*cfg = ts->cfg; | 13,976 |
qemu | fa5912a17b51b807c4ec78a4aa914891c7770781 | 1 | vreader_xfr_bytes(VReader *reader,
unsigned char *send_buf, int send_buf_len,
unsigned char *receive_buf, int *receive_buf_len)
{
VCardAPDU *apdu;
VCardResponse *response = NULL;
VCardStatus card_status;
unsigned short status;
VCard *card = vreader_get_car... | 13,977 |
qemu | 5193be3be35f29a35bc465036cd64ad60d43385f | 1 | static int tsc210x_load(QEMUFile *f, void *opaque, int version_id)
{
TSC210xState *s = (TSC210xState *) opaque;
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
int i;
s->x = qemu_get_be16(f);
s->y = qemu_get_be16(f);
s->pressure = qemu_get_byte(f);
s->state = qemu_get_byte(f... | 13,978 |
qemu | ef4760626e88bc3e7a1b46c7370378cbd12d379f | 1 | static uint16_t eepro100_read2(EEPRO100State * s, uint32_t addr)
{
uint16_t val;
if (addr <= sizeof(s->mem) - sizeof(val)) {
memcpy(&val, &s->mem[addr], sizeof(val));
}
switch (addr) {
case SCBStatus:
case SCBCmd:
TRACE(OTHER, logout("addr=%s val=0x%04x\n", regname(add... | 13,979 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static int disas_cp15_insn(CPUState *env, DisasContext *s, uint32_t insn)
{
uint32_t rd;
TCGv tmp, tmp2;
/* M profile cores use memory mapped registers instead of cp15. */
if (arm_feature(env, ARM_FEATURE_M))
return 1;
if ((insn & (1 << 25)) == 0) {
if (insn & (1 << 20)) {
... | 13,980 |
FFmpeg | 7c0b84d89911b2035161f5ef51aafbfcc84aa9e2 | 1 | static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
{
ASFContext *asf = s->priv_data;
AVIOContext *pb = s->pb;
ASFStream *stream;
AVCodecContext *codec;
uint32_t packet_number;
int64_t pts;
int start_sec;
int flags = pkt->flags;
int ret;
uint64_t offset = av... | 13,981 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void pl181_class_init(ObjectClass *klass, void *data)
{
SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
DeviceClass *k = DEVICE_CLASS(klass);
sdc->init = pl181_init;
k->vmsd = &vmstate_pl181;
k->reset = pl181_reset;
k->no_user = 1;
}
| 13,982 |
qemu | a718978ed58abc1ad92567a9c17525136be02a71 | 1 | static void ahci_start_transfer(IDEDMA *dma)
{
AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
IDEState *s = &ad->port.ifs[0];
uint32_t size = (uint32_t)(s->data_end - s->data_ptr);
/* write == ram -> device */
uint16_t opts = le16_to_cpu(ad->cur_cmd->opts);
int is_write = opts & AHCI_C... | 13,983 |
qemu | 6e38a4ba7889083b65729db2144cdbcefbaa303a | 1 | void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
{
qemu_irq *irq;
if (bus->dma == &bm->dma) {
return;
}
bm->dma.ops = &bmdma_ops;
bus->dma = &bm->dma;
bm->irq = bus->irq;
irq = qemu_allocate_irqs(bmdma_irq, bm, 1);
bus->irq = *irq;
bm->pci_dev = d;
... | 13,984 |
qemu | 46daff13c854769bfa8c51e77719325ea0f47b1b | 1 | static void qemu_tcg_wait_io_event(void)
{
CPUState *env;
while (all_cpu_threads_idle()) {
/* Start accounting real time to the virtual clock if the CPUs
are idle. */
qemu_clock_warp(vm_clock);
qemu_cond_wait(tcg_halt_cond, &qemu_global_mutex);
}
qemu_mutex... | 13,985 |
FFmpeg | 770c934fa1635f4fadf5db4fc5cc5ad15d82455a | 1 | void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input)
{
int i, j, n, n8, n4, n2, n3;
FFTDouble re, im;
const uint16_t *revtab = s->revtab;
const FFTSample *tcos = s->tcos;
const FFTSample *tsin = s->tsin;
FFTComplex *x = (FFTComplex *)out;
n = 1 << s->mdct_bits... | 13,986 |
qemu | 71d0770c4cec9f1dc04f4dadcbf7fd6c335030a9 | 1 | int bdrv_file_open(BlockDriverState **pbs, const char *filename, int flags)
{
BlockDriverState *bs;
int ret;
bs = bdrv_new("");
if (!bs)
return -ENOMEM;
ret = bdrv_open2(bs, filename, flags | BDRV_O_FILE, NULL);
if (ret < 0) {
bdrv_delete(bs);
return ret;
... | 13,987 |
FFmpeg | dc6cf61e331557eb275a44d7a31df8e781bbb22b | 1 | static int sdp_parse_fmtp_config_h264(AVStream * stream,
PayloadContext * h264_data,
char *attr, char *value)
{
AVCodecContext *codec = stream->codec;
assert(codec->codec_id == CODEC_ID_H264);
assert(h264_data != NULL);
... | 13,989 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | void qpci_io_writeq(QPCIDevice *dev, void *data, uint64_t value)
{
uintptr_t addr = (uintptr_t)data;
if (addr < QPCI_PIO_LIMIT) {
dev->bus->pio_writeq(dev->bus, addr, value);
} else {
value = cpu_to_le64(value);
dev->bus->memwrite(dev->bus, addr, &value, sizeof(value));
... | 13,990 |
qemu | 7d61d892327d803ae43d14500601e48031b4632c | 1 | static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
abi_ulong target_addr, socklen_t addrlen)
{
void *addr;
void *host_msg;
abi_long ret;
if ((int)addrlen < 0) {
return -TARGET_EINVAL;
}
host_msg = lock_user(VERIFY_READ, msg, len... | 13,991 |
qemu | 8804f57b531e4887ad9521c9abb9e0bbbcb1dd4e | 1 | static int vscsi_srp_direct_data(VSCSIState *s, vscsi_req *req,
uint8_t *buf, uint32_t len)
{
struct srp_direct_buf *md = req->cur_desc;
uint32_t llen;
int rc;
dprintf("VSCSI: direct segment 0x%x bytes, va=0x%llx desc len=0x%x\n",
len, (unsigned long... | 13,992 |
qemu | eef9f19eea26cd8b4553459118f87d7150b53c5a | 1 | static inline void flash_sync_area(Flash *s, int64_t off, int64_t len)
{
QEMUIOVector *iov = g_new(QEMUIOVector, 1);
if (!s->blk || blk_is_read_only(s->blk)) {
return;
}
assert(!(len % BDRV_SECTOR_SIZE));
qemu_iovec_init(iov, 1);
qemu_iovec_add(iov, s->storage + off, len);
... | 13,993 |
qemu | 6658ffb81ee56a510d7d77025872a508a9adce3a | 1 | static void gdb_vm_stopped(void *opaque, int reason)
{
GDBState *s = opaque;
char buf[256];
int ret;
if (s->state == RS_SYSCALL)
/* disable single step if it was enable */
cpu_single_step(s->env, 0);
if (reason == EXCP_DEBUG) {
tb_flush(s->env);
ret = SIGTRAP... | 13,994 |
qemu | baf35cb90204d75404892aa4e52628ae7a00669b | 1 | void main_loop_wait(int timeout)
{
IOHandlerRecord *ioh;
fd_set rfds, wfds, xfds;
int ret, nfds;
#ifdef _WIN32
int ret2, i;
#endif
struct timeval tv;
PollingEntry *pe;
/* XXX: need to suppress polling by better using win32 events */
ret = 0;
for(pe = first_polling_ent... | 13,995 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int buf_put_buffer(void *opaque, const uint8_t *buf,
int64_t pos, int size)
{
QEMUBuffer *s = opaque;
return qsb_write_at(s->qsb, buf, pos, size);
}
| 13,996 |
qemu | cf143ad35018c5fc1da6365b45acda2b34aba90a | 1 | static void mv88w8618_eth_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
mv88w8618_eth_state *s = opaque;
switch (offset) {
case MP_ETH_SMIR:
s->smir = value;
break;
case MP_ETH_PCXR:
s->vlan_header = ((value >> MP... | 13,997 |
FFmpeg | ab3ff19f08b7a83e320c39ab066f289c242b8030 | 1 | static int config_props(AVFilterLink *inlink)
{
FadeContext *s = inlink->dst->priv;
const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(inlink->format);
s->hsub = pixdesc->log2_chroma_w;
s->vsub = pixdesc->log2_chroma_h;
s->bpp = av_get_bits_per_pixel(pixdesc) >> 3;
s->alpha &= !!... | 13,998 |
qemu | 0af7a37054310384e00209e0a43efe95b7c19ef0 | 1 | static void gen_msa(CPUMIPSState *env, DisasContext *ctx)
{
uint32_t opcode = ctx->opcode;
check_insn(ctx, ASE_MSA);
check_msa_access(ctx);
switch (MASK_MSA_MINOR(opcode)) {
case OPC_MSA_I8_00:
case OPC_MSA_I8_01:
case OPC_MSA_I8_02:
gen_msa_i8(env, ctx);
break;
... | 13,999 |
qemu | b9c600d20716b3d942cb07188ff998fb236a8365 | 1 | static BlockAIOCB *read_fifo_child(QuorumAIOCB *acb)
{
BDRVQuorumState *s = acb->common.bs->opaque;
acb->qcrs[acb->child_iter].buf =
qemu_blockalign(s->children[acb->child_iter]->bs, acb->qiov->size);
qemu_iovec_init(&acb->qcrs[acb->child_iter].qiov, acb->qiov->niov);
qemu_iovec_clone(&a... | 14,000 |
qemu | 65207c59d99f2260c5f1d3b9c491146616a522aa | 1 | static void qmp_monitor_complete(void *opaque, QObject *ret_data)
{
monitor_protocol_emitter(opaque, ret_data);
}
| 14,002 |
FFmpeg | 5260edee7e5bd975837696c8c8c1a80eb2fbd7c1 | 1 | static int old_codec37(SANMVideoContext *ctx, int top,
int left, int width, int height)
{
int stride = ctx->pitch;
int i, j, k, t;
int skip_run = 0;
int compr, mvoff, seq, flags;
uint32_t decoded_size;
uint8_t *dst, *prev;
compr = bytestream2_get_byte... | 14,003 |
qemu | 4652b8f3e1ec91bb9d6f00e40df7f96d1f1aafee | 1 | static int calculate_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
BdrvCheckMode fix, bool *rebuild,
void **refcount_table, int64_t *nb_clusters)
{
BDRVQcow2State *s = bs->opaque;
int64_t i;
QCowSnapshot *sn;
int ret;
if (!*refcou... | 14,004 |
FFmpeg | 2469ed32c81ebf2347e6883091c566724b286167 | 1 | static uint64_t calc_rice_params(RiceContext *rc,
uint32_t udata[FLAC_MAX_BLOCKSIZE],
uint64_t sums[32][MAX_PARTITIONS],
int pmin, int pmax,
const int32_t *data, int n, int pred_order,... | 14,005 |
qemu | cdcab9d94101a6dd9ac8136c6f2cd15b6a997896 | 1 | static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
{
MemoryRegion *mr = host_memory_backend_get_memory(dimm->hostmem, errp);
NVDIMMDevice *nvdimm = NVDIMM(dimm);
uint64_t align, pmem_size, size = memory_region_size(mr);
align = memory_region_get_alignment(mr);
pmem_size = size - ... | 14,006 |
FFmpeg | e8876902a9021ec185ca785653067dd34f24c5ce | 1 | ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
int output_rate, int input_rate,
enum AVSampleFormat sample_fmt_out,
enum AVSampleFormat sample_fmt_in,
... | 14,007 |
qemu | e3cffe6fad29e07d401eabb913a6d88501d5c143 | 1 | static void gen_sync(DisasContext *ctx)
{
uint32_t l = (ctx->opcode >> 21) & 3;
/*
* We may need to check for a pending TLB flush.
*
* We do this on ptesync (l == 2) on ppc64 and any sync pn ppc32.
*
* Additionally, this can only happen in kernel mode however so
* check ... | 14,008 |
qemu | 83e33300a2342c5d0bf48474fdf8da22c22b4973 | 1 | static int qcrypto_ivgen_essiv_calculate(QCryptoIVGen *ivgen,
uint64_t sector,
uint8_t *iv, size_t niv,
Error **errp)
{
QCryptoIVGenESSIV *essiv = ivgen->private;
size_t ndata = qcryp... | 14,009 |
FFmpeg | 56c182c4d716b8b72156ff57a0c8d72087db8549 | 1 | void ff_nut_free_sp(NUTContext *nut)
{
av_tree_enumerate(nut->syncpoints, NULL, NULL, enu_free);
av_tree_destroy(nut->syncpoints);
}
| 14,010 |
qemu | cc05c43ad942165ecc6ffd39e41991bee43af044 | 1 | static void memory_region_oldmmio_write_accessor(MemoryRegion *mr,
hwaddr addr,
uint64_t *value,
unsigned size,
unsigned... | 14,011 |
qemu | 381b634c275ca1a2806e97392527bbfc01bcb333 | 1 | static void scsi_cmd_xfer_mode(SCSICommand *cmd)
{
if (!cmd->xfer) {
cmd->mode = SCSI_XFER_NONE;
return;
}
switch (cmd->buf[0]) {
case WRITE_6:
case WRITE_10:
case WRITE_VERIFY_10:
case WRITE_12:
case WRITE_VERIFY_12:
case WRITE_16:
case WRITE_VERIFY_... | 14,012 |
qemu | 544a3731591f5d53e15f22de00ce5ac758d490b3 | 1 | static void test_visitor_in_union_flat(TestInputVisitorData *data,
const void *unused)
{
Visitor *v;
UserDefFlatUnion *tmp;
UserDefUnionBase *base;
v = visitor_input_test_init(data,
"{ 'enum1': 'value1', "
... | 14,013 |
FFmpeg | 1c31b26bdf66879a46a7a3e340da815c1b2125a8 | 1 | static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
{
AVIOContext *pb = s->pb;
APEContext *ape = s->priv_data;
AVStream *st;
uint32_t tag;
int i;
int total_blocks;
int64_t pts;
/* TODO: Skip any leading junk such as id3v2 tags */
ape->junklength = 0;
... | 14,015 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int buf_close(void *opaque)
{
QEMUBuffer *s = opaque;
qsb_free(s->qsb);
g_free(s);
return 0;
}
| 14,016 |
FFmpeg | 936751b6527cff789ef077a4e43a04ae9e658232 | 1 | static const struct URLProtocol *url_find_protocol(const char *filename)
{
const URLProtocol **protocols;
char proto_str[128], proto_nested[128], *ptr;
size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
int i;
if (filename[proto_len] != ':' &&
(strncmp(filename, "subfile,", 8) |... | 14,017 |
qemu | fc6467eaf22f974620b5dd046afca04e619f9be9 | 1 | void qmp_nbd_server_stop(Error **errp)
{
while (!QTAILQ_EMPTY(&close_notifiers)) {
NBDCloseNotifier *cn = QTAILQ_FIRST(&close_notifiers);
nbd_close_notifier(&cn->n, nbd_export_get_blockdev(cn->exp));
}
qemu_set_fd_handler2(server_fd, NULL, NULL, NULL, NULL);
close(server_fd);
... | 14,018 |
qemu | 062ba099e01ff1474be98c0a4f3da351efab5d9d | 1 | int arm_reset_cpu(uint64_t cpuid)
{
CPUState *target_cpu_state;
ARMCPU *target_cpu;
DPRINTF("cpu %" PRId64 "\n", cpuid);
/* change to the cpu we are resetting */
target_cpu_state = arm_get_cpu_by_id(cpuid);
if (!target_cpu_state) {
return QEMU_ARM_POWERCTL_INVALID_PARAM;
... | 14,019 |
FFmpeg | 43cd33be16b21b9a217025e208f4ffbf0bf81da4 | 1 | static void postprocess_chroma(AVFrame *frame, int w, int h, int depth)
{
uint16_t *dstu = (uint16_t *)frame->data[1];
uint16_t *dstv = (uint16_t *)frame->data[2];
int16_t *srcu = (int16_t *)frame->data[1];
int16_t *srcv = (int16_t *)frame->data[2];
ptrdiff_t strideu = frame->linesize[1] / 2... | 14,020 |
FFmpeg | af4cc2605c7a56ecfd84c264aa2b325020418472 | 0 | static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
uint8_t flags, ID3v2ExtraMeta **extra_meta)
{
int isv34, tlen, unsync;
char tag[5];
int64_t next, end = avio_tell(s->pb) + len;
int taghdrlen;
const char *reason = NULL;
AVIOContext pb;
AVI... | 14,021 |
qemu | ef5b234477df80700b128f561f5877a0688a70c8 | 1 | static int ehci_state_fetchqtd(EHCIQueue *q)
{
EHCIqtd qtd;
EHCIPacket *p;
int again = 0;
get_dwords(q->ehci, NLPTR_GET(q->qtdaddr), (uint32_t *) &qtd,
sizeof(EHCIqtd) >> 2);
ehci_trace_qtd(q, NLPTR_GET(q->qtdaddr), &qtd);
p = QTAILQ_FIRST(&q->packets);
if (p != N... | 14,026 |
FFmpeg | 3728603f1854b5c79d1a64dd3b41b80640ef1e7f | 0 | static av_always_inline int encode_line(FFV1Context *s, int w,
int16_t *sample[3],
int plane_index, int bits)
{
PlaneContext *const p = &s->plane[plane_index];
RangeCoder *const c = &s->c;
int x;
int run_index = s->... | 14,028 |
FFmpeg | 37ec7d291eacedfacdce21332f4c719f2be79d12 | 1 | static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
struct Mp4vParseContext *pc = s1->priv_data;
Mpeg4DecContext *dec_ctx = &pc->dec_ctx;
MpegEncContext *s = &dec_ctx->m;
GetBitContext gb1, *gb = &gb1;
... | 14,029 |
qemu | 3e305e4a4752f70c0b5c3cf5b43ec957881714f7 | 1 | void vnc_tls_client_cleanup(VncState *vs)
{
if (vs->tls.session) {
gnutls_deinit(vs->tls.session);
vs->tls.session = NULL;
}
g_free(vs->tls.dname);
}
| 14,032 |
qemu | 9d2db3760be9e32414e22889e3e2bffdf4898f32 | 1 | void colo_do_failover(MigrationState *s)
{
/* Make sure VM stopped while failover happened. */
if (!colo_runstate_is_stopped()) {
vm_stop_force_state(RUN_STATE_COLO);
}
if (get_colo_mode() == COLO_MODE_PRIMARY) {
primary_vm_do_failover();
}
} | 14,033 |
qemu | 441cbac0c7e641780decbc674a9a68c6a5200f71 | 1 | static void test_validate_union_flat(TestInputVisitorData *data,
const void *unused)
{
UserDefFlatUnion *tmp = NULL;
Visitor *v;
Error *err = NULL;
v = validate_test_init(data,
"{ 'enum1': 'value1', "
"'... | 14,035 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
long width, long height,
long lumStride, long chromStride, long dstStride, long vertLumPerChroma)
{
long y;
const long chromWidth= width>>1;
for(y=0; y<height; y++)
{
#ifdef HAVE_MMX
//... | 14,036 |
qemu | 4118a97030aa9bd1d520d1d06bbe0655d829df04 | 1 | int target_munmap(target_ulong start, target_ulong len)
{
target_ulong end, real_start, real_end, addr;
int prot, ret;
#ifdef DEBUG_MMAP
printf("munmap: start=0x%lx len=0x%lx\n", start, len);
#endif
if (start & ~TARGET_PAGE_MASK)
return -EINVAL;
len = TARGET_PAGE_ALIGN(len);
... | 14,037 |
qemu | 0d10193870b5a81c3bce13a602a5403c3a55cf6c | 1 | int cpu_exec(CPUState *env)
{
int ret, interrupt_request;
TranslationBlock *tb;
uint8_t *tc_ptr;
unsigned long next_tb;
if (env->halted) {
if (!cpu_has_work(env)) {
return EXCP_HALTED;
}
env->halted = 0;
}
cpu_single_env = env;
if ... | 14,038 |
FFmpeg | 190f6135b48a97dadd7586f154640bec6468df1b | 0 | callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
{
AVFormatContext *s = priv_data;
struct dshow_ctx *ctx = s->priv_data;
AVPacketList **ppktl, *pktl_next;
// dump_videohdr(s, vdhdr);
WaitForSingleObject(ctx->mutex, INFINITE);
if(shall_we_drop(s))
... | 14,039 |
FFmpeg | 7f526efd17973ec6d2204f7a47b6923e2be31363 | 1 | static inline void RENAME(yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
uint8_t *dst,
unsigned width, unsigned height,
int srcStride1, int srcStride2,
int srcStride3, int dstStride)
{
unsigned long y,x,w,h;
w=width/2; h=height;
for(y=0;y<h;y++){
const uin... | 14,040 |
qemu | 07e95cd529af345fdeea230913f68eff5b925bb6 | 1 | static int qio_channel_websock_handshake_process(QIOChannelWebsock *ioc,
const char *line,
size_t size,
Error **errp)
{
int ret = -1;
char *protocols = qio_cha... | 14,041 |
FFmpeg | b9c8388710a06544812739eedc0a40d3451491dc | 1 | static void *av_mallocz_static(unsigned int size)
{
void *ptr = av_mallocz(size);
if(ptr){
array_static =av_fast_realloc(array_static, &allocated_static, sizeof(void*)*(last_static+1));
if(!array_static)
return NULL;
array_static[last_static++] = ptr;
}
r... | 14,042 |
qemu | 64ffbe04eaafebf4045a3ace52a360c14959d196 | 1 | int index_from_key(const char *key)
{
int i;
for (i = 0; QKeyCode_lookup[i] != NULL; i++) {
if (!strcmp(key, QKeyCode_lookup[i])) {
break;
}
}
/* Return Q_KEY_CODE__MAX if the key is invalid */
return i;
}
| 14,043 |
FFmpeg | 39bb30f6640fe1faf4bbc779a79786028febc95d | 1 | static int mxf_read_primer_pack(MXFContext *mxf)
{
ByteIOContext *pb = mxf->fc->pb;
int item_num = get_be32(pb);
int item_len = get_be32(pb);
if (item_len != 18) {
av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n");
return -1;
}
if (item_num > UINT_... | 14,045 |
qemu | 9a321e92343891e30f6fe8bfaad40454ae358bfb | 1 | static void rtas_ibm_query_interrupt_source_number(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
uint32_t token,
uint32_t nargs,
... | 14,047 |
FFmpeg | d1f558b3628d3ab99fd93a98b5758ef1be45a5da | 0 | static int convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, int max_size)
{
switch (AV_RB32(src)) {
case DCA_SYNCWORD_CORE_BE:
case DCA_SYNCWORD_SUBSTREAM:
memcpy(dst, src, src_size);
return src_size;
case DCA_SYNCWORD_CORE_LE:
case DCA_SYNCWORD_CORE_14B_BE:
... | 14,048 |
FFmpeg | b8866783c6a855643a3869020ac5241b12f7d97a | 0 | int ff_scale_image(uint8_t *dst_data[4], int dst_linesize[4],
int dst_w, int dst_h, enum AVPixelFormat dst_pix_fmt,
uint8_t * const src_data[4], int src_linesize[4],
int src_w, int src_h, enum AVPixelFormat src_pix_fmt,
void *log_ctx)
{
... | 14,049 |
FFmpeg | 229843aa359ae0c9519977d7fa952688db63f559 | 0 | static int ftp_read(URLContext *h, unsigned char *buf, int size)
{
FTPContext *s = h->priv_data;
int read, err, retry_done = 0;
av_dlog(h, "ftp protocol read %d bytes\n", size);
retry:
if (s->state == DISCONNECTED) {
/* optimization */
if (s->position >= s->filesize)
... | 14,050 |
qemu | 62ef3760d4e400849fc663474227bb4668244455 | 1 | sPAPROptionVector *spapr_ovec_new(void)
{
sPAPROptionVector *ov;
ov = g_new0(sPAPROptionVector, 1);
ov->bitmap = bitmap_new(OV_MAXBITS);
return ov;
} | 14,051 |
qemu | bac8d7b45dd855759204117e5a05452ede01bbab | 1 | static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent)
{
char desc[DESC_SIZE];
uint32_t cid;
const char *p_name, *cid_str;
size_t cid_str_size;
BDRVVmdkState *s = bs->opaque;
if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) {
return 0;
}
... | 14,052 |
qemu | 96bc97ebf350ec480b69082819cedb8850f46a0f | 1 | QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id)
{
QemuOpts *opts;
QTAILQ_FOREACH(opts, &list->head, next) {
if (!opts->id) {
if (!id) {
return opts;
}
continue;
}
if (strcmp(opts->id, id) != 0) {
co... | 14,053 |
FFmpeg | df3a96c497c0db51c917e51e5e4a60986979db91 | 1 | static void do_video_out(AVFormatContext *s,
OutputStream *ost,
AVFrame *in_picture,
float quality)
{
int ret, format_video_sync;
AVPacket pkt;
AVCodecContext *enc = ost->st->codec;
int nb_frames;
double sync_ipts, d... | 14,054 |
FFmpeg | 4484c722f68e6a54b8bd701d391897bc092b4404 | 1 | static av_cold int read_specific_config(ALSDecContext *ctx)
{
GetBitContext gb;
uint64_t ht_size;
int i, config_offset;
MPEG4AudioConfig m4ac;
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
uint32_t als_id, header_size, trailer_size;
init_get_bi... | 14,055 |
FFmpeg | a0c624e299730c8c5800375c2f5f3c6c200053ff | 1 | static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
{
V4L2m2mContext *s = avctx->priv_data;
V4L2Context *const capture = &s->capture;
V4L2Context *const output = &s->output;
AVPacket avpkt = {0};
int ret;
ret = ff_decode_get_packet(avctx, &avpkt);
if (ret < 0 && re... | 14,057 |
FFmpeg | 95a57d26d8653d21f0dab1aff3558ee944853dbf | 1 | static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
AVFrame *picture)
{
int compno, reslevelno, bandno;
int x, y;
uint8_t *line;
Jpeg2000T1Context t1;
/* Loop on tile components */
for (compno = 0; compno < s->ncomponents; co... | 14,058 |
FFmpeg | 08ccc474b73a3acef5e56060c8174d4e82ace20d | 1 | static int rtmp_open(URLContext *s, const char *uri, int flags)
{
RTMPContext *rt = s->priv_data;
char proto[8], hostname[256], path[1024], auth[100], *fname;
char *old_app, *qmark, fname_buffer[1024];
uint8_t buf[2048];
int port;
AVDictionary *opts = NULL;
int ret;
if (rt->li... | 14,059 |
FFmpeg | b7fa5c5abb39f819fbb42253711bc13e5cac0e81 | 1 | static int read_random(uint32_t *dst, const char *file)
{
int fd = open(file, O_RDONLY);
int err = -1;
if (fd == -1)
return -1;
#if HAVE_FCNTL && defined(O_NONBLOCK)
if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) != -1)
#endif
err = read(fd, dst, sizeof(*dst));
c... | 14,060 |
qemu | 7faa8075d898ae56d2c533c530569bb25ab86eaf | 1 | static void enable_device(PIIX4PMState *s, int slot)
{
s->ar.gpe.sts[0] |= PIIX4_PCI_HOTPLUG_STATUS;
s->pci0_status.up |= (1 << slot);
}
| 14,061 |
qemu | 3d5b3ec6d460a92245215aaf7b349b0b9e5ffa25 | 1 | static QObject *parse_literal(JSONParserContext *ctxt)
{
QObject *token, *obj;
JSONParserContext saved_ctxt = parser_context_save(ctxt);
token = parser_context_pop_token(ctxt);
if (token == NULL) {
goto out;
}
switch (token_get_type(token)) {
case JSON_STRING:
o... | 14,062 |
qemu | 0ccb9c1d8128a020720d5c6abf99a470742a1b94 | 1 | void cpu_loop(CPUM68KState *env)
{
CPUState *cs = CPU(m68k_env_get_cpu(env));
int trapnr;
unsigned int n;
target_siginfo_t info;
TaskState *ts = cs->opaque;
for(;;) {
cpu_exec_start(cs);
trapnr = cpu_exec(cs);
cpu_exec_end(cs);
process_queued_cpu_work... | 14,064 |
qemu | feeee5aca765606818e00f5a19d19f141f4ae365 | 1 | void do_savevm(Monitor *mon, const QDict *qdict)
{
DriveInfo *dinfo;
BlockDriverState *bs, *bs1;
QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
int ret;
QEMUFile *f;
int saved_vm_running;
uint32_t vm_state_size;
#ifdef _WIN32
struct _timeb tb;
#else
struct... | 14,065 |
qemu | 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 | 1 | int paio_init(void)
{
struct sigaction act;
PosixAioState *s;
int fds[2];
int ret;
if (posix_aio_state)
return 0;
s = qemu_malloc(sizeof(PosixAioState));
sigfillset(&act.sa_mask);
act.sa_flags = 0; /* do not restart syscalls to interrupt select() */
act.sa_ha... | 14,066 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int set_dirty_tracking(void)
{
BlkMigDevState *bmds;
int ret;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
bmds->dirty_bitmap = bdrv_create_dirty_bitmap(bmds->bs, BLOCK_SIZE,
NULL);
if (!bmds->dirty_bitmap) ... | 14,067 |
FFmpeg | bb6c67bb36b136de10256f0999128df4a42f9ffc | 1 | static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{
SliceContext *slice = link->dst->priv;
int y2, ret = 0;
if (slice_dir == 1) {
for (y2 = y; y2 + slice->h <= y + h; y2 += slice->h) {
ret = ff_draw_slice(link->dst->outputs[0], y2, slice->h, slice_dir);
... | 14,068 |
qemu | 5ee5993001cf32addb86a92e2ae8cb090fbc1462 | 1 | void cpu_check_irqs(CPUSPARCState *env)
{
CPUState *cs;
if (env->pil_in && (env->interrupt_index == 0 ||
(env->interrupt_index & ~15) == TT_EXTINT)) {
unsigned int i;
for (i = 15; i > 0; i--) {
if (env->pil_in & (1 << i)) {
int old_interrupt = ... | 14,069 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.