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
7346354b
Commit
7346354b
authored
Feb 20, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/microdvd: fix muxing.
This was broken since
1f265f52
.
parent
580e2285
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
Makefile
libavformat/Makefile
+1
-1
microdvdenc.c
libavformat/microdvdenc.c
+19
-2
No files found.
libavformat/Makefile
View file @
7346354b
...
@@ -196,7 +196,7 @@ OBJS-$(CONFIG_MATROSKA_MUXER) += matroskaenc.o matroska.o \
...
@@ -196,7 +196,7 @@ OBJS-$(CONFIG_MATROSKA_MUXER) += matroskaenc.o matroska.o \
OBJS-$(CONFIG_MD5_MUXER)
+=
md5enc.o
OBJS-$(CONFIG_MD5_MUXER)
+=
md5enc.o
OBJS-$(CONFIG_MGSTS_DEMUXER)
+=
mgsts.o
OBJS-$(CONFIG_MGSTS_DEMUXER)
+=
mgsts.o
OBJS-$(CONFIG_MICRODVD_DEMUXER)
+=
microdvddec.o
OBJS-$(CONFIG_MICRODVD_DEMUXER)
+=
microdvddec.o
OBJS-$(CONFIG_MICRODVD_MUXER)
+=
microdvdenc.o
rawenc.o
OBJS-$(CONFIG_MICRODVD_MUXER)
+=
microdvdenc.o
OBJS-$(CONFIG_MJPEG_DEMUXER)
+=
rawdec.o
OBJS-$(CONFIG_MJPEG_DEMUXER)
+=
rawdec.o
OBJS-$(CONFIG_MJPEG_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_MJPEG_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_MLP_DEMUXER)
+=
rawdec.o
OBJS-$(CONFIG_MLP_DEMUXER)
+=
rawdec.o
...
...
libavformat/microdvdenc.c
View file @
7346354b
...
@@ -19,12 +19,14 @@
...
@@ -19,12 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include <inttypes.h>
#include "avformat.h"
#include "avformat.h"
#include "
rawenc
.h"
#include "
internal
.h"
static
int
microdvd_write_header
(
struct
AVFormatContext
*
s
)
static
int
microdvd_write_header
(
struct
AVFormatContext
*
s
)
{
{
AVCodecContext
*
avctx
=
s
->
streams
[
0
]
->
codec
;
AVCodecContext
*
avctx
=
s
->
streams
[
0
]
->
codec
;
AVRational
tb
=
avctx
->
time_base
;
if
(
s
->
nb_streams
!=
1
||
avctx
->
codec_id
!=
AV_CODEC_ID_MICRODVD
)
{
if
(
s
->
nb_streams
!=
1
||
avctx
->
codec_id
!=
AV_CODEC_ID_MICRODVD
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Exactly one MicroDVD stream is needed.
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"Exactly one MicroDVD stream is needed.
\n
"
);
...
@@ -36,6 +38,21 @@ static int microdvd_write_header(struct AVFormatContext *s)
...
@@ -36,6 +38,21 @@ static int microdvd_write_header(struct AVFormatContext *s)
avio_write
(
s
->
pb
,
avctx
->
extradata
,
avctx
->
extradata_size
);
avio_write
(
s
->
pb
,
avctx
->
extradata
,
avctx
->
extradata_size
);
avio_flush
(
s
->
pb
);
avio_flush
(
s
->
pb
);
}
}
avpriv_set_pts_info
(
s
->
streams
[
0
],
64
,
tb
.
num
,
tb
.
den
);
return
0
;
}
static
int
microdvd_write_packet
(
AVFormatContext
*
avf
,
AVPacket
*
pkt
)
{
avio_printf
(
avf
->
pb
,
"{%"
PRId64
"}"
,
pkt
->
pts
);
if
(
pkt
->
duration
<
0
)
avio_write
(
avf
->
pb
,
"{}"
,
2
);
else
avio_printf
(
avf
->
pb
,
"{%"
PRId64
"}"
,
pkt
->
pts
+
pkt
->
duration
);
avio_write
(
avf
->
pb
,
pkt
->
data
,
pkt
->
size
);
avio_write
(
avf
->
pb
,
"
\n
"
,
1
);
avio_flush
(
avf
->
pb
);
return
0
;
return
0
;
}
}
...
@@ -45,7 +62,7 @@ AVOutputFormat ff_microdvd_muxer = {
...
@@ -45,7 +62,7 @@ AVOutputFormat ff_microdvd_muxer = {
.
mime_type
=
"text/x-microdvd"
,
.
mime_type
=
"text/x-microdvd"
,
.
extensions
=
"sub"
,
.
extensions
=
"sub"
,
.
write_header
=
microdvd_write_header
,
.
write_header
=
microdvd_write_header
,
.
write_packet
=
ff_raw
_write_packet
,
.
write_packet
=
microdvd
_write_packet
,
.
flags
=
AVFMT_NOTIMESTAMPS
,
.
flags
=
AVFMT_NOTIMESTAMPS
,
.
subtitle_codec
=
AV_CODEC_ID_MICRODVD
,
.
subtitle_codec
=
AV_CODEC_ID_MICRODVD
,
};
};
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