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
874390e1
Commit
874390e1
authored
Jun 18, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: add a convenience function for rescaling timestamps in a packet
parent
440842c4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
APIchanges
doc/APIchanges
+3
-0
avcodec.h
libavcodec/avcodec.h
+13
-0
avpacket.c
libavcodec/avpacket.c
+13
-0
version.h
libavcodec/version.h
+1
-1
No files found.
doc/APIchanges
View file @
874390e1
...
...
@@ -13,6 +13,9 @@ libavutil: 2013-12-xx
API changes, most recent first:
2014-06-xx - xxxxxxx - lavc 55.55.0 - avcodec.h
Add av_packet_rescale_ts() to simplify timestamp conversion.
2014-xx-xx - xxxxxxx - lavf 55.20.0 - avformat.h
The proper way for providing a hint about the desired timebase to the muxers
is now setting AVStream.time_base, instead of AVStream.codec.time_base as was
...
...
libavcodec/avcodec.h
View file @
874390e1
...
...
@@ -3420,6 +3420,19 @@ void av_packet_move_ref(AVPacket *dst, AVPacket *src);
*/
int
av_packet_copy_props
(
AVPacket
*
dst
,
const
AVPacket
*
src
);
/**
* Convert valid timing fields (timestamps / durations) in a packet from one
* timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be
* ignored.
*
* @param pkt packet on which the conversion will be performed
* @param tb_src source timebase, in which the timing fields in pkt are
* expressed
* @param tb_dst destination timebase, to which the timing fields will be
* converted
*/
void
av_packet_rescale_ts
(
AVPacket
*
pkt
,
AVRational
tb_src
,
AVRational
tb_dst
);
/**
* @}
*/
...
...
libavcodec/avpacket.c
View file @
874390e1
...
...
@@ -24,6 +24,7 @@
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#if FF_API_DESTRUCT_PACKET
...
...
@@ -380,3 +381,15 @@ void av_packet_move_ref(AVPacket *dst, AVPacket *src)
*
dst
=
*
src
;
av_init_packet
(
src
);
}
void
av_packet_rescale_ts
(
AVPacket
*
pkt
,
AVRational
src_tb
,
AVRational
dst_tb
)
{
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
)
pkt
->
pts
=
av_rescale_q
(
pkt
->
pts
,
src_tb
,
dst_tb
);
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
)
pkt
->
dts
=
av_rescale_q
(
pkt
->
dts
,
src_tb
,
dst_tb
);
if
(
pkt
->
duration
>
0
)
pkt
->
duration
=
av_rescale_q
(
pkt
->
duration
,
src_tb
,
dst_tb
);
if
(
pkt
->
convergence_duration
>
0
)
pkt
->
convergence_duration
=
av_rescale_q
(
pkt
->
convergence_duration
,
src_tb
,
dst_tb
);
}
libavcodec/version.h
View file @
874390e1
...
...
@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 55
#define LIBAVCODEC_VERSION_MINOR 5
4
#define LIBAVCODEC_VERSION_MINOR 5
5
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
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