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
42b8f5fb
Commit
42b8f5fb
authored
Sep 16, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/segafilm: remove deplanarization hack
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
ca5456db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
51 deletions
+3
-51
segafilm.c
libavformat/segafilm.c
+2
-50
version.h
libavformat/version.h
+1
-1
No files found.
libavformat/segafilm.c
View file @
42b8f5fb
...
...
@@ -62,10 +62,6 @@ typedef struct FilmDemuxContext {
unsigned
int
base_clock
;
unsigned
int
version
;
/* buffer used for interleaving stereo PCM data */
unsigned
char
*
stereo_buffer
;
int
stereo_buffer_size
;
}
FilmDemuxContext
;
static
int
film_probe
(
AVProbeData
*
p
)
...
...
@@ -87,8 +83,6 @@ static int film_read_header(AVFormatContext *s)
unsigned
int
audio_frame_counter
;
film
->
sample_table
=
NULL
;
film
->
stereo_buffer
=
NULL
;
film
->
stereo_buffer_size
=
0
;
/* load the main FILM header */
if
(
avio_read
(
pb
,
scratch
,
16
)
!=
16
)
...
...
@@ -117,9 +111,9 @@ static int film_read_header(AVFormatContext *s)
film
->
audio_type
=
AV_CODEC_ID_ADPCM_ADX
;
else
if
(
film
->
audio_channels
>
0
)
{
if
(
film
->
audio_bits
==
8
)
film
->
audio_type
=
AV_CODEC_ID_PCM_S8
;
film
->
audio_type
=
AV_CODEC_ID_PCM_S8
_PLANAR
;
else
if
(
film
->
audio_bits
==
16
)
film
->
audio_type
=
AV_CODEC_ID_PCM_S16BE
;
film
->
audio_type
=
AV_CODEC_ID_PCM_S16BE
_PLANAR
;
else
film
->
audio_type
=
AV_CODEC_ID_NONE
;
}
else
...
...
@@ -246,8 +240,6 @@ static int film_read_packet(AVFormatContext *s,
AVIOContext
*
pb
=
s
->
pb
;
film_sample
*
sample
;
int
ret
=
0
;
int
i
;
int
left
,
right
;
if
(
film
->
current_sample
>=
film
->
sample_count
)
return
AVERROR_EOF
;
...
...
@@ -264,45 +256,6 @@ static int film_read_packet(AVFormatContext *s,
if
(
av_new_packet
(
pkt
,
sample
->
sample_size
))
return
AVERROR
(
ENOMEM
);
avio_read
(
pb
,
pkt
->
data
,
sample
->
sample_size
);
}
else
if
((
sample
->
stream
==
film
->
audio_stream_index
)
&&
(
film
->
audio_channels
==
2
)
&&
(
film
->
audio_type
!=
AV_CODEC_ID_ADPCM_ADX
))
{
/* stereo PCM needs to be interleaved */
if
(
ffio_limit
(
pb
,
sample
->
sample_size
)
!=
sample
->
sample_size
)
return
AVERROR
(
EIO
);
if
(
av_new_packet
(
pkt
,
sample
->
sample_size
))
return
AVERROR
(
ENOMEM
);
/* make sure the interleave buffer is large enough */
if
(
sample
->
sample_size
>
film
->
stereo_buffer_size
)
{
av_free
(
film
->
stereo_buffer
);
film
->
stereo_buffer_size
=
sample
->
sample_size
;
film
->
stereo_buffer
=
av_malloc
(
film
->
stereo_buffer_size
);
if
(
!
film
->
stereo_buffer
)
{
film
->
stereo_buffer_size
=
0
;
return
AVERROR
(
ENOMEM
);
}
}
pkt
->
pos
=
avio_tell
(
pb
);
ret
=
avio_read
(
pb
,
film
->
stereo_buffer
,
sample
->
sample_size
);
if
(
ret
!=
sample
->
sample_size
)
ret
=
AVERROR
(
EIO
);
left
=
0
;
right
=
sample
->
sample_size
/
2
;
for
(
i
=
0
;
i
+
1
+
2
*
(
film
->
audio_bits
!=
8
)
<
sample
->
sample_size
;
)
{
if
(
film
->
audio_bits
==
8
)
{
pkt
->
data
[
i
++
]
=
film
->
stereo_buffer
[
left
++
];
pkt
->
data
[
i
++
]
=
film
->
stereo_buffer
[
right
++
];
}
else
{
pkt
->
data
[
i
++
]
=
film
->
stereo_buffer
[
left
++
];
pkt
->
data
[
i
++
]
=
film
->
stereo_buffer
[
left
++
];
pkt
->
data
[
i
++
]
=
film
->
stereo_buffer
[
right
++
];
pkt
->
data
[
i
++
]
=
film
->
stereo_buffer
[
right
++
];
}
}
}
else
{
ret
=
av_get_packet
(
pb
,
pkt
,
sample
->
sample_size
);
if
(
ret
!=
sample
->
sample_size
)
...
...
@@ -322,7 +275,6 @@ static int film_read_close(AVFormatContext *s)
FilmDemuxContext
*
film
=
s
->
priv_data
;
av_freep
(
&
film
->
sample_table
);
av_freep
(
&
film
->
stereo_buffer
);
return
0
;
}
...
...
libavformat/version.h
View file @
42b8f5fb
...
...
@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 55
#define LIBAVFORMAT_VERSION_MINOR 16
#define LIBAVFORMAT_VERSION_MICRO 10
2
#define LIBAVFORMAT_VERSION_MICRO 10
3
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
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