Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
e119a347
Vérifiée
Valider
e119a347
rédigé
Il y a 5 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Bufferfd update, less dirty bomb
parent
bb107fa5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!77
Kara downloader update
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
inc/lektor/bufferfd.h
+1
-1
1 ajout, 1 suppression
inc/lektor/bufferfd.h
src/mkv/bufferfd.c
+12
-8
12 ajouts, 8 suppressions
src/mkv/bufferfd.c
src/mkv/mkv.c
+4
-4
4 ajouts, 4 suppressions
src/mkv/mkv.c
avec
17 ajouts
et
13 suppressions
inc/lektor/bufferfd.h
+
1
−
1
Voir le fichier @
e119a347
...
@@ -42,7 +42,7 @@ ssize_t bufferfd_bytes(struct bufferfd *bf, size_t n, uint8_t *res);
...
@@ -42,7 +42,7 @@ ssize_t bufferfd_bytes(struct bufferfd *bf, size_t n, uint8_t *res);
ssize_t
bufferfd_byte
(
struct
bufferfd
*
bf
,
uint8_t
*
res
);
ssize_t
bufferfd_byte
(
struct
bufferfd
*
bf
,
uint8_t
*
res
);
/* Consume `n` bytes without returning them. */
/* Consume `n` bytes without returning them. */
ssize_t
bufferfd_skip
(
struct
bufferfd
*
bf
,
size_t
n
);
ssize_t
bufferfd_skip
(
struct
bufferfd
*
bf
,
const
size_t
n
);
/* Move the file cursor to the absolute position `pos` (0 is the beginning of
/* Move the file cursor to the absolute position `pos` (0 is the beginning of
* the file).
* the file).
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/mkv/bufferfd.c
+
12
−
8
Voir le fichier @
e119a347
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
#include
<lektor/bufferfd.h>
#include
<lektor/bufferfd.h>
static
ssize_t
static
inline
ssize_t
bufferfd
_fill
(
struct
bufferfd
*
bf
)
_
_fill
(
struct
bufferfd
*
bf
)
{
{
if
(
bf
->
len
<=
bf
->
pos
)
{
if
(
bf
->
len
<=
bf
->
pos
)
{
ssize_t
n
=
read
(
bf
->
fd
,
bf
->
buffer
,
BUFFER_MAX
);
ssize_t
n
=
read
(
bf
->
fd
,
bf
->
buffer
,
BUFFER_MAX
);
...
@@ -24,8 +24,7 @@ bufferfd_fill(struct bufferfd *bf)
...
@@ -24,8 +24,7 @@ bufferfd_fill(struct bufferfd *bf)
ssize_t
ssize_t
bufferfd_bytes
(
struct
bufferfd
*
bf
,
size_t
n
,
uint8_t
*
res
)
bufferfd_bytes
(
struct
bufferfd
*
bf
,
size_t
n
,
uint8_t
*
res
)
{
{
// TODO repeat until n is reached
ssize_t
r
=
__fill
(
bf
);
/* TODO repeat until n is reached */
ssize_t
r
=
bufferfd_fill
(
bf
);
if
(
r
<
(
ssize_t
)
n
)
if
(
r
<
(
ssize_t
)
n
)
return
-
1
;
return
-
1
;
...
@@ -41,14 +40,19 @@ bufferfd_byte(struct bufferfd *bf, uint8_t *res)
...
@@ -41,14 +40,19 @@ bufferfd_byte(struct bufferfd *bf, uint8_t *res)
return
bufferfd_bytes
(
bf
,
1
,
res
);
return
bufferfd_bytes
(
bf
,
1
,
res
);
}
}
ssize_t
static
inline
ssize_t
bufferfd
_skip
(
struct
bufferfd
*
bf
,
size_t
n
)
_
_skip
(
struct
bufferfd
*
bf
,
const
size_t
n
,
const
size_t
b_size
)
{
{
// TODO less dirty bomb
uint8_t
b
[
b_size
];
uint8_t
b
[
4096
];
return
bufferfd_bytes
(
bf
,
n
,
b
);
return
bufferfd_bytes
(
bf
,
n
,
b
);
}
}
ssize_t
bufferfd_skip
(
struct
bufferfd
*
bf
,
const
size_t
n
)
{
return
__skip
(
bf
,
n
,
n
>
BUFFER_MAX
?
BUFFER_MAX
:
n
);
}
ssize_t
ssize_t
bufferfd_seek
(
struct
bufferfd
*
bf
,
size_t
pos
)
bufferfd_seek
(
struct
bufferfd
*
bf
,
size_t
pos
)
{
{
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/mkv/mkv.c
+
4
−
4
Voir le fichier @
e119a347
...
@@ -23,14 +23,14 @@
...
@@ -23,14 +23,14 @@
#define EBML_MKV_TAGS 0x1254c367
#define EBML_MKV_TAGS 0x1254c367
#define EBML_MKV_TAG 0x00007373
#define EBML_MKV_TAG 0x00007373
#define EBML_MKV_TAG_TARGETS 0x000063c0
#define EBML_MKV_TAG_TARGETS 0x000063c0
#define EBML_MKV_TAG_TTV 0x000068ca /
/
TargetTypeValue
#define EBML_MKV_TAG_TTV 0x000068ca
/
*
TargetTypeValue
*/
#define EBML_MKV_TAG_SIMPLE 0x000067c8 /
/
SimpleTag
#define EBML_MKV_TAG_SIMPLE 0x000067c8
/
*
SimpleTag
*/
#define EBML_MKV_TAG_NAME 0x000045a3
#define EBML_MKV_TAG_NAME 0x000045a3
#define EBML_MKV_TAG_STRING 0x00004487
#define EBML_MKV_TAG_STRING 0x00004487
#define EBML_MKV_TAG_BINARY 0x00004485
#define EBML_MKV_TAG_BINARY 0x00004485
#define EBML_MKV_CRC32 0x0000000bf /
/
CRC-32, they skip it in mpv (demux/ebml.c:463 aprox)
#define EBML_MKV_CRC32 0x0000000bf
/
*
CRC-32, they skip it in mpv (demux/ebml.c:463 aprox)
*/
#define EBML_MKV_VOID 0x0000000ec /
/
VOID element
#define EBML_MKV_VOID 0x0000000ec
/
*
VOID element
*/
/* mkv_read_* functions take data from the bufferfd and parse the next "*" (one
/* mkv_read_* functions take data from the bufferfd and parse the next "*" (one
* of the following):
* of the following):
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter