From 903c79e7673666957467c1dccb6a19e2e22e90c0 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sun, 13 Sep 2009 15:55:02 -0700 Subject: [PATCH] dvdemux: Use values from decoder structure directly Don't store the same values in the GstDvDemux. This fixes a bug where dvdemux would detect a stream as PAL instead of NTSC, and silently parse it wrong. --- ext/dv/gstdvdemux.c | 16 +++++++--------- ext/dv/gstdvdemux.h | 2 -- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c index 22afd85..ecba891 100644 --- a/ext/dv/gstdvdemux.c +++ b/ext/dv/gstdvdemux.c @@ -1293,7 +1293,7 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, GstBuffer * buffer, /* get params */ /* framerate is already up-to-date */ - height = (dvdemux->PAL ? PAL_HEIGHT : NTSC_HEIGHT); + height = dvdemux->decoder->height; wide = dv_format_wide (dvdemux->decoder); /* see if anything changed */ @@ -1304,7 +1304,7 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, GstBuffer * buffer, dvdemux->height = height; dvdemux->wide = wide; - if (dvdemux->PAL) { + if (dvdemux->decoder->system == e_dv_system_625_50) { if (wide) { par_x = PAL_WIDE_PAR_X; par_y = PAL_WIDE_PAR_Y; @@ -1364,7 +1364,7 @@ gst_dvdemux_is_new_media (GstDVDemux * dvdemux, GstBuffer * buffer) int dif; int n_difs; - n_difs = dvdemux->PAL ? 12 : 10; + n_difs = dvdemux->decoder->num_dif_seqs; for (dif = 0; dif < n_difs; dif++) { if (dif & 1) { @@ -1500,9 +1500,8 @@ gst_dvdemux_flush (GstDVDemux * dvdemux) goto parse_header_error; /* after parsing the header we know the length of the data */ - dvdemux->PAL = dv_system_50_fields (dvdemux->decoder); - length = dvdemux->frame_len = (dvdemux->PAL ? PAL_BUFFER : NTSC_BUFFER); - if (dvdemux->PAL) { + length = dvdemux->frame_len = dvdemux->decoder->frame_size; + if (dvdemux->decoder->system == e_dv_system_625_50) { dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR; dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR; } else { @@ -1626,9 +1625,8 @@ gst_dvdemux_loop (GstPad * pad) goto parse_header_error; /* after parsing the header we know the length of the data */ - dvdemux->PAL = dv_system_50_fields (dvdemux->decoder); - dvdemux->frame_len = (dvdemux->PAL ? PAL_BUFFER : NTSC_BUFFER); - if (dvdemux->PAL) { + dvdemux->frame_len = dvdemux->decoder->frame_size; + if (dvdemux->decoder->system == e_dv_system_625_50) { dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR; dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR; } else { diff --git a/ext/dv/gstdvdemux.h b/ext/dv/gstdvdemux.h index b77f4f4..9a4173d 100644 --- a/ext/dv/gstdvdemux.h +++ b/ext/dv/gstdvdemux.h @@ -57,8 +57,6 @@ struct _GstDVDemux { GstAdapter *adapter; gint frame_len; - /* PAL or NTSC flag */ - gboolean PAL; /* video params */ gint framerate_numerator; gint framerate_denominator; -- 2.7.4