[FFmpeg-devel] [PATCHv4 3/3] avformat/mov: read start_pad from edit list start time if codec is aac
Marton Balint
cus at passwd.hu
Sun Mar 13 00:52:47 CET 2016
Related to ticket #2324, #2325.
Stream duration still need to be fixed...
Signed-off-by: Marton Balint <cus at passwd.hu>
---
libavformat/mov.c | 3 +++
tests/ref/fate/gaplessenc-itunes-to-ipod-aac | 8 ++++----
tests/ref/fate/gaplessenc-pcm-to-mov-aac | 8 ++++----
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4f446ba..3fa8fcc 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2688,6 +2688,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
st->codec->has_b_frames = 1;
}
}
+
+ if (!unsupported && st->codec->codec_id == AV_CODEC_ID_AAC && start_time > 0)
+ sc->start_pad = start_time;
}
/* only use old uncompressed audio chunk demuxing when stts specifies it */
diff --git a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
index b71d094..05dff6e 100644
--- a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
+++ b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac
@@ -1,10 +1,10 @@
[STREAM]
index=0
-start_pts=-1024
+start_pts=0
duration_ts=530224
[/STREAM]
[FORMAT]
-start_time=-0.023220
+start_time=0.000000
duration=12.024000
[/FORMAT]
packet|pts=-1024|dts=-1024|duration=1024
@@ -24,7 +24,6 @@ packet|pts=526336|dts=526336|duration=1024
packet|pts=527360|dts=527360|duration=1024
packet|pts=528384|dts=528384|duration=1840
stream|nb_read_packets=518
-frame|pkt_pts=-1024|pkt_dts=-1024|best_effort_timestamp=-1024|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=0|pkt_dts=0|best_effort_timestamp=0|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=1024|pkt_dts=1024|best_effort_timestamp=1024|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=2048|pkt_dts=2048|best_effort_timestamp=2048|pkt_duration=1024|nb_samples=1024
@@ -32,6 +31,7 @@ frame|pkt_pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_
frame|pkt_pts=4096|pkt_dts=4096|best_effort_timestamp=4096|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=5120|pkt_dts=5120|best_effort_timestamp=5120|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=6144|pkt_dts=6144|best_effort_timestamp=6144|pkt_duration=1024|nb_samples=1024
+frame|pkt_pts=7168|pkt_dts=7168|best_effort_timestamp=7168|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=521216|pkt_dts=521216|best_effort_timestamp=521216|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=522240|pkt_dts=522240|best_effort_timestamp=522240|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=523264|pkt_dts=523264|best_effort_timestamp=523264|pkt_duration=1024|nb_samples=1024
@@ -40,4 +40,4 @@ frame|pkt_pts=525312|pkt_dts=525312|best_effort_timestamp=525312|pkt_duration=10
frame|pkt_pts=526336|pkt_dts=526336|best_effort_timestamp=526336|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=527360|pkt_dts=527360|best_effort_timestamp=527360|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=528384|pkt_dts=528384|best_effort_timestamp=528384|pkt_duration=1840|nb_samples=1024
-stream|nb_read_frames=518
+stream|nb_read_frames=517
diff --git a/tests/ref/fate/gaplessenc-pcm-to-mov-aac b/tests/ref/fate/gaplessenc-pcm-to-mov-aac
index b71d094..05dff6e 100644
--- a/tests/ref/fate/gaplessenc-pcm-to-mov-aac
+++ b/tests/ref/fate/gaplessenc-pcm-to-mov-aac
@@ -1,10 +1,10 @@
[STREAM]
index=0
-start_pts=-1024
+start_pts=0
duration_ts=530224
[/STREAM]
[FORMAT]
-start_time=-0.023220
+start_time=0.000000
duration=12.024000
[/FORMAT]
packet|pts=-1024|dts=-1024|duration=1024
@@ -24,7 +24,6 @@ packet|pts=526336|dts=526336|duration=1024
packet|pts=527360|dts=527360|duration=1024
packet|pts=528384|dts=528384|duration=1840
stream|nb_read_packets=518
-frame|pkt_pts=-1024|pkt_dts=-1024|best_effort_timestamp=-1024|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=0|pkt_dts=0|best_effort_timestamp=0|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=1024|pkt_dts=1024|best_effort_timestamp=1024|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=2048|pkt_dts=2048|best_effort_timestamp=2048|pkt_duration=1024|nb_samples=1024
@@ -32,6 +31,7 @@ frame|pkt_pts=3072|pkt_dts=3072|best_effort_timestamp=3072|pkt_duration=1024|nb_
frame|pkt_pts=4096|pkt_dts=4096|best_effort_timestamp=4096|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=5120|pkt_dts=5120|best_effort_timestamp=5120|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=6144|pkt_dts=6144|best_effort_timestamp=6144|pkt_duration=1024|nb_samples=1024
+frame|pkt_pts=7168|pkt_dts=7168|best_effort_timestamp=7168|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=521216|pkt_dts=521216|best_effort_timestamp=521216|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=522240|pkt_dts=522240|best_effort_timestamp=522240|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=523264|pkt_dts=523264|best_effort_timestamp=523264|pkt_duration=1024|nb_samples=1024
@@ -40,4 +40,4 @@ frame|pkt_pts=525312|pkt_dts=525312|best_effort_timestamp=525312|pkt_duration=10
frame|pkt_pts=526336|pkt_dts=526336|best_effort_timestamp=526336|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=527360|pkt_dts=527360|best_effort_timestamp=527360|pkt_duration=1024|nb_samples=1024
frame|pkt_pts=528384|pkt_dts=528384|best_effort_timestamp=528384|pkt_duration=1840|nb_samples=1024
-stream|nb_read_frames=518
+stream|nb_read_frames=517
--
2.6.2
More information about the ffmpeg-devel
mailing list