[FFmpeg-trac] #377(undetermined:new): ffmpeg reports inaccurate length of some gxf files
FFmpeg
trac at avcodec.org
Tue Aug 2 22:49:10 CEST 2011
#377: ffmpeg reports inaccurate length of some gxf files
----------------------------------+---------------------------
Reporter: acloutier | Owner:
Type: defect | Status: new
Priority: important | Component: undetermined
Version: git | Resolution:
Keywords: gxf ffmpeg length bug | Blocked By:
Blocking: | Reproduced: 0
Analyzed: 0 |
----------------------------------+---------------------------
Comment (by acloutier):
Thanks for the help. I think this patch will work for us (it just reverts
the change/bugfix made in commit
192c14fa5510e8b5e13ed5796ae87aabbfad84d6), but it does sound like our
files may have a unique issue.
{{{
diff --git a/libavformat/gxf.c b/libavformat/gxf.c
index 15893a4..42b3699 100644
--- a/libavformat/gxf.c
+++ b/libavformat/gxf.c
@@ -317,7 +317,7 @@ static int gxf_header(AVFormatContext *s,
AVFormatParameters *ap) {
st = s->streams[idx];
if (!main_timebase.num || !main_timebase.den) {
main_timebase.num = si->frames_per_second.den;
- main_timebase.den = si->frames_per_second.num * 2;
+ main_timebase.den = si->frames_per_second.num *
si->fields_per_frame;
}
st->start_time = si->first_field;
if (si->first_field != AV_NOPTS_VALUE && si->last_field !=
AV_NOPTS_VALUE)
@@ -348,7 +348,7 @@ static int gxf_header(AVFormatContext *s,
AVFormatParameters *ap) {
if (!main_timebase.num || !main_timebase.den) {
// this may not always be correct, but simply the best we
can get
main_timebase.num = fps.den;
- main_timebase.den = fps.num * 2;
+ main_timebase.den = fps.num;
}
} else
av_log(s, AV_LOG_INFO, "UMF packet too short\n");
}}}
--
Ticket URL: <https://avcodec.org/trac/ffmpeg/ticket/377#comment:7>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list