Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
72eaba5e
Commit
72eaba5e
authored
Aug 21, 2012
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: Convert some commented-out printf/av_log instances to av_dlog
parent
11d4e92e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
29 deletions
+61
-29
asfdec.c
libavformat/asfdec.c
+19
-10
assdec.c
libavformat/assdec.c
+1
-1
avidec.c
libavformat/avidec.c
+16
-7
mpegenc.c
libavformat/mpegenc.c
+7
-2
mpegts.c
libavformat/mpegts.c
+4
-2
mpegtsenc.c
libavformat/mpegtsenc.c
+1
-1
mxfenc.c
libavformat/mxfenc.c
+1
-1
rmdec.c
libavformat/rmdec.c
+3
-2
utils.c
libavformat/utils.c
+9
-3
No files found.
libavformat/asfdec.c
View file @
72eaba5e
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
//#define DEBUG
//#define DEBUG
#include "libavutil/attributes.h"
#include "libavutil/bswap.h"
#include "libavutil/bswap.h"
#include "libavutil/common.h"
#include "libavutil/common.h"
#include "libavutil/avstring.h"
#include "libavutil/avstring.h"
...
@@ -618,16 +619,18 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
...
@@ -618,16 +619,18 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)
for
(
i
=
0
;
i
<
n
;
i
++
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
char
name
[
1024
];
char
name
[
1024
];
int
av_unused
value_type
;
avio_rl16
(
pb
);
//lang_list_index
avio_rl16
(
pb
);
//lang_list_index
stream_num
=
avio_rl16
(
pb
);
stream_num
=
avio_rl16
(
pb
);
name_len
=
avio_rl16
(
pb
);
name_len
=
avio_rl16
(
pb
);
avio_skip
(
pb
,
2
);
/* value_type */
value_type
=
avio_rl16
(
pb
);
/* value_type */
value_len
=
avio_rl32
(
pb
);
value_len
=
avio_rl32
(
pb
);
if
((
ret
=
avio_get_str16le
(
pb
,
name_len
,
name
,
sizeof
(
name
)))
<
name_len
)
if
((
ret
=
avio_get_str16le
(
pb
,
name_len
,
name
,
sizeof
(
name
)))
<
name_len
)
avio_skip
(
pb
,
name_len
-
ret
);
avio_skip
(
pb
,
name_len
-
ret
);
//av_log(s, AV_LOG_ERROR, "%d %d %d %d %d <%s>\n", i, stream_num, name_len, value_type, value_len, name);
av_dlog
(
s
,
"%d %d %d %d %d <%s>
\n
"
,
i
,
stream_num
,
name_len
,
value_type
,
value_len
,
name
);
value_num
=
avio_rl16
(
pb
);
//we should use get_value() here but it does not work 2 is le16 here but le32 elsewhere
value_num
=
avio_rl16
(
pb
);
//we should use get_value() here but it does not work 2 is le16 here but le32 elsewhere
avio_skip
(
pb
,
value_len
-
2
);
avio_skip
(
pb
,
value_len
-
2
);
...
@@ -774,7 +777,9 @@ static int asf_read_header(AVFormatContext *s)
...
@@ -774,7 +777,9 @@ static int asf_read_header(AVFormatContext *s)
&
st
->
sample_aspect_ratio
.
den
,
&
st
->
sample_aspect_ratio
.
den
,
asf
->
dar
[
0
].
num
,
asf
->
dar
[
0
].
den
,
INT_MAX
);
asf
->
dar
[
0
].
num
,
asf
->
dar
[
0
].
den
,
INT_MAX
);
//av_log(s, AV_LOG_INFO, "i=%d, st->codec->codec_type:%d, dar %d:%d sar=%d:%d\n", i, st->codec->codec_type, dar[i].num, dar[i].den, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
av_dlog
(
s
,
"i=%d, st->codec->codec_type:%d, asf->dar %d:%d sar=%d:%d
\n
"
,
i
,
st
->
codec
->
codec_type
,
asf
->
dar
[
i
].
num
,
asf
->
dar
[
i
].
den
,
st
->
sample_aspect_ratio
.
num
,
st
->
sample_aspect_ratio
.
den
);
// copy and convert language codes to the frontend
// copy and convert language codes to the frontend
if
(
asf
->
streams
[
i
].
stream_language_index
<
128
)
{
if
(
asf
->
streams
[
i
].
stream_language_index
<
128
)
{
...
@@ -916,7 +921,9 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
...
@@ -916,7 +921,9 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
DO_2BITS
(
asf
->
packet_property
>>
4
,
asf
->
packet_seq
,
0
);
DO_2BITS
(
asf
->
packet_property
>>
4
,
asf
->
packet_seq
,
0
);
DO_2BITS
(
asf
->
packet_property
>>
2
,
asf
->
packet_frag_offset
,
0
);
DO_2BITS
(
asf
->
packet_property
>>
2
,
asf
->
packet_frag_offset
,
0
);
DO_2BITS
(
asf
->
packet_property
,
asf
->
packet_replic_size
,
0
);
DO_2BITS
(
asf
->
packet_property
,
asf
->
packet_replic_size
,
0
);
//printf("key:%d stream:%d seq:%d offset:%d replic_size:%d\n", asf->packet_key_frame, asf->stream_index, asf->packet_seq, //asf->packet_frag_offset, asf->packet_replic_size);
av_dlog
(
asf
,
"key:%d stream:%d seq:%d offset:%d replic_size:%d
\n
"
,
asf
->
packet_key_frame
,
asf
->
stream_index
,
asf
->
packet_seq
,
asf
->
packet_frag_offset
,
asf
->
packet_replic_size
);
if
(
asf
->
packet_replic_size
>=
8
)
{
if
(
asf
->
packet_replic_size
>=
8
)
{
asf
->
packet_obj_size
=
avio_rl32
(
pb
);
asf
->
packet_obj_size
=
avio_rl32
(
pb
);
if
(
asf
->
packet_obj_size
>=
(
1
<<
24
)
||
asf
->
packet_obj_size
<=
0
){
if
(
asf
->
packet_obj_size
>=
(
1
<<
24
)
||
asf
->
packet_obj_size
<=
0
){
...
@@ -1082,9 +1089,11 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
...
@@ -1082,9 +1089,11 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
asf_st
->
palette_changed
=
0
;
asf_st
->
palette_changed
=
0
;
}
}
}
}
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
av_dlog
(
asf
,
"new packet: stream:%d key:%d packet_key:%d audio:%d size:%d
\n
"
,
//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & AV_PKT_FLAG_KEY,
asf
->
stream_index
,
asf
->
packet_key_frame
,
//s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, asf->packet_obj_size);
asf_st
->
pkt
.
flags
&
AV_PKT_FLAG_KEY
,
s
->
streams
[
asf
->
stream_index
]
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
,
asf
->
packet_obj_size
);
if
(
s
->
streams
[
asf
->
stream_index
]
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
if
(
s
->
streams
[
asf
->
stream_index
]
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
asf
->
packet_key_frame
=
1
;
asf
->
packet_key_frame
=
1
;
if
(
asf
->
packet_key_frame
)
if
(
asf
->
packet_key_frame
)
...
@@ -1092,9 +1101,9 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
...
@@ -1092,9 +1101,9 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
}
}
/* read data */
/* read data */
//printf(
"READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n",
av_dlog
(
asf
,
"READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p
\n
"
,
//
s->packet_size, asf_st->pkt.size, asf->packet_frag_offset,
s
->
packet_size
,
asf_st
->
pkt
.
size
,
asf
->
packet_frag_offset
,
//
asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data);
asf_st
->
frag_offset
,
asf
->
packet_frag_size
,
asf_st
->
pkt
.
data
);
asf
->
packet_size_left
-=
asf
->
packet_frag_size
;
asf
->
packet_size_left
-=
asf
->
packet_frag_size
;
if
(
asf
->
packet_size_left
<
0
)
if
(
asf
->
packet_size_left
<
0
)
continue
;
continue
;
...
...
libavformat/assdec.c
View file @
72eaba5e
...
@@ -60,7 +60,7 @@ static int64_t get_pts(const uint8_t *p)
...
@@ -60,7 +60,7 @@ static int64_t get_pts(const uint8_t *p)
if
(
sscanf
(
p
,
"%*[^,],%d:%d:%d%*c%d"
,
&
hour
,
&
min
,
&
sec
,
&
hsec
)
!=
4
)
if
(
sscanf
(
p
,
"%*[^,],%d:%d:%d%*c%d"
,
&
hour
,
&
min
,
&
sec
,
&
hsec
)
!=
4
)
return
AV_NOPTS_VALUE
;
return
AV_NOPTS_VALUE
;
// av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d [%s]\n", i
, hour, min, sec, hsec, p);
av_dlog
(
NULL
,
"%d %d %d %d [%s]
\n
"
,
hour
,
min
,
sec
,
hsec
,
p
);
min
+=
60
*
hour
;
min
+=
60
*
hour
;
sec
+=
60
*
min
;
sec
+=
60
*
min
;
...
...
libavformat/avidec.c
View file @
72eaba5e
...
@@ -513,7 +513,8 @@ static int avi_read_header(AVFormatContext *s)
...
@@ -513,7 +513,8 @@ static int avi_read_header(AVFormatContext *s)
avio_rl32
(
pb
);
/* quality */
avio_rl32
(
pb
);
/* quality */
ast
->
sample_size
=
avio_rl32
(
pb
);
/* sample ssize */
ast
->
sample_size
=
avio_rl32
(
pb
);
/* sample ssize */
ast
->
cum_len
*=
FFMAX
(
1
,
ast
->
sample_size
);
ast
->
cum_len
*=
FFMAX
(
1
,
ast
->
sample_size
);
// av_log(s, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size);
av_dlog
(
s
,
"%"
PRIu32
" %"
PRIu32
" %d
\n
"
,
ast
->
rate
,
ast
->
scale
,
ast
->
sample_size
);
switch
(
tag1
)
{
switch
(
tag1
)
{
case
MKTAG
(
'v'
,
'i'
,
'd'
,
's'
):
case
MKTAG
(
'v'
,
'i'
,
'd'
,
's'
):
...
@@ -690,7 +691,9 @@ static int avi_read_header(AVFormatContext *s)
...
@@ -690,7 +691,9 @@ static int avi_read_header(AVFormatContext *s)
if
(
active_aspect
.
num
&&
active_aspect
.
den
&&
active
.
num
&&
active
.
den
){
if
(
active_aspect
.
num
&&
active_aspect
.
den
&&
active
.
num
&&
active
.
den
){
st
->
sample_aspect_ratio
=
av_div_q
(
active_aspect
,
active
);
st
->
sample_aspect_ratio
=
av_div_q
(
active_aspect
,
active
);
//av_log(s, AV_LOG_ERROR, "vprp %d/%d %d/%d\n", active_aspect.num, active_aspect.den, active.num, active.den);
av_dlog
(
s
,
"vprp %d/%d %d/%d
\n
"
,
active_aspect
.
num
,
active_aspect
.
den
,
active
.
num
,
active
.
den
);
}
}
size
-=
9
*
4
;
size
-=
9
*
4
;
}
}
...
@@ -860,7 +863,8 @@ start_sync:
...
@@ -860,7 +863,8 @@ start_sync:
size
=
d
[
4
]
+
(
d
[
5
]
<<
8
)
+
(
d
[
6
]
<<
16
)
+
(
d
[
7
]
<<
24
);
size
=
d
[
4
]
+
(
d
[
5
]
<<
8
)
+
(
d
[
6
]
<<
16
)
+
(
d
[
7
]
<<
24
);
n
=
get_stream_idx
(
d
+
2
);
n
=
get_stream_idx
(
d
+
2
);
//av_log(s, AV_LOG_DEBUG, "%X %X %X %X %X %X %X %X %"PRId64" %d %d\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
av_dlog
(
s
,
"%X %X %X %X %X %X %X %X %"
PRId64
" %u %d
\n
"
,
d
[
0
],
d
[
1
],
d
[
2
],
d
[
3
],
d
[
4
],
d
[
5
],
d
[
6
],
d
[
7
],
i
,
size
,
n
);
if
(
i
+
(
uint64_t
)
size
>
avi
->
fsize
||
d
[
0
]
>
127
)
if
(
i
+
(
uint64_t
)
size
>
avi
->
fsize
||
d
[
0
]
>
127
)
continue
;
continue
;
...
@@ -1003,7 +1007,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -1003,7 +1007,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
ts
=
av_rescale_q
(
ts
,
st
->
time_base
,
(
AVRational
){
FFMAX
(
1
,
ast
->
sample_size
),
AV_TIME_BASE
});
ts
=
av_rescale_q
(
ts
,
st
->
time_base
,
(
AVRational
){
FFMAX
(
1
,
ast
->
sample_size
),
AV_TIME_BASE
});
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset);
av_dlog
(
s
,
"%"
PRId64
" %d/%d %"
PRId64
"
\n
"
,
ts
,
st
->
time_base
.
num
,
st
->
time_base
.
den
,
ast
->
frame_offset
);
if
(
ts
<
best_ts
){
if
(
ts
<
best_ts
){
best_ts
=
ts
;
best_ts
=
ts
;
best_st
=
st
;
best_st
=
st
;
...
@@ -1092,7 +1097,9 @@ resync:
...
@@ -1092,7 +1097,9 @@ resync:
// pkt->dts += ast->start;
// pkt->dts += ast->start;
if
(
ast
->
sample_size
)
if
(
ast
->
sample_size
)
pkt
->
dts
/=
ast
->
sample_size
;
pkt
->
dts
/=
ast
->
sample_size
;
//av_log(s, AV_LOG_DEBUG, "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d base:%d st:%d size:%d\n", pkt->dts, ast->frame_offset, ast->scale, ast->rate, ast->sample_size, AV_TIME_BASE, avi->stream_index, size);
av_dlog
(
s
,
"dts:%"
PRId64
" offset:%"
PRId64
" %d/%d smpl_siz:%d base:%d st:%d size:%d
\n
"
,
pkt
->
dts
,
ast
->
frame_offset
,
ast
->
scale
,
ast
->
rate
,
ast
->
sample_size
,
AV_TIME_BASE
,
avi
->
stream_index
,
size
);
pkt
->
stream_index
=
avi
->
stream_index
;
pkt
->
stream_index
=
avi
->
stream_index
;
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
...
@@ -1292,7 +1299,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
...
@@ -1292,7 +1299,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
pos
=
st
->
index_entries
[
index
].
pos
;
pos
=
st
->
index_entries
[
index
].
pos
;
timestamp
=
st
->
index_entries
[
index
].
timestamp
/
FFMAX
(
ast
->
sample_size
,
1
);
timestamp
=
st
->
index_entries
[
index
].
timestamp
/
FFMAX
(
ast
->
sample_size
,
1
);
// av_log(s, AV_LOG_DEBUG, "XX %"PRId64" %d %"PRId64"\n", timestamp, index, st->index_entries[index].timestamp);
av_dlog
(
s
,
"XX %"
PRId64
" %d %"
PRId64
"
\n
"
,
timestamp
,
index
,
st
->
index_entries
[
index
].
timestamp
);
if
(
CONFIG_DV_DEMUXER
&&
avi
->
dv_demux
)
{
if
(
CONFIG_DV_DEMUXER
&&
avi
->
dv_demux
)
{
/* One and only one real stream for DV in AVI, and it has video */
/* One and only one real stream for DV in AVI, and it has video */
...
@@ -1340,7 +1348,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
...
@@ -1340,7 +1348,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
index
++
;
index
++
;
}
}
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %"PRId64"\n", timestamp, index, st2->index_entries[index].timestamp);
av_dlog
(
s
,
"%"
PRId64
" %d %"
PRId64
"
\n
"
,
timestamp
,
index
,
st2
->
index_entries
[
index
].
timestamp
);
/* extract the current frame number */
/* extract the current frame number */
ast2
->
frame_offset
=
st2
->
index_entries
[
index
].
timestamp
;
ast2
->
frame_offset
=
st2
->
index_entries
[
index
].
timestamp
;
}
}
...
...
libavformat/mpegenc.c
View file @
72eaba5e
...
@@ -1003,7 +1003,10 @@ retry:
...
@@ -1003,7 +1003,10 @@ retry:
}
}
if
(
timestamp_packet
){
if
(
timestamp_packet
){
//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f scr:%f stream:%d\n", timestamp_packet->dts/90000.0, timestamp_packet->pts/90000.0, scr/90000.0, best_i);
av_dlog
(
ctx
,
"dts:%f pts:%f scr:%f stream:%d
\n
"
,
timestamp_packet
->
dts
/
90000
.
0
,
timestamp_packet
->
pts
/
90000
.
0
,
scr
/
90000
.
0
,
best_i
);
es_size
=
flush_packet
(
ctx
,
best_i
,
timestamp_packet
->
pts
,
timestamp_packet
->
dts
,
scr
,
trailer_size
);
es_size
=
flush_packet
(
ctx
,
best_i
,
timestamp_packet
->
pts
,
timestamp_packet
->
dts
,
scr
,
trailer_size
);
}
else
{
}
else
{
assert
(
av_fifo_size
(
stream
->
fifo
)
==
trailer_size
);
assert
(
av_fifo_size
(
stream
->
fifo
)
==
trailer_size
);
...
@@ -1062,7 +1065,9 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
...
@@ -1062,7 +1065,9 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
dts
+=
2
*
preload
;
dts
+=
2
*
preload
;
}
}
//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/90000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE);
av_dlog
(
ctx
,
"dts:%f pts:%f flags:%d stream:%d nopts:%d
\n
"
,
dts
/
90000
.
0
,
pts
/
90000
.
0
,
pkt
->
flags
,
pkt
->
stream_index
,
pts
!=
AV_NOPTS_VALUE
);
if
(
!
stream
->
premux_packet
)
if
(
!
stream
->
premux_packet
)
stream
->
next_packet
=
&
stream
->
premux_packet
;
stream
->
next_packet
=
&
stream
->
premux_packet
;
*
stream
->
next_packet
=
*
stream
->
next_packet
=
...
...
libavformat/mpegts.c
View file @
72eaba5e
...
@@ -411,7 +411,8 @@ static int get_packet_size(const uint8_t *buf, int size)
...
@@ -411,7 +411,8 @@ static int get_packet_size(const uint8_t *buf, int size)
score
=
analyze
(
buf
,
size
,
TS_PACKET_SIZE
,
NULL
);
score
=
analyze
(
buf
,
size
,
TS_PACKET_SIZE
,
NULL
);
dvhs_score
=
analyze
(
buf
,
size
,
TS_DVHS_PACKET_SIZE
,
NULL
);
dvhs_score
=
analyze
(
buf
,
size
,
TS_DVHS_PACKET_SIZE
,
NULL
);
fec_score
=
analyze
(
buf
,
size
,
TS_FEC_PACKET_SIZE
,
NULL
);
fec_score
=
analyze
(
buf
,
size
,
TS_FEC_PACKET_SIZE
,
NULL
);
// av_log(NULL, AV_LOG_DEBUG, "score: %d, dvhs_score: %d, fec_score: %d \n", score, dvhs_score, fec_score);
av_dlog
(
NULL
,
"score: %d, dvhs_score: %d, fec_score: %d
\n
"
,
score
,
dvhs_score
,
fec_score
);
if
(
score
>
fec_score
&&
score
>
dvhs_score
)
return
TS_PACKET_SIZE
;
if
(
score
>
fec_score
&&
score
>
dvhs_score
)
return
TS_PACKET_SIZE
;
else
if
(
dvhs_score
>
score
&&
dvhs_score
>
fec_score
)
return
TS_DVHS_PACKET_SIZE
;
else
if
(
dvhs_score
>
score
&&
dvhs_score
>
fec_score
)
return
TS_DVHS_PACKET_SIZE
;
...
@@ -1835,7 +1836,8 @@ static int mpegts_probe(AVProbeData *p)
...
@@ -1835,7 +1836,8 @@ static int mpegts_probe(AVProbeData *p)
score
=
analyze
(
p
->
buf
,
TS_PACKET_SIZE
*
check_count
,
TS_PACKET_SIZE
,
NULL
)
*
CHECK_COUNT
/
check_count
;
score
=
analyze
(
p
->
buf
,
TS_PACKET_SIZE
*
check_count
,
TS_PACKET_SIZE
,
NULL
)
*
CHECK_COUNT
/
check_count
;
dvhs_score
=
analyze
(
p
->
buf
,
TS_DVHS_PACKET_SIZE
*
check_count
,
TS_DVHS_PACKET_SIZE
,
NULL
)
*
CHECK_COUNT
/
check_count
;
dvhs_score
=
analyze
(
p
->
buf
,
TS_DVHS_PACKET_SIZE
*
check_count
,
TS_DVHS_PACKET_SIZE
,
NULL
)
*
CHECK_COUNT
/
check_count
;
fec_score
=
analyze
(
p
->
buf
,
TS_FEC_PACKET_SIZE
*
check_count
,
TS_FEC_PACKET_SIZE
,
NULL
)
*
CHECK_COUNT
/
check_count
;
fec_score
=
analyze
(
p
->
buf
,
TS_FEC_PACKET_SIZE
*
check_count
,
TS_FEC_PACKET_SIZE
,
NULL
)
*
CHECK_COUNT
/
check_count
;
// av_log(NULL, AV_LOG_DEBUG, "score: %d, dvhs_score: %d, fec_score: %d \n", score, dvhs_score, fec_score);
av_dlog
(
NULL
,
"score: %d, dvhs_score: %d, fec_score: %d
\n
"
,
score
,
dvhs_score
,
fec_score
);
// we need a clear definition for the returned score otherwise things will become messy sooner or later
// we need a clear definition for the returned score otherwise things will become messy sooner or later
if
(
score
>
fec_score
&&
score
>
dvhs_score
&&
score
>
6
)
return
AVPROBE_SCORE_MAX
+
score
-
CHECK_COUNT
;
if
(
score
>
fec_score
&&
score
>
dvhs_score
&&
score
>
6
)
return
AVPROBE_SCORE_MAX
+
score
-
CHECK_COUNT
;
...
...
libavformat/mpegtsenc.c
View file @
72eaba5e
...
@@ -1017,7 +1017,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
...
@@ -1017,7 +1017,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
do
{
do
{
p
=
avpriv_mpv_find_start_code
(
p
,
buf_end
,
&
state
);
p
=
avpriv_mpv_find_start_code
(
p
,
buf_end
,
&
state
);
//av_log(s, AV_LOG_INFO
, "nal %d\n", state & 0x1f);
av_dlog
(
s
,
"nal %d
\n
"
,
state
&
0x1f
);
}
while
(
p
<
buf_end
&&
(
state
&
0x1f
)
!=
9
&&
}
while
(
p
<
buf_end
&&
(
state
&
0x1f
)
!=
9
&&
(
state
&
0x1f
)
!=
5
&&
(
state
&
0x1f
)
!=
1
);
(
state
&
0x1f
)
!=
5
&&
(
state
&
0x1f
)
!=
1
);
...
...
libavformat/mxfenc.c
View file @
72eaba5e
...
@@ -1856,7 +1856,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
...
@@ -1856,7 +1856,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
}
}
*
out
=
pktl
->
pkt
;
*
out
=
pktl
->
pkt
;
//av_log(s, AV_LOG_DEBUG
, "out st:%d dts:%lld\n", (*out).stream_index, (*out).dts);
av_dlog
(
s
,
"out st:%d dts:%lld
\n
"
,
(
*
out
).
stream_index
,
(
*
out
).
dts
);
s
->
packet_buffer
=
pktl
->
next
;
s
->
packet_buffer
=
pktl
->
next
;
if
(
s
->
streams
[
pktl
->
pkt
.
stream_index
]
->
last_in_packet_buffer
==
pktl
)
if
(
s
->
streams
[
pktl
->
pkt
.
stream_index
]
->
last_in_packet_buffer
==
pktl
)
s
->
streams
[
pktl
->
pkt
.
stream_index
]
->
last_in_packet_buffer
=
NULL
;
s
->
streams
[
pktl
->
pkt
.
stream_index
]
->
last_in_packet_buffer
=
NULL
;
...
...
libavformat/rmdec.c
View file @
72eaba5e
...
@@ -330,7 +330,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
...
@@ -330,7 +330,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
st
->
codec
->
codec_tag
=
avio_rl32
(
pb
);
st
->
codec
->
codec_tag
=
avio_rl32
(
pb
);
st
->
codec
->
codec_id
=
ff_codec_get_id
(
ff_rm_codec_tags
,
st
->
codec
->
codec_id
=
ff_codec_get_id
(
ff_rm_codec_tags
,
st
->
codec
->
codec_tag
);
st
->
codec
->
codec_tag
);
// av_log(s, AV_LOG_DEBUG
, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
av_dlog
(
s
,
"%X %X
\n
"
,
st
->
codec
->
codec_tag
,
MKTAG
(
'R'
,
'V'
,
'2'
,
'0'
));
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_NONE
)
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_NONE
)
goto
fail1
;
goto
fail1
;
st
->
codec
->
width
=
avio_rb16
(
pb
);
st
->
codec
->
width
=
avio_rb16
(
pb
);
...
@@ -969,7 +969,8 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
...
@@ -969,7 +969,8 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
}
}
if
((
flags
&
2
)
&&
(
seq
&
0x7F
)
==
1
){
if
((
flags
&
2
)
&&
(
seq
&
0x7F
)
==
1
){
// av_log(s, AV_LOG_DEBUG, "%d %d-%d %"PRId64" %d\n", flags, stream_index2, stream_index, dts, seq);
av_dlog
(
s
,
"%d %d-%d %"
PRId64
" %d
\n
"
,
flags
,
stream_index2
,
stream_index
,
dts
,
seq
);
av_add_index_entry
(
st
,
pos
,
dts
,
0
,
0
,
AVINDEX_KEYFRAME
);
av_add_index_entry
(
st
,
pos
,
dts
,
0
,
0
,
AVINDEX_KEYFRAME
);
if
(
stream_index2
==
stream_index
)
if
(
stream_index2
==
stream_index
)
break
;
break
;
...
...
libavformat/utils.c
View file @
72eaba5e
...
@@ -952,7 +952,10 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
...
@@ -952,7 +952,10 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
>
pkt
->
dts
)
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
!=
AV_NOPTS_VALUE
&&
pkt
->
pts
>
pkt
->
dts
)
presentation_delayed
=
1
;
presentation_delayed
=
1
;
// av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc);
av_dlog
(
NULL
,
"IN delayed:%d pts:%"
PRId64
", dts:%"
PRId64
" cur_dts:%"
PRId64
" st:%d pc:%p
\n
"
,
presentation_delayed
,
pkt
->
pts
,
pkt
->
dts
,
st
->
cur_dts
,
pkt
->
stream_index
,
pc
);
/* interpolate PTS and DTS if they are not present */
/* interpolate PTS and DTS if they are not present */
//We skip H264 currently because delay and has_b_frames are not reliably set
//We skip H264 currently because delay and has_b_frames are not reliably set
if
((
delay
==
0
||
(
delay
==
1
&&
pc
))
&&
st
->
codec
->
codec_id
!=
AV_CODEC_ID_H264
){
if
((
delay
==
0
||
(
delay
==
1
&&
pc
))
&&
st
->
codec
->
codec_id
!=
AV_CODEC_ID_H264
){
...
@@ -1022,7 +1025,9 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
...
@@ -1022,7 +1025,9 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
st
->
cur_dts
=
pkt
->
dts
;
st
->
cur_dts
=
pkt
->
dts
;
}
}
// av_log(NULL, AV_LOG_ERROR, "OUTdelayed:%d/%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64"\n", presentation_delayed, delay, pkt->pts, pkt->dts, st->cur_dts);
av_dlog
(
NULL
,
"OUTdelayed:%d/%d pts:%"
PRId64
", dts:%"
PRId64
" cur_dts:%"
PRId64
"
\n
"
,
presentation_delayed
,
delay
,
pkt
->
pts
,
pkt
->
dts
,
st
->
cur_dts
);
/* update flags */
/* update flags */
if
(
is_intra_only
(
st
->
codec
->
codec_id
))
if
(
is_intra_only
(
st
->
codec
->
codec_id
))
...
@@ -3068,7 +3073,8 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
...
@@ -3068,7 +3073,8 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
// av_log(s, AV_LOG_DEBUG, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n", pkt->pts, pkt->dts);
av_dlog
(
s
,
"av_write_frame: pts2:%"
PRId64
" dts2:%"
PRId64
"
\n
"
,
pkt
->
pts
,
pkt
->
dts
);
st
->
cur_dts
=
pkt
->
dts
;
st
->
cur_dts
=
pkt
->
dts
;
st
->
pts
.
val
=
pkt
->
dts
;
st
->
pts
.
val
=
pkt
->
dts
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment