Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
75cc85b2
Commit
75cc85b2
authored
Dec 17, 2012
by
Piotr Bandurski
Committed by
Michael Niedermayer
Dec 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cdxl: fix duration
fixes ticket #1937 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
03b84f2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
cdxl.c
libavformat/cdxl.c
+13
-1
No files found.
libavformat/cdxl.c
View file @
75cc85b2
...
@@ -37,6 +37,7 @@ typedef struct CDXLDemuxContext {
...
@@ -37,6 +37,7 @@ typedef struct CDXLDemuxContext {
uint8_t
header
[
CDXL_HEADER_SIZE
];
uint8_t
header
[
CDXL_HEADER_SIZE
];
int
video_stream_index
;
int
video_stream_index
;
int
audio_stream_index
;
int
audio_stream_index
;
int64_t
filesize
;
}
CDXLDemuxContext
;
}
CDXLDemuxContext
;
static
int
cdxl_read_probe
(
AVProbeData
*
p
)
static
int
cdxl_read_probe
(
AVProbeData
*
p
)
...
@@ -96,6 +97,8 @@ static int cdxl_read_header(AVFormatContext *s)
...
@@ -96,6 +97,8 @@ static int cdxl_read_header(AVFormatContext *s)
cdxl
->
video_stream_index
=
-
1
;
cdxl
->
video_stream_index
=
-
1
;
cdxl
->
audio_stream_index
=
-
1
;
cdxl
->
audio_stream_index
=
-
1
;
cdxl
->
filesize
=
avio_size
(
s
->
pb
);
s
->
ctx_flags
|=
AVFMTCTX_NOHEADER
;
s
->
ctx_flags
|=
AVFMTCTX_NOHEADER
;
return
0
;
return
0
;
...
@@ -108,7 +111,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -108,7 +111,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t
current_size
,
video_size
,
image_size
;
uint32_t
current_size
,
video_size
,
image_size
;
uint16_t
audio_size
,
palette_size
,
width
,
height
;
uint16_t
audio_size
,
palette_size
,
width
,
height
;
int64_t
pos
;
int64_t
pos
;
int
ret
;
int
frames
,
ret
;
if
(
avio_feof
(
pb
))
if
(
avio_feof
(
pb
))
return
AVERROR_EOF
;
return
AVERROR_EOF
;
...
@@ -175,6 +178,15 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -175,6 +178,15 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
st
->
codec
->
codec_id
=
AV_CODEC_ID_CDXL
;
st
->
codec
->
codec_id
=
AV_CODEC_ID_CDXL
;
st
->
codec
->
width
=
width
;
st
->
codec
->
width
=
width
;
st
->
codec
->
height
=
height
;
st
->
codec
->
height
=
height
;
if
(
audio_size
+
video_size
&&
cdxl
->
filesize
>
0
)
{
frames
=
cdxl
->
filesize
/
(
audio_size
+
video_size
);
if
(
cdxl
->
framerate
)
st
->
duration
=
frames
;
else
st
->
duration
=
frames
*
audio_size
;
}
st
->
start_time
=
0
;
st
->
start_time
=
0
;
cdxl
->
video_stream_index
=
st
->
index
;
cdxl
->
video_stream_index
=
st
->
index
;
if
(
cdxl
->
framerate
)
if
(
cdxl
->
framerate
)
...
...
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