<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 1, 2015 at 9:48 AM, Jean-Paul Saman <span dir="ltr"><<a href="mailto:jpsaman@videolan.org" target="_blank">jpsaman@videolan.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Daniel,<br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Sun, May 31, 2015 at 10:03 PM, Daniel Kamil Kozar <span dir="ltr"><<a href="mailto:dkk089@gmail.com" target="_blank">dkk089@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">b_mpeg2 in dvbpsi_vstream_dr_t corresponds to what the H.222.0 refers to<br>
as the "MPEG_1_only_flag". If the flag is not set, it means that no<br>
extra data is contained at the end of the descriptor. The code in<br>
dr_02.c did exactly the opposite.<br>
---<br>
src/descriptors/dr_02.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/descriptors/dr_02.c b/src/descriptors/dr_02.c<br>
index 774a1c0..1c35d83 100644<br>
--- a/src/descriptors/dr_02.c<br>
+++ b/src/descriptors/dr_02.c<br>
@@ -60,7 +60,7 @@ dvbpsi_vstream_dr_t * dvbpsi_DecodeVStreamDr(dvbpsi_descriptor_t * p_descriptor)<br>
if(!p_decoded) return NULL;<br>
<br>
/* Decode data and check the length */<br>
- p_decoded->b_mpeg2 = !((p_descriptor->p_data[0] & 0x04) ? true : false);<br>
+ p_decoded->b_mpeg2 = (p_descriptor->p_data[0] & 0x04) ? true : false;<br>
if( (!p_decoded->b_mpeg2 && (p_descriptor->i_length != 1))<br>
|| (p_decoded->b_mpeg2 && (p_descriptor->i_length != 3)))<br>
{<br>
<span><font color="#888888">--<br>
2.4.2<br>
<br></font></span></blockquote></span><div><br>Could you double check the specs, because it would mean a revert of 25cdb9fd, which I believe is correct in the mentioned specs.<br>That H.222.0 and " ISO/IEC 13818-1 : 2000, table 2-40 and 2.6.3" contradict each other is quite unlikely IMHO.<br><br>$> git show 25cdb9fd<br>commit 25cdb9fd7ce804ec69b91fa1b0887435c474b32d<br>Author: Jean-Baptiste Kempf <<a href="mailto:jb@videolan.org" target="_blank">jb@videolan.org</a>><br>Date: Tue Aug 12 04:04:47 2014 +0200<br><br> Correctly flag mpeg2 video data in video_stream_descriptor<br> <br> See ISO/IEC 13818-1 : 2000, table 2-40 and 2.6.3<br> <br> See <a href="https://trac.videolan.org/vlc/ticket/4200" target="_blank">https://trac.videolan.org/vlc/ticket/4200</a><br> <br> Signed-off-by: Jean-Paul Saman <<a href="mailto:jpsaman@videolan.org" target="_blank">jpsaman@videolan.org</a>><br><br>diff --git a/src/descriptors/dr_02.c b/src/descriptors/dr_02.c<br>index 1c35d83..774a1c0 100644<span class=""><br>--- a/src/descriptors/dr_02.c<br>+++ b/src/descriptors/dr_02.c<br>@@ -60,7 +60,7 @@ dvbpsi_vstream_dr_t * dvbpsi_DecodeVStreamDr(dvbpsi_descriptor_t * p_descriptor)<br> if(!p_decoded) return NULL;<br> <br> /* Decode data and check the length */<br></span>- p_decoded->b_mpeg2 = (p_descriptor->p_data[0] & 0x04) ? true : false;<br>+ p_decoded->b_mpeg2 = !((p_descriptor->p_data[0] & 0x04) ? true : false);<span class=""><br> if( (!p_decoded->b_mpeg2 && (p_descriptor->i_length != 1))<br> || (p_decoded->b_mpeg2 && (p_descriptor->i_length != 3)))<br> {<br></span></div></div></div></div></blockquote><div><div><br></div><div>H.222.0 page 65 says:<br><br>"MPEG_1_only_flag – This is a 1-bit field which when set to '1' indicates that the video stream contains only<br>ISO/IEC 11172-2 data. If set to '0' the video stream may contain both ITU-T Rec. H.262 | ISO/IEC 13818-2 video data<br>and constrained parameter ISO/IEC 11172-2 video data."<br><br></div><div>Meaning
that if this flag is '0', then there is extra data. If we now translate
that to b_mpeg2 boolean in libdvbpsi, then it means that<br></div><div>b_mpeg2 should be the inverse of the MPEG_1_only_flag, or b_mpeg2 = !(MPEG_1_only_flag).<br></div><div><br></div><div>On bit level that becomes:<br></div><div>(p_data[0] & 0x04) => 0 when the flag is not set, thus extra data and variable p_decoded->b_mpeg2 should become true<br>(p_data[0] & 0x04) => 1 when the flag is set, thus mpeg1 only data and variable p_decoded->b_mpeg2 should become false<br><br></div><div>Hence I believe the current code is correct, since that is exactly what happens now. <br></div><div><br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span class=""> <br></span></div><div>Kind regards,<br><br></div><div>Jean-Paul Saman<br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span><font color="#888888">
_______________________________________________<br>
libdvbpsi-devel mailing list<br>
<a href="mailto:libdvbpsi-devel@videolan.org" target="_blank">libdvbpsi-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/libdvbpsi-devel" target="_blank">https://mailman.videolan.org/listinfo/libdvbpsi-devel</a><br>
</font></span></blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>