oggdemux: rename local variable for clarity

While the casual reader might end up bewildered by just why this
change might increase clarity, it just happens than, in the libogg
and associated sources, op is the canonical name for an ogg_packet
whlie og is the canonical name for an ogg_page, and reading this
code confuses me.

https://bugzilla.gnome.org/show_bug.cgi?id=657151
This commit is contained in:
Vincent Penquerc'h 2011-08-23 10:40:12 +01:00 committed by Sebastian Dröge
parent 5d18496a5b
commit 564eedd214

View file

@ -2656,7 +2656,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
GstFlowReturn ret; GstFlowReturn ret;
GstOggChain *chain = NULL; GstOggChain *chain = NULL;
gint64 offset = ogg->offset; gint64 offset = ogg->offset;
ogg_page op; ogg_page og;
gboolean done; gboolean done;
gint i; gint i;
@ -2668,12 +2668,12 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
GstOggPad *pad; GstOggPad *pad;
guint32 serial; guint32 serial;
ret = gst_ogg_demux_get_next_page (ogg, &op, -1, NULL); ret = gst_ogg_demux_get_next_page (ogg, &og, -1, NULL);
if (ret != GST_FLOW_OK) { if (ret != GST_FLOW_OK) {
GST_WARNING_OBJECT (ogg, "problem reading BOS page: ret=%d", ret); GST_WARNING_OBJECT (ogg, "problem reading BOS page: ret=%d", ret);
break; break;
} }
if (!ogg_page_bos (&op)) { if (!ogg_page_bos (&og)) {
GST_WARNING_OBJECT (ogg, "page is not BOS page"); GST_WARNING_OBJECT (ogg, "page is not BOS page");
/* if we did not find a chain yet, assume this is a bogus stream and /* if we did not find a chain yet, assume this is a bogus stream and
* ignore it */ * ignore it */
@ -2687,7 +2687,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
chain->offset = offset; chain->offset = offset;
} }
serial = ogg_page_serialno (&op); serial = ogg_page_serialno (&og);
if (gst_ogg_chain_get_stream (chain, serial) != NULL) { if (gst_ogg_chain_get_stream (chain, serial) != NULL) {
GST_WARNING_OBJECT (ogg, GST_WARNING_OBJECT (ogg,
"found serial %08x BOS page twice, ignoring", serial); "found serial %08x BOS page twice, ignoring", serial);
@ -2695,7 +2695,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
} }
pad = gst_ogg_chain_new_stream (chain, serial); pad = gst_ogg_chain_new_stream (chain, serial);
gst_ogg_pad_submit_page (pad, &op); gst_ogg_pad_submit_page (pad, &og);
} }
if (ret != GST_FLOW_OK || chain == NULL) { if (ret != GST_FLOW_OK || chain == NULL) {
@ -2734,7 +2734,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
gboolean known_serial = FALSE; gboolean known_serial = FALSE;
GstFlowReturn ret; GstFlowReturn ret;
serial = ogg_page_serialno (&op); serial = ogg_page_serialno (&og);
done = TRUE; done = TRUE;
for (i = 0; i < chain->streams->len; i++) { for (i = 0; i < chain->streams->len; i++) {
GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i); GstOggPad *pad = g_array_index (chain->streams, GstOggPad *, i);
@ -2748,10 +2748,10 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
/* submit the page now, this will fill in the start_time when the /* submit the page now, this will fill in the start_time when the
* internal decoder finds it */ * internal decoder finds it */
gst_ogg_pad_submit_page (pad, &op); gst_ogg_pad_submit_page (pad, &og);
if (!pad->map.is_skeleton && pad->start_time == -1 if (!pad->map.is_skeleton && pad->start_time == -1
&& ogg_page_eos (&op)) { && ogg_page_eos (&og)) {
/* got EOS on a pad before we could find its start_time. /* got EOS on a pad before we could find its start_time.
* We have no chance of finding a start_time for every pad so * We have no chance of finding a start_time for every pad so
* stop searching for the other start_time(s). * stop searching for the other start_time(s).
@ -2777,7 +2777,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
} }
if (!done) { if (!done) {
ret = gst_ogg_demux_get_next_page (ogg, &op, -1, NULL); ret = gst_ogg_demux_get_next_page (ogg, &og, -1, NULL);
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
break; break;
} }